X Tutup
The Wayback Machine - https://web.archive.org/web/20210119193747/https://github.com/realpython/python-guide/issues/895
Skip to content
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

python 3 setup slightly incorrect for OSX High Sierra #895

Open
bnorquist opened this issue Mar 22, 2018 · 6 comments
Open

python 3 setup slightly incorrect for OSX High Sierra #895

bnorquist opened this issue Mar 22, 2018 · 6 comments

Comments

@bnorquist
Copy link
Contributor

@bnorquist bnorquist commented Mar 22, 2018

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

@kennethreitz42
Copy link
Contributor

@kennethreitz42 kennethreitz42 commented May 13, 2018

Please send a pull request!

@bnorquist
Copy link
Contributor Author

@bnorquist bnorquist commented May 14, 2018

done :D #898

@charliesneath
Copy link

@charliesneath charliesneath commented May 25, 2018

@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?

@charliesneath
Copy link

@charliesneath charliesneath commented May 25, 2018

Realized this is mentioned in #840 by @chsm in his comment.

@apjanke
Copy link
Contributor

@apjanke apjanke commented Dec 18, 2018

See #960 for a bit more discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.
X Tutup