I'm using PyCharm on Windows. I have a project setup for small experiments with algorithms that uses it's own virtual environment. I was trying to install tensorflow and I got an error that I'm running pip 10.0.1 and should upgrade to 18.1, which I did through "File/Settings/Project Interpreter". It now says 18.1. But I'm still getting warnings about using version 10.0.1.
(venv) C:\users\xxx\pycharmprojects\so> pip list
...
pip 10.0.1
You are using pip version 10.0.1, however version 18.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
(venv) C:\users\xxx\pycharmprojects\so>python -m pip install --upgrade pip
Requirement already up-to-date: pip in c:\users\xxx\pycharmprojects\so\venv\lib\site-packages (18.1)
(venv) C:\users\xxx\pycharmprojects\so> pip list
...
pip 10.0.1
You are using pip version 10.0.1, however version 18.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
(venv) C:\users\xxx\pycharmprojects\so>python -m pip list
...
pip 18.1
After a bit of discussion, we've got the problem solved.
Here's what was wrong:
PyCharm is unable to properly update pip under Windows while using virtualenv (possible bug/issue)
The reason why installation of Tensorflow was failing at first place was that it strictly requires Python3.5 under Windows, while the problem occured with Python3.7, so switching to Python3.5 VirtualEnv in PyCharm solved the issue.
NOTE: No pip update was required in order to install Tensroflow with Pycharm + Python3.5 venv
It has happened to me after upgrading to Python 3.7.1 and pip 19.0.3.
It was solved after making sure that both new Python installation folder and corresponding Scripts folder are included in the PATH environment variable prior to creating a new virtual environment for my project.
Related
I'm using python3.8.6 and I need to upgrade to 3.9.x. After upgrade the python, myproject.py cannot find a module that already installed using pip3 install opencv-python.
when run python3 myproject.py occurs error that ModuleNotFoundError tensorflow, and tensorflow should be 2.5.x so I'm trying to install python 3.9.x.
pip --version shows pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)
How can I change that (python3.8) to (python3.9)?
sorry for my bad English..
python -m pip install –upgrade pip.
If you type pip list it will show you every package installed and should say something like WARNING: You are using pip version 21.2.3; however, version 21.2.4 is available.
You should consider upgrading via this command:
c:\users\x\python.exe -m pip install --upgrade pip
I am on Windows 10 and just installed Python 3.7.4. I installed virtualenv using pip install virtualenv, and i got the message that i installed 16.7.2 while 19.2.1 is available. I then used python -m pip install --upgrade pip to upgrade.
Here is the issue: when i type pip freeze on Powershell, i am getting this:
virtualenv==16.7.2
but when i type pip --version, i am getting this:
pip 19.2.1 from c:\users\user1\python\lib\site-packages\pip (python 3.7)
Can you please let me know why pip freeze still shows the old version?
Thanks.
pip and virtualenv are 2 different cases where pip is mainly used for installing python packages and virtualenv for utilizing virtual environments while development.
The following command updates only pip not virtual env
python -m pip install --upgrade pip
If you think you still need to upgrade virtualenv (of course if a new version is available). Please follow the following syntax without specifying a version.
pip install [package] --upgrade
This question has already been asked here, though there is no answer solving this problem.
pip upgrade fails inside virtual environment
The above question is duplicate and the references following answer:
gaierror: [Errno -2] Name or service not known
But this answer doesnot contain anything valid. The former answer also does not contain any helpful info!
My problem is exactly what is described in first link. I try upgrade pip from 10.0.1 to 18.1 but unable to. As a consequence I am unable to install Tensorflow. This Virtual environment is actually connected to pycharm and I am referencing it through command line. Here is the input and corresponding commandline output:
(venv) G:\Ashish\Tensorflow\venv\Scripts>pip install --upgrade pip
ERROR: To modify pip, please run the following command:
G:\Ashish\Tensorflow\venv\Scripts\python.exe -m pip install --upgrade pip
You are using pip version 10.0.1, however version 18.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
(venv) G:\Ashish\Tensorflow\venv\Scripts>G:\Ashish\Tensorflow\venv\Scripts\python.exe -m pip install --upgrade pip
Requirement already up-to-date: pip in g:\ashish\tensorflow\venv\lib\site-packages (18.1)
(venv) G:\Ashish\Tensorflow\venv\Scripts>pip --version
pip 10.0.1 from g:\ashish\tensorflow\venv\lib\site-packages\pip-10.0.1-py3.7.egg\pip (python 3.7)
(venv) G:\Ashish\Tensorflow\venv\Scripts>pip install --upgrade pip
ERROR: To modify pip, please run the following command:
G:\Ashish\Tensorflow\venv\Scripts\python.exe -m pip install --upgrade pip
You are using pip version 10.0.1, however version 18.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
(venv) G:\Ashish\Tensorflow\venv\Scripts>
I tried uninstalling the pip from virtual environment. I did not work. I am sorry if this is basic or involves basic knowledge about virtual env, This is my learning phase and some time before I can start to contribute to this awesome community.
Ok, solved the problem, thanks to suggestions of #hoefling and#Rahul Bhardwaj
For python environment showing 10.0.1 and 18.1:
pip in your virtual environment is 18.1 while the global pip is 10.0.1. So the issue is solved, simply upgrade global pip
For tensorflow not installing:
Install python 3.6
Add that to path
Create a virtual environment in pycharm using python 3.6
Install tensorflow
Done! Python 3.7 is yet to support tensorflow
I have a brand new installation of python 3.7.1 64-bit and I'm using the latest pyCharm as my IDE. I have no other installation of python on this machine.
I go to install numpy and I get this message:
(venv) C:\Users\John\PycharmProjects\project>pip install numpy
Requirement already satisfied: numpy in c:\users\john\pycharmprojects\pysims\venv\lib\site-packages (1.15.4)
You are using pip version 10.0.1, however version 18.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
So I run the suggested command but it's already up-to-date
(venv) C:\Users\John\PycharmProjects\project>python -m pip install --upgrade pip
Requirement already up-to-date: pip in c:\users\john\pycharmprojects\pysims\venv\lib\site-packages (18.1)
So I check the version but it's still the old version
(venv) C:\Users\John\PycharmProjects\pySIMS>pip -V
pip 10.0.1 from c:\users\john\pycharmprojects\pysims\venv\lib\site-packages\pip-10.0.1-py3.7.egg\pip (python 3.7)
I thought I'd try py -3 to upgrade and it works.
(venv) C:\Users\John\PycharmProjects\pySIMS>py -3 -m pip install --upgrade pip
Collecting pip
Using cached https://files.pythonhosted.org/packages/c2/d7/90f34cb0d83a6c5631cf71dfe64cc1054598c843a92b400e55675cc2ac37/pip-18.1-py2.py3-none-any.whl
Installing collected packages: pip
Found existing installation: pip 10.0.1
Uninstalling pip-10.0.1:
Successfully uninstalled pip-10.0.1
Successfully installed pip-18.1
But the version is still old
(venv) C:\Users\John\PycharmProjects\pySIMS>pip -V
pip 10.0.1 from c:\users\john\pycharmprojects\pysims\venv\lib\site-packages\pip-10.0.1-py3.7.egg\pip (python 3.7)
WHAT IS GOING ON? Am I missing something totally obvious? I've never had an issue like this working in Python 2 but since I've moved to Python 3 it's been nothing but errors.
This is looking like you have multiple installation of pip, one that comes first in the PATH (pip) and another that is recognized by python (python -m pip).
Try running the command:
pip show pip
and
python -m pip show pip
And check if the path are the same.
If not i would suggest uninstalling the undesired one, or change your your PATH environment variable to have the folder containing the correct pip come before the folder with the wrong one.
When I got this error I had 2 pip version folders in site-packages. One pip-19.2.3.dist-info and another something like pip-10.0.1. I deleted the first one, leaving only the default version. Then running python -m pip install --upgrade pip fixed the problem
I had a similar issue where I was upgrading pip; however, my issue what that I had a pip.conf file that pointed to a repo that didn't have the version to upgrade to. I removed the pip.conf to allow it to go to the default repo and it was able to download the correct version and upgrade.
1.Open you project setting(File>Settings)
2.Project>Project Interpreter
3.find pip and lick the triangle on the right(in the red circle I draw)
On a windows 7 machine I have pip version 1.5.6 installed:
pip 1.5.6 from C:\Users\dietz\PNC\tas\ENV\lib\site-packages (python 2.7)
In order to find the reason for an error I want to install a different version of pip, which worked fine for me. So how can I uninstall pip and install version 1.2.1 instead?
pip itself is just a normal python package. Thus you can install pip with pip.
Of cource, you don't want to affect the system's pip, install it inside a virtualenv.
pip install pip==1.2.1
If downgrading from pip version 10 because of PyCharm manage.py or other python errors:
python -m pip install pip==9.0.1
If you want to upgrade or downgrade to different version of pip, better use --upgrade option at one go instead doing it in two steps. i.e. first uninstalling the existing and then re-installing to new version, below does both in one go as shown below.
USE: Executed on WIN10 with Bash
python -m pip install --upgrade pip==19.2.3
$ python -m pip install --upgrade pip==19.2.3
Collecting pip==19.2.3
Using cached pip-19.2.3-py2.py3-none-any.whl (1.4 MB)
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 21.3.1
Uninstalling pip-21.3.1:
Successfully uninstalled pip-21.3.1
Successfully installed pip-19.2.3
well the only thing that will work is
python -m pip install pip==
you can and should run it under IDE terminal (mine was pycharm)
If you have to downgrade pip version do following steps:
step1. pip uninstall pip
step2. pip install pip==version number you want to install or downgrade
step3. check version of pip using pip --version
This process also works when any other package giving error exit code(2) you can follow these steps and install your package.