-
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
best way to start shell / work under different Pythons #631
Comments
I think the recommended way (not sure if it's documented somewhere) is to use poetry in conjunction with pyenv (see this comment). |
Maybe I'm missing something obvious, but pyenv/pyenv#1244? |
pyenv is the way to go. On a per project basis you can create virtualenv with specific python versions as well as switch between different virtualenvs and python versions as needed with a single command. Do not go down the path of trying to use your existing system interpreter for your project. The system interpreter is included in order to run your system, let it do that, and manage interpreter for your project separately. Frequently your operating system and your project will have conflicting requirements as far as python / virtualenv setup goes and trying work around those conflicts will just eat up your productive time. |
@purificant - I've found most system pythons to be sane, but sure. How can I 'register' these with pyenv? |
Sounds like pyenv is not a good choice for your use case. If you require using a specific build of python, then I would create a virtual environment using that interpreter, activate it, which should point |
Ah, true. I guess pyenv is close to what I want, but building everything seems silly. That's a rant for the pyenv tracker though, so I think I have my answer here :-) |
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. |
Question
My system python, as returned by
/usr/bin/env python
is Python 2.7, so for me, by default I get a Python 2.7 env, which is no longer what I want ;-)Probably a non poetry question: but how would I change my system, config so that
/usr/bin/env python
returnwhich python3.7
?In any case, I still need to support 2.7 and 3.6+ on most of my libraries, so it looks like I can do this by doing the following:
...for a 3.7 env, and the following for a 2.7 env:
Is that the best way or have I missed something?
Does this need to be in the docs somewhere or have I just missed them?
The text was updated successfully, but these errors were encountered: