Related
Originally, my app crashed with error ERROR: Failed building wheel for pycairo (in the picture)
Failed to build pycairo
I tried to fix it by running several commands
sudo apt install libcairo2-dev
sudo apt install cloud-init
Gave the same error. No fix.
then I tried uninstalling the requirements.txt and reinstalled
pip uninstall -r requirements.txt
pip install -r requirements.txt
Did not solve the issue.
then I tried the below command, but I still got the same error "Failed building wheel for pycairo":
pip3 install --upgrade pip (from this thread: ERROR: Could not build wheels for scipy which use PEP 517 and cannot be installed directly
then I tried this command:
pip install --upgrade pip setuptools wheel
and I got this error in the picture: "Invalid version: '0.23ubuntu1'"
Invalid version: '0.23ubuntu1'
I tried to also delete this package but it's showing that package not found:
command I used: sudo apt-get remove distro-info
Error:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'distro-info' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 283 not upgraded.
I searched for solutions but did not find any regarding the error "Invalid version: '0.23ubuntu1'". Now, when I run "flask run", I get error: -bash: /home/ktai/.local/bin/flask: No such file or directory
Would appreciate any help!
I tried several command lines but nothing worked
I learned from this answer that there is a "bug" with versions of setuptools causing this specific Invalid version: '0.23ubuntu1' error.
Despite seeing errors with all sorts of pip commands including pip install, I was surprised to see that this downgrade command (from the answer linked) appears to resolve the issue:
pip install --upgrade --user setuptools==58.3.0
Are you using ubuntu 20.04 by chance?
I had a similar issue but it had to do nothing with pycairo so the situation might be different for you.
The existence of distro-info (with a version not compliant to PEP-440) among my Python packages was leading to the error message from your post's title whenever i tried to install another package.
For me, this one helped: (so you were close with the apt-get remove...)
python3 -m pip uninstall -y distro-info
In my case, it seems like it didnt break anything important so i will keep it like this.
But there is no guarantee the same works for you as well. Also, you might get it back the next time you install packages from your requirements.txt file.
If I understood this thread correctly, there might be updates with a compliant version of this package depending on which Ubuntu version you are using.
This error arises from PEP 440 (Python Enhancement Proposal #440), which enforces conventions for naming of Python packages, and this error seems to really only happen on Debian-based distros like Ubuntu. For example, I have been trying to install a package via pip and get an error:
pkg_resources.extern.packaging.version.InvalidVersion: Invalid version: '1.1build1' (package: distro-info)
So it's telling us that 1.1build1 is an invalid version name per PEP 440, and it's probably getting the distro-info package from, in my case, Ubuntu (came preinstalled).
I can get around this by using a Python virtual environment and not allowing it to use system-site-packages, sometimes called "global packages".
The solution is to remove the offending package and reinstall a version of it that meets PEP 440 requirements (e.g. following the "0.0.0" convention. "1.2.0" for example is fine, "1.2build3" is not).
pip uninstall -y distro-info
pip install distro-info==1.0
Additionally, within PyCharm, I can navigate to the Python Interpreter settings, choose the interpreter I am using from the Python Interpreter dropdown, and confirm that the version of distro-info it's trying to use is 1.1build1. To "upgrade" this to 1.0, I can double-click on the "1.0" under the "Latest Version" column and select "Install Package" from the modal that pops up.
If this or the above command to remove distro-info isn't working, you can use this same window to remove distro-info and then simply run pip install distro-info==1.0.
Thank you for all the answers. To answer my own question, I was finally able to fix the issue by updating all the required packages.
Now there are no updates needed, and the app works again.
0 updates can be applied immediately.
The list of available updates is more than a week old.
To check for new updates run: sudo apt update
I'm having a hard time setting up python packages. EasyInstall from SetupTools is supposed to help that, but they don't have an executable for Python 2.6.
For instance to install Mechanize, I'm just supposed to put the Mechanize folder in C:\Python24\Lib\site-packages according to INSTALL.txt, but runnning the tests does not work. Can someone help shed some light on this? Thanks!
The accepted answer is outdated. So first, pip is preferred over easy_install, (Why use pip over easy_install?). Then follow these steps to install pip on Windows, it's quite easy.
Install setuptools:
curl https://bootstrap.pypa.io/ez_setup.py | python
Install pip:
curl https://bootstrap.pypa.io/get-pip.py | python
Optionally, you can add the path to your environment so that you can use pip anywhere. It's somewhere like C:\Python33\Scripts.
Newer versions of Python for Windows come with the pip package manager. (source)
pip is already installed if you're using Python 2 >=2.7.9 or Python 3 >=3.4
Use that to install packages:
cd C:\Python\Scripts\
pip.exe install <package-name>
So in your case it'd be:
pip.exe install mechanize
This is a good tutorial on how to get easy_install on windows. The short answer: add C:\Python26\Scripts (or whatever python you have installed) to your PATH.
You don't need the executable for setuptools.
You can download the source code, unpack it, traverse to the downloaded directory and run python setup.py install in the command prompt
Starting with Python 2.7, pip is included by default. Simply download your desired package via
python -m pip install [package-name]
As I wrote elsewhere
Packaging in Python is dire. The root cause is that the language ships without a package manager.
Fortunately, there is one package manager for Python, called Pip. Pip is inspired by Ruby's Gem, but lacks some features. Ironically, Pip itself is complicated to install. Installation on the popular 64-bit Windows demands building and installing two packages from source. This is a big ask for anyone new to programming.
So the right thing to do is to install pip. However if you can't be bothered, Christoph Gohlke provides binaries for popular Python packages for all Windows platforms http://www.lfd.uci.edu/~gohlke/pythonlibs/
In fact, building some Python packages requires a C compiler (eg. mingw32) and library headers for the dependencies. This can be a nightmare on Windows, so remember the name Christoph Gohlke.
I had problems in installing packages on Windows. Found the solution. It works in Windows7+. Mainly anything with Windows Powershell should be able to make it work. This can help you get started with it.
Firstly, you'll need to add python installation to your PATH variable. This should help.
You need to download the package in zip format that you are trying to install and unzip it. If it is some odd zip format use 7Zip and it should be extracted.
Navigate to the directory extracted with setup.py using Windows Powershell (Use link for it if you have problems)
Run the command python setup.py install
That worked for me when nothing else was making any sense. I use Python 2.7 but the documentation suggests that same would work for Python 3.x also.
Upgrade the pip via command prompt ( Python Directory )
D:\Python 3.7.2>python -m pip install --upgrade pip
Now you can install the required Module
D:\Python 3.7.2>python -m pip install <<yourModuleName>>
pip is the package installer for python, update it first, then download what you need
python -m pip install --upgrade pip
Then:
python -m pip install <package_name>
You can also just download and run ez_setup.py, though the SetupTools documentation no longer suggests this. Worked fine for me as recently as 2 weeks ago.
PS D:\simcut> C:\Python27\Scripts\pip.exe install networkx
Collecting networkx
c:\python27\lib\site-packages\pip\_vendor\requests\packages\urllib3\util\ssl_.py:318: SNIMissingWarning: An HTTPS reques
t has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may caus
e the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer ve
rsion of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissi
ngwarning.
SNIMissingWarning
c:\python27\lib\site-packages\pip\_vendor\requests\packages\urllib3\util\ssl_.py:122: InsecurePlatformWarning: A true SS
LContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL con
nections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.
readthedocs.io/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Downloading networkx-1.11-py2.py3-none-any.whl (1.3MB)
100% |################################| 1.3MB 664kB/s
Collecting decorator>=3.4.0 (from networkx)
Downloading decorator-4.0.11-py2.py3-none-any.whl
Installing collected packages: decorator, networkx
Successfully installed decorator-4.0.11 networkx-1.11
c:\python27\lib\site-packages\pip\_vendor\requests\packages\urllib3\util\ssl_.py:122: InsecurePlatformWarning: A true SSLContext object i
s not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade
to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplat
formwarning.
InsecurePlatformWarning
Or just put the directory to your pip executable in your system path.
As mentioned by Blauhirn after 2.7 pip is preinstalled. If it is not working for you it might need to be added to path.
However if you run Windows 10 you no longer have to open a terminal to install a module. The same goes for opening Python as well.
You can type directly into the search menu pip install mechanize, select command and it will install:
If anything goes wrong however it may close before you can read the error but still it's a useful shortcut.
I run sudo pip install git-review, and get the following messages:
Downloading/unpacking git-review
Cannot fetch index base URL http://pypi.python.org/simple/
Could not find any downloads that satisfy the requirement git-review
No distributions at all found for git-review
Storing complete log in /home/sai/.pip/pip.log
Does anyone has any idea about this?
I know this is an old thread, but I encountered this issue today and wanted to share my solution to the problem because I haven't seen this solution elsewhere on SO.
My environment: Python 2.7.12/2.7.14 on Ubuntu 12.04.5 LTS in a virtualenv, pip version 1.1.
My Errors:
pip install nose
in console:
Cannot fetch index base URL http://pypi.python.org/simple/
in ~/.pip/pip.log:
Could not fetch URL http://pypi.python.org/simple/: HTTP Error 403: SSL is required
Curious for me because I had been running these same commands in a script without issue for about a year.
this fixed it:
pip install --index-url=https://pypi.python.org/simple/ nose
(note the https)
You need to upgrade your pip installation because it is still using http instead of https.
The --index-url (short version: -i) option allows you to specify an index-url in the call to pip itself, there you can use the https-variant. Then you can instruct pip to upgrade itself.
sudo pip install --index-url https://pypi.python.org/simple/ --upgrade pip
Afterwards you should be able to use pip without the --index-url option.
I believe that the release 7.0.0 (2015-05-21) triggered this issue. The release note for that version states the following:
BACKWARD INCOMPATIBLE No longer implicitly support an insecure origin
origin, and instead require insecure origins be explicitly trusted
with the --trusted-host option.
You can check your pip version with pip --version.
This would mean that issuing sudo pip install --trusted-host --upgrade pip once would also solve this issue, albeit download pip over insecure http. This might also not work at all, because it is possible that the insecure endpoint is no longer accessible on the server (I have not tested this).
EDIT:
The current version of PIP no longer has this issue. As of right now, version: 7.1.2 is the current version. Here is the PIP link:
https://pypi.python.org/pypi/pip
ORIGINAL FIX:
I got this issue when trying to use pip==1.5.4
This is an issue related to PIP and Python's PYPI trusting SSL certificates. If you look in the PIP log in Mac OS X at: /Users/username/.pip/pip.log it will give you more detail.
My workaround to get PIP back up and running after hours of trying different stuff was to go into my site-packages in Python whether it is in a virtualenv or in your normal site-packages, and get rid of the current PIP version. For me I had pip==1.5.4
I deleted the PIP directory and the PIP egg file. Then I ran
easy_install pip==1.2.1
This version of PIP doesn't have the SSL issue, and then I was able to go and run my normal pip install -r requirements.txt within my virtualenv to set up all packages that I wanted that were listed in my requirements.txt file.
This is also the recommended hack to get passed the issue by several people on this Google Group that I found:
https://groups.google.com/forum/#!topic/beagleboard/aSlPCNYcVjw
I added --proxy command line option to point to the proxy and it's working (pip version is 1.5.4 and python 2.7). for some reason it was not taking the shell env variables HTTPS_PROXY, HTTP_PROXY, https_proxy, http_proxy.
sudo pip --proxy [user:passwd#]proxy.server:port install git-review
Check your proxy connection, I had a similar issue, then I changed my connection which wasn't proxied and boom, of it started downloading and setting up the library
I had the same issue with pip 1.5.6.
I just deleted the ~/.pip folder and it worked like a charm.
rm -r ~/.pip/
I had the same problem with pip==1.5.6. I had to correct my system time.
# date -s "2014-12-09 10:09:50"
This worked for me on Ubuntu 12.04.
pip install --index-url=https://pypi.python.org/simple/ -U scikit-learn
If that's not a proxy/network problem you should try to create/edit config file .pip/pip.conf or if you are running pip as root /root/.pip/pip.conf. Check and change index-url from http to https.
It should be like this:
[global]
index-url=https://pypi.python.org/simple/
Worked for me with Ubuntu 12 and pip 9.0.1
it works!
sudo pip --proxy=http://202.194.64.89:8000 install elasticsearch ;
202.194.64.89:8000 is my PROXY,
In my case (Python 3.4, in a virtual environment, running under macOS 10.10.6) I could not even upgrade pip itself. Help came from this SO answer in the form of the following one-liner:
curl https://bootstrap.pypa.io/get-pip.py | python
(If you do not use a virtual environment, you may need sudo python.)
With this I managed to upgrade pip from Version 1.5.6 to Version 10.0.0 (quite a jump!). This version does not use TLS 1.0 or 1.1 which are not supported any more by the Python.org site(s), and can install PyPI packages nicely. No need to specify --index-url=https://pypi.python.org/simple/.
I was able to fix this by upgrading my python, which had previously been attached to an outdated version of OpenSSL. Now it is using 1.0.1h-1 and my package will pip install.
FYI, my log and commands, using anaconda and installing the pytest-ipynb package [1] :
$ conda update python
Fetching package metadata: ....
Solving package specifications: .
Package plan for installation in environment /Users/me/anaconda/envs/py27:
The following NEW packages will be INSTALLED:
openssl: 1.0.1h-1
The following packages will be UPDATED:
python: 2.7.5-3 --> 2.7.8-1
readline: 6.2-1 --> 6.2-2
sqlite: 3.7.13-1 --> 3.8.4.1-0
tk: 8.5.13-1 --> 8.5.15-0
Proceed ([y]/n)? y
Unlinking packages ...
[ COMPLETE ] |#############################################################| 100%
Linking packages ...
[ COMPLETE ] |#############################################################| 100%
$ pip install pytest-ipynb
Downloading/unpacking pytest-ipynb
Downloading pytest-ipynb-0.1.1.tar.gz
Running setup.py (path:/private/var/folders/4f/b8gwyhg905x94twqw2pbklyw0000gn/T/pip_build_me/pytest-ipynb/setup.py) egg_info for package pytest-ipynb
Requirement already satisfied (use --upgrade to upgrade): pytest in /Users/me/anaconda/envs/py27/lib/python2.7/site-packages (from pytest-ipynb)
Installing collected packages: pytest-ipynb
Running setup.py install for pytest-ipynb
Successfully installed pytest-ipynb
Cleaning up...
[1] My ticket about this issue; https://github.com/zonca/pytest-ipynb/issues/1
I faced same problem but that was related proxy. it was resolved by setting proxy.
Set http_proxy=http://myuserid:mypassword#myproxyname:myproxyport
Set https_proxy=http://myuserid:mypassword#myproxyname:myproxyport
This might help someone.
If your proxy is configured correctly, then pip version 1.5.6 will handle this correctly. The bug was resolved.
You can upgrade pip with easy_install pip==1.5.6
Extra answer: if you are doing this from chroot.
You need source of random numbers to be able to establish secure connection to pypi.
On linux, you can bind-mount host dev to chroot dev:
mount --bind /dev /path-to-chroot/dev
I also got this error while installing pyinstaller in a proxied connection. I just connect direct Internet connection(Using my dongle) and did that again.
sudo pip install pyinstaller
This worked for me.
You might be missing a DNS server conf in /etc/resolv.conf
make sure u can ping to:
ping pypi.python.org
if you're not getting a ping try to add a DNS server to file...something like:
nameserver xxx.xxx.xxx.xxx
My explanation/enquiry is for windows environment.
I am pretty new to python, and this is for someone still novice than me.
I installed the latest pip(python installer package) and downloaded 32 bit/64 bit (open source) compatible binaries from http://www.lfd.uci.edu/~gohlke/pythonlibs/, and it worked.
Steps followed to install pip, though usually pip is installed by default during python installation from www.python.org/downloads/
- Download pip-7.1.0.tar.gz from https://pypi.python.org/pypi/pip.
- Unzip and un-tar the above file.
- In the pip-7.1.0 folder, run: python setup.py install. This installed pip latest version.
Use pip to install(any feasible operation) binary package.
Run the pip app to do the work(install file), as below:
\python27\scripts\pip2.7.exe install file_path\file_name --proxy
If you face, wheel(i.e egg) issue, use the compatible binary package file.
Hope this helps.
in my case I would install django (
pip install django
)
and it has a same problem with ssl certificate (Cannot fetch index base URL http://pypi.python.org/simple/ )
it's from virtualenv so DO :
FIRST:
delete your virtualenv
deactivate
rm -rf env
SECOND:
check have pip
pip3 -V
if you don't have
sudo apt-get install python3-pip
FINALLY:
install virtualenv with nosite-packages
and make your virenviroment
sudo pip3 install virtualenv
virtualenv --no-site-packages -p /usr/bin/python3.6
. env/bin/activate
Check ~/.pip/pip.log
It could contain the error message
Could not fetch URL https://pypi.python.org/simple/pip/: 403 Client Error: [[[!!! BREAKING CHANGE !!!]]] Support for clients that do not support Server Name Indication is temporarily disabled and will be permanently deprecated soon. See https://status.python.org/incidents/hzmjhqsdjqgb and https://github.com/pypa/pypi-support/issues/978 [[[!!! END BREAKING CHANGE !!!]]]
If so, the fix is to upgrade to that last version of Python 2.7. See https://github.com/pypa/pypi-support/issues/978
In my case I could do that with add-apt-repository ppa:fkrull/deadsnakes-python2.7 && apt-get update && apt-get upgrade but YMMV may vary depending on distribution.
I had a similar problem, but in my case I was getting the error:
Downloading/unpacking bencode
Cannot fetch index base URL http://c.pypi.python.org/simple/
Could not find any downloads that satisfy the requirement bencode
No distributions at all found for bencode
Storing complete log in /home/andrew/.pip/pip.log
In my case I was able to fix the error by editing ~/.pip/pip.conf and changing http://c.pypi.python.org/simple/ to http://pypi.python.org/simple and then pip worked fine again.
I got this error message in ~/.pip/pip.log
Could not fetch URL https://pypi.python.org/simple/: connection error: [Errno 185090050] _ssl.c:344: error:0B084002:x509 certificate routines:X509_load_cert_crl_file:system lib
Will skip URL https://pypi.python.org/simple/ when looking for download links for regulargrid
I fixed it by updating my ~/.pip/pip.conf. It accidentally pointed to cacert.pem file that did not exist and looked like this
[global]
cert = /some/path/.pip/cacert.pem
I used to use the easy_install pip==1.2.1 workaround but I randomly found that if you're having this bug, you probably installed a 32bit version of python.
If you install a 64bit version of it by installing it from the source and then build you virtualenv upon it, you wont have that pip bug anymore.
I too used the chosen solution (downgrading pip) to work around this issue until I ran into another seemingly unrelated issue caused by the same underlying problem. Python's version of OpenSSL was out of date. Check your OpenSSL version:
python -c 'import ssl; print(ssl.OPENSSL_VERSION)'
If the version is 0.9.7, that should verify that OpenSSL needs to be updated. If you know how to do that directly, great (but please let me know in a comment). If not, you can follow the advice in this answer, and reinstall python from the 64 bit/32 bit installer instead of the 32 bit only installer from python.org (I'm using python 3.4.2). I now have OpenSSL version 0.9.8, and none of these issues.
Try doing reinstallation of pip :
curl -O https://pypi.python.org/packages/source/p/pip/pip-1.2.1.tar.gz
tar xvfz pip-1.2.1.tar.gz
cd pip-1.2.1
python setup.py install
If curl doesnot work , you will have proxy issues , Please fix that it should work fine. Check after opening google.com in your browser in linux.
The try installing
pip install virtualenv
In case you use a firewall, make sure outbound connections to port 443 are not blocked, e.g. run:
sudo iptables -A OUTPUT -p tcp --dport 443 -j ACCEPT
I have met the same questions with you. When I realize it may be caused by unmatched version of numpy or pip, I uninstalled numpy and pip, then continue as this 'https://radimrehurek.com/gensim/install.html', at last I succeed!
C:\Users\Asus>pip install matplotlib
Downloading/unpacking matplotlib
Cannot fetch index base URL https://pypi.python.org/simple/
Could not find any downloads that satisfy the requirement matplotlib
Cleaning up...
No distributions at all found for matplotlib
Storing debug log for failure in C:\Users\Asus\pip\pip.log
I used 'easy_install pip==1.2.1' and it worked fine.
C:\Users\Asus>easy_install pip==1.2.1
Searching for pip==1.2.1
Reading https://pypi.python.org/simple/pip/
Best match: pip 1.2.1
Downloading ...
Then on using this command 'pip install matplotlib'
C:\Users\Asus>pip install matplotlib
Downloading/unpacking matplotlib
Downloading matplotlib-2.0.0b4.tar.gz (unknown size):
If you're running these commands in a Docker container on Windows, it may mean that your docker machine's network connection is stale and needs to be rebuilt. To fix it, run these commands:
docker-machine stop
docker-machine start
#FOR /f "tokens=*" %i IN ('docker-machine env') DO #%i
I'm now getting this in $HOME/.pip/pip.log:
Could not fetch URL https://pypi.python.org/simple/: HTTP Error 403: TLSv1.2+ is required
I don't have a straightforward solution for this, but I'm mentioning it as something to watch out for before you waste time on trying some of the other solutions here.
I'm obviously already using a https URL
There is no proxy or firewall issue
Using trusted-host didn't change anything (dunno where I picked this up)
For what it's worth my openssl is too old to even have ssl.OPENSSL_VERSION so maybe that's really the explanation here.
In the end, wiping my virtual environment and recreating it with virtualenv --setuptools env seems to have fixed at least the major blockers.
This is on a really old Debian box, Python 2.6.6.
I've just uploaded a new version of my package to PyPi (1.2.1.0-r4): I can download the egg file and install it with easy_install, and the version checks out correctly. But when I try to install using pip, it installs version 1.1.0.0 instead. Even if I explicitly specify the version to pip with pip install -Iv tome==1.2.1.0-r4, I get this message: Requested tome==1.2.1.0-r4, but installing version 1.1.0.0, but I don't understand why.
I double checked with parse_version and confirmed that the version string on 1.2.1 is greater than that on 1.1.0 as shown:
>>> from pkg_resources import parse_version as pv
>>> pv('1.1.0.0') < pv('1.2.1.0-r4')
True
>>>
So any idea why it's choosing to install 1.1.0 instead?
This is an excellent question. It took me forever to figure out. This is the solution that works for me:
Apparently, if pip can find a local version of the package, pip will prefer the local versions to remote ones. I even disconnected my computer from the internet and tried it again -- when pip still installed the package successfully, and didn't even complain, the source was obviously local.
The really confusing part, in my case, was that pip found the newer versions on pypi, reported them, and then went ahead and re-installed the older version anyway ... arggh. Also, it didn't tell me what it was doing, and why.
So how did I solve this problem?
You can get pip to give verbose output using the -v flag ... but one isn't enough. I RTFM-ed the help, which said you can do -v multiple times, up to 3x, for more verbose output. So I did:
pip install -vvv <my_package>
Then I looked through the output. One line caught my eye:
Source in /tmp/pip-build-root/ has version 0.0.11, which satisfies requirement <my_package>
I deleted that directory, after which pip installed the newest version from pypi.
Try forcing download the package again with:
pip install --no-cache-dir --upgrade <package>
Thanks to Marcus Smith, who does amazing work as a maintener of pip, this was fixed in version 1.4 of pip which was released on 2013-07-23.
Relevant information from the changelog for this version
Fixed a number of issues (#413, #709, #634, #602, and #939) related to
cleaning up and not reusing build directories. (Pull #865, #948)
I found here that there is a known bug in pip that it won't check the version if there's a build directory with unpacked sources. I have checked this on my troubling package and after deleting its sources from build directory pip installed the required version.
If you are using a pip version that comes with some distribution packages (ex. Ubuntu python-pip), you may need to install a newer pip version:
Update pip to latest version:
sudo pip install -U pip
In case of "virtualenv", skip "sudo":
pip install -U pip
Following command may be required, if your shell report something like -bash: /usr/bin/pip: No such file or directory after pip update:
hash -d pip
Now install your package as usual:
pip install -U foo
or
pip install foo==package.version.here
Got the same issue to update pika 0.9.5 to 0.9.8. The only working way was to install from tarball: pip install https://pypi.python.org/packages/source/p/pika/pika-0.9.8.tar.gz.
In my case the python version used (3.4) didn't satisfy Django 2.1 dependencies requirements (python >= 3.5).
For my case I had to delete the .pip folder in my home directory and then I was able to get later versions of multiple libraries. Note that this was on linux.
pip --version
pip 18.1 from /usr/lib/python2.7/site-packages/pip (python 2.7)
virtualenv --version
15.1.0
Just in case that anyone else hassles with upgrading torchtext (or probably any other torch library):
Although https://pypi.org/project/torchtext/ states that you could run pip install torchtext I had to install it similiar to torch by specifying --find-links aka -f:
pip install torchtext===0.8.1 -f https://download.pytorch.org/whl/torch_stable.html
What irritated me was that PyCharm pointed me to the new version, but couldn't find it when attempting to upgrade to it. I guess that PyCharm uses its own mechanism to spot new versions. Then, when invoking pip under the hood, it didn't find the new version without the --find-links option.
In my case I am pip installing a .tar.gz package from Artifactory that I make a lot of updates to. In order to overwrite my cached Python files and always grab/install the latest I was able to run:
pip install --no-cache-dir --force-reinstall <path/to/tar.gz>
You should see this re-download any necessary files and install those, instead of using your local cache.
10 years on and pip still fails to work as expected 😖.
I wasted a couple of hours now banging my head against the wall trying to find out why pip won't install a development version of my package. In my case, there are versions 0.0.4 and 0.0.5.dev1 in a private gitlab.com package registry (hence the --extra-index-url argument below), but I believe that's not relevant to the problem.
Following a lot of the advice on this page, I create a test venv in a far away folder, clear the pip cache, uninstall the package in question, etc. first to rule out the most common problems:
$ pip cache purge && \
pip uninstall --yes my-package && \
pip install --extra-index-url "https://_:${GITLAB_PASSWORD_TOOLS_VAULTTOOLS}#gitlab.com/api/v4/projects/<project-id>/packages/pypi/simple" \
--no-cache-dir \
--pre \
--upgrade my-package
output (using empty lines to separate output for commands):
WARNING: No matching packages
Files removed: 0
Found existing installation: my-package 0.0.4
Uninstalling my-package-0.0.4:
Successfully uninstalled my-package-0.0.4
Looking in indexes: https://pypi.org/simple, https://_:****#gitlab.com/api/v4/projects/<project-id>/packages/pypi/simple
Collecting my-package
Downloading https://gitlab.com/api/v4/projects/<project-id>/packages/pypi/files/f07 ... 397/my_package-0.0.5.dev1-py3-none-any.whl (16 kB)
Downloading https://gitlab.com/api/v4/projects/<project-id>/packages/pypi/files/775 ... 70e/my_package-0.0.4-py3-none-any.whl (16 kB)
...
Successfully installed my-package-0.0.4
So pip does see the dev package version, but chooses the earlier one nonetheless.
In an attempt to figure out what's going on, I published a 0.0.5 version: Error persists, pip sees all three versions, but still installs 0.0.4.
In a further, increasingly desperate attempt, I removed any versions prior to 0.0.5* from the gitlab.com package registry.
Only now, pip would bother to actually display some useful information:
$ (same command as above)
... (similar output as above) ...
ERROR: Cannot install my-package==0.0.5 and my-package==0.0.5.dev1 because these package versions have conflicting dependencies.
The conflict is caused by:
my-package 0.0.5 depends on my-other-package<0.2.5 and >=0.2.4
my-package 0.0.5.dev1 depends on my-other-package<0.2.5 and >=0.2.4
To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts
OK, so there is something wrong with my package dependencies. Thanks for letting me know.
Seriously - I tried hard for a couple of hours using all kinds of pip ... -vvv and/or fixed versions such as e.g. my-package==0.0.5.dev1 - but I did not manage to get any useful output out of pip - until I wiped the entire history from my package registry 🤬.
Hope this at least helps someone in the same situation.
I found that if you use microversions, pip doesn't seem to recognize them. For example, we couldn't get version 1.9.9.1 to upgrade.
In my case, someone had published the latest version of a package with python2, so attempting to pip3 install it grabbed an older version that had been built with python3.
Handy things to check when debugging this:
If pip install claims to not be able to find the version, see whether pip search can see it.
Take a look at the "Download Files" section on the pypi repo -- the filenames might suggest what's wrong (in my case i saw -py2- there clear as day).
As suggested by others, try running pip install --no-cache-dir in case pip isn't bothering to ask the internet because it already has your answer locally.
I had hidden unversioned files under the Git tab in PyCharm that were being installed with pip install . even though I didn't see the files anywhere else.
Took a long time to find it for me, posting this in hope that it'll help somebody else.
if you need the path for your package do pip -v list. Example see related post when using pip -e Why is an old version of a package of my python library installing by itself with pip -e?
I am trying to install python-shapely with pip in Ubuntu 10.04. I got "Unknown or unsupported command 'install'" while I tried,
user#desktop:~$ pip install Shapely
I tried installing pip and got the following error:
user#desktop:~$ sudo apt-get install python-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
python-pip
0 upgraded, 1 newly installed, 0 to remove and 396 not upgraded.
Need to get 0B/49.8kB of archives.
After this operation, 270kB of additional disk space will be used.
(Reading database ... 252574 files and directories currently installed.)
Unpacking python-pip (from .../python-pip_0.3.1-1ubuntu2.1_all.deb) ...
dpkg: error processing /var/cache/apt/archives/python-pip_0.3.1-1ubuntu2.1_all.deb (--unpack):
trying to overwrite '/usr/bin/pip', which is also in package pip 0:0.13-1
Errors were encountered while processing:
/var/cache/apt/archives/python-pip_0.3.1-1ubuntu2.1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
I'd appreciate any comment/solution.
Thanks!
Did you install pip first, then get this error, then try to install python-pip?
If so, first remove pip (apt-get remove pip), then install python-pip instead and try again.
(I just had the same problem, not sure if python 2.7 uses pip and 2.6 uses python-pip? That might be the issue.)
Same happen to me, I'm running Ubuntu Lucid Lynx, 10.04 and there's a packaging conflict. Package pip (pearl installation software) has a conflict with the python-pip package. Both of them try to put a pip binary at /usr/bin/pip. You could do several things to solve the problem so choose the one that fits your needs:
1.- Remove "the pearl pip" if you don't use it and install the python pip
2.- Force installation of python pip with some "dpkg -f" or so, but this way your pip binary file will be overwritten
3.- Manually install ether of the packages changing the binary name, i.e. you manually install the python pip and instead of pip you just call the binary "python-pip"
Seems to be broken download. Did you try easy_install?
sudo easy_install pip
The problem raise because pip is in strawberry perl and Python both, if Perl's pip hit this error comes
$ which pip
/cygdrive/c/strawberry/perl/bin/pip
Solution
1. C:\Python27\Scripts\pip install south
or
2. Keep python path before strawberry perl
or
3. remove strawberry perl path from path variable...
Leave everything, Install latest version of python from its https://www.python.org/downloads .It already contain PIP, so open CMD from start and give him path to reach folder where python is installed and open "Script" folder where pip is build-in installed e.g. c:\Python36-32\Script And then write pip install module_name and enjoy,,,
Possibly you will have to open Administrator CMD, SO after typing cmd in start when you see CMD is on list press CTRL+SHIFT+ENTER and press OK in pop-up dialog and you will have administrative CMD.