python-guide icon indicating copy to clipboard operation
python-guide copied to clipboard

Discrepancy in Installation Python 3 on Windows

Open uranusjr opened this issue 8 years ago • 3 comments

The Working with Python 3 section mentions you should use python3 to launch the Python 3 interpreter, which does not actually work. The Windows distribution provides only python.exe for all versions of Python, and to launch the Python 3 interpreter you need python. This also creates problems if you install both Python 2 and 3—the executables override each other, and only one of the exes is visible at a time through %Path% (what actually is visible depends on the order of the search paths).

AFAIK the official way to deal with this problem is through the py launcher, but that only solves the python.exe problem, not other scripts installed later during the setup (e.g. pip vs pip3), and other global tools (e.g. pipenv). It will affect other parts of the tutorial as well.

uranusjr avatar Oct 02 '17 08:10 uranusjr

pull requests accepted!

kennethreitz avatar Oct 02 '17 13:10 kennethreitz

Since both pip and pipenv can be run as py -m pip or py -m pipenv, and py -2 runs v2 of Python, there is a way to handle simultaneously installed versions on Windows:

> py -m pip --version
pip 9.0.1 from C:\Users\twwilliams\AppData\Local\Programs\Python\Python36\lib\site-packages (python 3.6)
> py -2 -m pip --version
pip 9.0.1 from C:\Users\twwwilliams\.windows-build-tools\python27\lib\site-packages (python 2.7)

I will try to take some time over the holiday to put together a pull request to address this.

twwilliams avatar Dec 22 '17 23:12 twwilliams

I think this has been resolved by making Python 3 the default version in the guide and assuming python means Python 3 everywhere. Can this be closed out?

apjanke avatar Dec 18 '18 07:12 apjanke