How to install 64-bit packages with 64-bit and 32-bit versions?

I recently decided to learn general algorithms, and I needed to install the Tensorflow package. Tensorflow only works on python with only 64 bits, so I install python 3.5.0 64 bits without removing 32-bit python. because I was afraid to lose my packages in python 32 bit by deleting it. The problem is how can I get pip install to install the package on the 64-bit version of python instead of the 32-bit version.

+5
source share
3 answers

If you really managed to install both x64 and x32 packages, you could just do

C:\path\to\corresponding\python.exe -m pip install <package> 

This will ensure that pip used correctly and the package is installed for a specific python instance.

+4
source

Starting with Python 3.3, coexistence has become much easier with the Python Launcher for Windows . (Also see PEP 397.) From the command line, you can use "py" or "pyw" instead of "python" or "pythonw". The py command allows you to specify the version and version of python startup. For example, open a command window and enter "py -3". This launches the latest version of python 3 and uses the 64-bit version by default, if available. On the original poster system, entering this command will launch the python 3.5-64 bit interpreter.

This command can also be used to run the correct protocol version without knowing the exact path to the python version you want to install. "py -3.5 -m pip install [package]" will install [package] into the 64-bit version of python3.5.

If you have both 64-bit and 32-bit versions installed and you ever need to install them on the 32-bit version, you need to enter both major and minor version numbers as part of the command and add '-32' to the command argument. "py -3.5-32 -m pip install [package]" will install the 32-bit version.

+2
source

I have 64- and 32-bit python environments on my machine.

To target 32-bit or 64-bit, I edit the environment variables by setting PATH for the entire python installation and one environment variable pointing to the script area where the pyinstaller is located.

 .....\Continuum\anaconda3_32bit .....\Continuum\anaconda3_32bit\Scripts or .....\Continuum\anaconda3 .....\Continuum\anaconda3\Scripts 

I run pip install pyinstaller (which uses PATH to find the right versions of PIP and pyinstaller).

The application must be created using the correct python environment.

0
source

Source: https://habr.com/ru/post/1266779/


All Articles