I have both Python 3.5 and Python 3.6 on my laptop. I am using Ubuntu 16.04. I used pip3 to install numpy. It is working with Python3.5 but not with Python3.6. Please help.
To install via pip for specific python version use:
py -(python-version) -m pip install numpy
in your case
py -3.6 -m pip install numpy
Make sure that your Python is Python 3.6:
python --version
Python 3.6.4
Now install with:
python -m pip install numpy
This will run the pip for the current Python the option -m imports the module pip and runs it as it would be pip as command line app.
Cannot comment since I don't the rep.
If your default python is 3.5 when you check python --version, the way to go would be to find the location of the python executable for the desired version (here 3.6).
cd to that folder and then run the command given by Mike.
Related
I'm trying to make a pip install of the fastf1 library. I noticed that I was using py 3.7 and that lib requires 3.8 or superior. I updated my interpreter (to python 3.10) but, the pip install keeps returning "ERROR: Could not find a version that satisfies the requirement fastf1". My python --version returns 3.10, but my pip version, although updated, still calling the anaconda's pip
How do I change the main pip to be used in this project?
Terminal result:
PS C:\Users...\Github\speedmetrica\DataAnalysis> python --version
Python 3.10.0
PS C:\Users...\Github\speedmetrica\DataAnalysis> pip --version
pip 21.3.1 from c:\users\jgbal\anaconda3\lib\site-packages\pip (python 3.7)
If python --version is running the desired version of Python, instead of running:
pip install packagename
run:
python -mpip install packagename
That runs the pip module installed for that version of Python as the entry point using the same Python executable you've been running, so it will install for that version of Python as well.
If you're on Windows, and installed as admin to install the Python launcher for Windows, you can be avoid relying on the PATH having a specific version appear first by running:
py -3 -mpip install packagename
which will run the latest installed version of Python 3. Changing to:
py -3.10 -mpip install packagename
will force it to run the latest installed copy of Python 3.10 specifically.
I am working on a GPU instance on AWS. There are some already provided Conda environments. I am using tensorflow2_latest_p37 environment.
This environment has 2 python 3 versions .i.e python 3.6 and python 3.7.
All the preinstalled packages are available in python 3.7
But whenever I am trying to do pip install dlib it would install it for python 3.6.
How can I install this for python 3.7?
Run the command:
which python.
Probably it will show you python3.6,
it means that your default python version is 3.6.
You need to search your pip3 path.
path/to/pip3 install dlib.
If you know how to use the Python 3.7 environment, you can simply use python -m pip install ... or more exactly:
command_for_python3.7 -m pip install package_name
If unsure, you should search for commands starting with python in /bin, /usr/bin and /usr/local/bin. You could also have Python installations under /opt.
On Windows, the magic word is py:
py 3.7 -m pip install package_name
I had python 3.8 installed and then I installed python 2.7. I am trying to run a python program with py -2 program.py in vs code using with python 2.7 as selected environment and I am getting an error, ImportError: No module named googlemaps even though I have already installed.
If I run the program using Python3 then it would run fine. Also when I open vs code using python 2.7 as selected runtime environment then I would get a warning Linter Pylint is not installed. If I click on install then I would get another warning There's no Pip installer available in the selected environment.
Also even though I have changed the python path from 3.7 to 2.7, default python version will still show up as 3.7 when I runPython in command line.
Things that I have tried to install the googlemaps module for python 2 after googling for solutions,
pip2 install googlemaps--upgrade
py -2 -m pip install googlemaps
If you have your python2 binary located, you can just call it directly:
/usr/bin/python2 -m pip install googlemaps
And if you're not sure where your python binary is, you can use
import sys
print(sys.executable)
to locate it.
And if you don't have pip, you should install it by downloading this file:
https://bootstrap.pypa.io/get-pip.py
then running:
/usr/bin/python2 get-pip.py
It is recommended to install Python 3.8 using Pyenv and also when you are using different versions of python, it is very useful
curl https://pyenv.run | bash
pyenv install 3.8.1
pyenv virtualenv 3.8.1 venv
pyenv local venv
with pyenv local you set your version for use.
If after this you run
pyenv version
It will output to 3.8.1
With regards to pip installation, run
whereis python
and if it outputs to
usr/bin/python2
then you can use pip for installing python2 packages and pip3 for packages compatible to python3.
I'm trying to use pip to install a program specifically to python 3.6.4, but when I run
py -3.6 -m pip install package
It installs to 3.6.1
However, if I try to specify the specific version of 3.6 I want with
py -3.6.4 -m pip install package
It returns this output
Unknown option: -3
I'm guessing the argument for the version does not allow for the second period or something, but does someone else know a way to get around this? I'd prefer to do this without uninstalling 3.6.1
You can use pyenv
You should isntall pyenv and run these command
pyenv install 3.6.4
pyenv global 3.6.4
python -m pip install package
I'm trying to install Python-Twitch for Python 3.4. I have both 3.4 and 3.5 installed on my computer, and in command prompt I do this:
python --version
Where it gives me Python 3.5.x. Then:
set PATH=C:\Python34\;%PATH%
And python --version will then read Python 3.4.x.
Once I do 'pip install python-twitch', it installs it to the Python 3.5 Lib/Site-Packages folder. How would I get this over to 3.4?
Thanks so much for any help.
I think this was already answered: pip: dealing with multiple Python versions?
Since version 0.8, Pip supports pip-{version}. You can use it the same as easy_install-{version}:
$ pip-2.5 install myfoopackage
$ pip-2.6 install otherpackage
$ pip-2.7 install mybarpackage
EDIT: pip changed its schema to use pipVERSION instead of pip-VERSION in version 1.5. You should use the following if you have pip >= 1.5:
$ pip2.6 install otherpackage
$ pip2.7 install mybarpackage
Check https://github.com/pypa/pip/pull/1053 for more details