-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Add guide on using multiple Python versions for local development #1621
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
Conversation
brew install pyenv | ||
``` | ||
|
||
1. Install the [pyenv-virtualenv](https://github.com/pyenv/pyenv-virtualenv) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you put the command to install it here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added in a739f4d
MAC_SETUP.md
Outdated
1. Install the [pyenv-virtualenv](https://github.com/pyenv/pyenv-virtualenv) | ||
plugin. | ||
|
||
1. Add |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Append the following to your ~/.bashrc file:
MAC_SETUP.md
Outdated
brew upgrade pyenv | ||
``` | ||
|
||
1. Compile the necessary Python versions with pyenv. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe say something like grab the latest minor versions of the major version you are looking for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added in 327f506
MAC_SETUP.md
Outdated
1. Set the local Python version(s) with `pyenv local` | ||
|
||
``` | ||
pyenv local python-docs-samples 3.6.4 3.7.0 3.5.4 2.715 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you include above this line what the 2 parameters are like
#pyenv local [name of virtualenv] [list of python versions to use]
pyenv local python-docs-samples 3.6.4 3.7.0 3.5.4 2.715
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in a739f4d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great :) Thanks for writing this
MAC_SETUP.md
Outdated
pyenv local python-docs-samples 3.6.4 3.7.0 3.5.4 2.7.15 | ||
``` | ||
|
||
1. Now when you `cd` into the source directory or a subdirectory within it, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: s/Now/Now,
MAC_SETUP.md
Outdated
more than one version, it will also add binaries like `python36` and | ||
`python27` to your PATH, which nox uses when picking Python interpreters. | ||
|
||
1. Since we don't want to add the pyenv configuration to git, add |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rephrasing suggestion: Add .python-version to your global gitignore file, so it wont be committed into the repository.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it! Done.
This guide recommends
pyenv
andpyenv-virtualenv
. I know there are many options, but this is what works for me.