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

Potential for confusion on Pipenv & Virtual Environments #840

Open
Pilgrim1379 opened this issue Sep 8, 2017 · 4 comments
Open

Potential for confusion on Pipenv & Virtual Environments #840

Pilgrim1379 opened this issue Sep 8, 2017 · 4 comments

Comments

@Pilgrim1379
Copy link

I arrived on the Pipenv & Virtual Environments page from Installing Python 3 on Mac OS X. At that point, I've have installed python2 and python3 via homebrew and there is also the system python. Installing Python 3 on Mac OS X clearly states that

Working with Python 3
At this point, you have the system Python 2.7 available, potentially the Homebrew version of Python 2 installed, and the Homebrew version of Python 3 as well.

$ python
will launch the system Python interpreter.

$ python2
will launch the homebrew-installed Python 2 interpreter (if any).

$ python3
will launch the homebrew-installed Python 3 interpreter.

And yet on Pipenv & Virtual Environments the first thing I'm encouraged to do is make sure python3 is installed by typing $python --version which will display the system Python interpreter version.

This could potentially confuse a new developer who may be wondering why they are seeing version say 2.7.x instead of 3.6.x as the writeup suggest. Besides as at the time of writting there are not many OS's that have $python defaulting to version 3.6.x.

If the writeup in insisting of starting Python 3 with the command $python then it needs to be explained how this can be done safely.

Thanks.

@kennethreitz
Copy link
Contributor

This part of the guide says that it's written for 3, but will work fine with 2.

@clmay
Copy link

clmay commented Sep 12, 2017

@kennethreitz:

I'm not sure that's the issue.

Let's say we have a brand new installation of macOS (i.e. we only have a system installation of Python 2.6.x or 2.7.x) and we want to install Python 3. We go here and follow your instructions:

$ brew install python3

The new Python 3 installation will live wherever Homebrew installed it, and we can access that Python 3 and Pip installation by running python3 and pip3:

$ which python3
/usr/local/bin/python3

$ which pip3
/usr/local/bin/pip3

Then, we move onto the virtual environments page...

We are told to check to make sure we have Python and Pip installed by running python --version and pip --version...

But the problem is, those commands are going to reference the system Python installation and there will be no system Pip installed:

$ which python
/usr/bin/python

$ which pip
=> # no output

I think the issue which @ThePreacher is trying to report, and which had me scratching my head tonight as well, is the mismatch between the instructions given and the actual commands necessary to complete them on a macOS system which uses your suggested Python installation method.

@clmay
Copy link

clmay commented Sep 12, 2017

Also, not sure if this should be in a separate issue or not, but after following the Homebrew installation instructions, USER_BASE is actually ~/Library/Python/3.6, so it might be useful to point out that Mac users will need to export $HOME/Library/Python/3.6/bin to their path, as the ~/.local bit only applies on Linux. Gosh-darn Apple has to ruin everything with their non-standard system hierarchy!

@lukewcn
Copy link

lukewcn commented Nov 15, 2017

This is confused me too on Mac

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

No branches or pull requests

4 participants