How to install Python package from source on Windows

eryk sun eryksun at gmail.com
Thu May 25 13:57:36 EDT 2017


On Thu, May 25, 2017 at 4:09 PM, Deborah Swanson
<python at deborahswanson.net> wrote:
> Could be, maybe it's something they do for every installation, whether
> it will use it or not. But it always breaks when it can't install Visual
> Studio. Upgrade pip does run and it works up to that point. It gets as
> far as uninstalling the old pip, but then there's no way to get any pip
> reinstalled.

ensurepip bootstraps the installation of setuptools and pip. The two
wheels [1] get copied to a temp directory and added directly to
sys.path (zipped packages are supported in sys.path). Then pip is run
directly out of the wheel and proceeds to install setuptools and pip
from the same two wheels that were copied to the temp directory. No
extension modules need to be built. No C compiler is required, nor
should one be invoked.

[1]: https://www.python.org/dev/peps/pep-0491

If running ensurepip tries to use distutils or setuptools to build an
extension module, then something is fundamentally wrong with the
installation of Python 3.4. I would uninstall it and install a freshly
downloaded copy of 3.4.4:

32-bit: https://www.python.org/ftp/python/3.4.4/python-3.4.4.msi
64-bit: https://www.python.org/ftp/python/3.4.4/python-3.4.4.amd64.msi

Before installing 3.4.4, remove all traces of the old 3.4
installation(s) that may have been left behind after uninstalling.
Remove the installation directory and delete any registry keys for
"Python\PythonCore\3.4"  found under HKCU\Software, HKLM\Software, or
HKLM\Software\WOW6432Node. Make sure PYTHONHOME isn't set in the
environment variables, and if PYTHONPATH is set, ensure that it does
not include any directories that are part of a standard installation.

If you choose to reinstall 3.4, make sure you enable the option to
install pip (which is implemented using ensurepip) and the option to
add Python to PATH. If you're installing for all users to a secured
directory, I also recommend selecting the advanced option to
pre-compile the standard library.

After installing, open a command prompt and run the following command
to upgrade to the latest version of pip:

    python -m pip install --upgrade pip

After upgrading, you should be able to install wheels that use the
newer tag fields in the wheel filename.



More information about the Python-list mailing list