I am using Windows 10. Currently, I have Python 2.7 installed. I would like to install Python 3.5 as well. However, if I have both 2.7 and 3.5 installed, when I run pip
, how do I get the direct the package to be installed to the desired Python version?
you can install both python 2 and python 3 in your machine but you can not use both in single code editor in same time. To use both at same time you have to open one IDEs with python 2 and another IDEs with python 3. Yes you can . But, you need to set different environment variables for each of the version.
If you're using Python 2.7. 9 (or greater), 3.4 (or greater), then PIP is already built into the Python installer. When you download the latest release, you should remember that a particular release isn't supported indefinitely. According to Python's development cycle, support for Python 3.4 ended in March 2019.
You will have to use the absolute path of pip
.
E.g: if I installed python 3 to C:\python35
, I would use:
C:\> python35\Scripts\pip.exe install packagename
Or if you're on linux, use pip3 install packagename
If you don't specify a full path, it will use whichever pip
is in your path
.
Because usually i change my intepreter to run something(i got 2 diff projects with both 2 and 3), i use these solution:
python3 -m pip install 'somepackage'
and to run pip on python2
python -m pip install 'somepackage'
This is may not the best solution out there, but i like this one
** WINDOWS **
ref : https://datascience.com.co/how-to-install-python-2-7-and-3-6-in-windows-10-add-python-path-281e7eae62a
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With