python-guide
python-guide copied to clipboard
python 3 setup slightly incorrect for OSX High Sierra
When using brew install python and adding export PATH=/usr/local/bin:/usr/local/sbin:$PATH
to your .profile python still points to the system python executable. Instead you have to add this to the .profile: export PATH="/usr/local/opt/python/libexec/bin:$PATH"
.
I created a local branch on my computer with this edit but it is saying I don't have permissions to push it. I did a good amount of googling to get this set up so figured I would try to save others the time in the future :)
see first comment on this SA thread: https://stackoverflow.com/questions/5157678/python-homebrew-by-default/48101303#48101303
Fork the repository and ask for a Pull Request !! 😄
https://help.github.com/articles/fork-a-repo/
https://help.github.com/articles/creating-a-pull-request/
Please send a pull request!
done :D https://github.com/kennethreitz/python-guide/pull/898
@bnorquist I was having a similar problem, but followed the instructions in the note in this section of the documentation:
If pipenv isn’t available in your shell after installation, you’ll need to add the user base‘s binary directory to your PATH.
On Linux and macOS you can find the user base binary directory by running python -m site --user-base and adding bin to the end. For example, this will typically print ~/.local (with ~ expanded to the absolute path to your home directory) so you’ll need to add ~/.local/bin to your PATH. You can set your PATH permanently by modifying ~/.profile.
When I run python -m site --user-base
, I get /Users/charliesneath/Library/Python/3.6
. I added the following to ~./profile
:
export PATH="~/Library/Python/3.6/bin"
and this fixed this issue I was having not being able to run pipenv
.
Is this related to the fix you found above?
Realized this is mentioned in #840 by @chsm in his comment.
See https://github.com/realpython/python-guide/issues/960 for a bit more discussion.
and this fixed this issue I was having not being able to run
pipenv
.
Hi! Even if you could run pipenv
, the documentation of pipenv discourages the installation with brew install pipenv
:
Homebrew installation is discouraged because each time the Homebrew Python is upgraded, which Pipenv depends on, users have to re-install Pipenv, and perhaps all virtual environments managed by it.