-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
poetry default to using python instead of python3 #3184
Comments
It also fails to create the virtual environment. My current config is as follows:
|
The issue here is that the poetry executable has This is a hack and not a solution. I don't know why this is not the default behavior. |
The shebang for
Which means, Furthermore having With the next feature release we will drop python2 support. And I'm pretty sure we will then hardcode the shebang to python3. Until then the installer is smart enough to detect if you have a @pedrorrivero : Please be so kind to open a different issue for this and describe what happens. fin swimmer |
When you say installer, are you taking abut |
I would also expect that if running get-poetry.py with python3, Sure, it's easy enough to adjust the shebang line manually, but not when installing Poetry in an automated way. |
How about simply changing the following line in get-poetry.py
to
This first tries Python 3, which doesn't spit out a big warning message. In fact, this is how it is done for Windows:
|
could you explain where (ie. in which file) do you edit this line |
In my case, I was constantly getting after a fresh ❯ poetry add psycopg2
Command ['python', '-I', '-W', 'ignore', '-'] errored with the following return code 2
Error output:
Unknown option: -I
usage: /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python [option] ... [-c cmd | -m mod | file | -] [arg] ...
Try `python -h' for more information.
Input:
import sys
if hasattr(sys, "real_prefix"):
print(sys.real_prefix)
elif hasattr(sys, "base_prefix"):
print(sys.base_prefix)
else:
print(sys.prefix) What solved it for me was removing the virtual environment - it seems it's not getting deleted during rm -rf ~/Library/Caches/pypoetry/virtualenvs |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I am on the latest Poetry version.
I have searched the issues of this repo and believe that this is not a duplicate.
[n/a ] If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option).OS version and name: macOS big sur
Poetry version: 1.1.2
python3.8 installed with home-brew
Issue
when creating a new project with poetry it sets the python version as python 2.7 by default rather than using the latest available version.
It also ironically prints the warning:
The text was updated successfully, but these errors were encountered: