I'm trying to install Django package in a virtualenv. I'm on a new computer (OSX 10.8.2). I installed virtualenv via easy_install. With the virtualenv activated, I ran:
(pyenv)$ pip install Django
Downloading/unpacking Django
Downloading Django-1.5.1.tar.gz (8.0MB): 2.0MB downloaded
Hash of the package https://pypi.python.org/packages/source/D/Django/Django-1.5.1.tar.gz#md5=7465f6383264ba167a9a031d6b058bff (from https://pypi.python.org/simple/Django/) (<md5 HASH object # 0x108453df0>) doesn't match the expected hash 7465f6383264ba167a9a031d6b058bff!
Bad md5 hash for package https://pypi.python.org/packages/source/D/Django/Django-1.5.1.tar.gz#md5=7465f6383264ba167a9a031d6b058bff (from https://pypi.python.org/simple/Django/)
This happens even if I delete virtualenv and start over. I've tried again repeatedly over the past few hours, it always happens. Any suggestions?
I have the same problem when I try sudo pip install Pillow, and I try sudo pip install --no-cache-dir Pillow, it works for me.
If it's just this package that you can't get to install, you could download the tarball manually, and then use pip to install it from that file. The Django download site has checksums that you can validate manually as well. I don't use osx, but probably something like this would help:
cd /tmp
wget https://pypi.python.org/packages/source/D/Django/Django-1.5.1.tar.gz
md5sum Django-1.5.1.tar.gz
pip install Django-1.5.1.tar.gz
For me below command works
pip install django --no-cache-dir
I now had this issue several times.
Like others mentioned before me, pip install [module] --no-cache-dir
helps most of the time.
But sometimes, you got some dependencies to install first and it fails installing one of these (md5 validation failed).
Just had this problem myself. In this case, installing this dependency alone like pip install dependency
worked and after that I was able to install the first module.
Also pip install -vvv is nice for more info gathering on general problem solving
Related
I had deleted an existing virtual environment. I created a new one and activated it. Now I am trying to install site packages using
pip install -r requirements.txt
But I keep getting the error
Cannot fetch index base URL https://pypi.python.org/simple/
Could not find any downloads that satisfy the requirement BeautifulSoup==3.2.1 (from -r requirements.txt (line 1))
Now I know that the packages are really old but this is running on python 2.7.6. I am also not able to install anything through pip. I have tried
pip install numpy
But it shows the same errors. As per the similar questions answered before the suggestion is to use https://pypi.python.org which I have already done but still facing these errors.
Would love to hear your suggestions.
Might be a problem with having an old version of pip.
Try pip install --upgrade pip and then try installing the requirements again.
pip tries to create lockfile in cache directory
Try running pip install --upgrade pip --no-cache-dir
I uploaded my package to testpypi, and installed it via:
pip install -i https://test.pypi.org/simple/ myporj==0.1.6
However it refuse to install it by saying:
Requirement already satisfied: myproj==0.1.6 in ./projs/myproj (0.1.6)
I guess I may add the project in editable mode:
pip install --editable .
However, I know want to disable it. I tried:
python setup.py develop --uninstall
But it has no effect.
It may be worth creating a separate env (Virtual Environments) for the installation.
Here are some articles on this subject:
https://docs.python.org/3/tutorial/venv.html
https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/#creating-a-virtual-environment
Or does it need to be installed in the same place?
You can try to find your package pip search myporj or pip list for show all packages.
And uninstall it later pip uninstall myporj (it may require the right of sudo in linux) then install again.
Maybe you may need --no-cache-dir option to ignore the cache during installation. Here is more details: https://pip.pypa.io/en/stable/reference/pip_install/#caching
In the server that work in (as do many other people) the "global" python has a certain version of a package, say 1.0.0.
I recently used pip to upgrade that to 1.0.2 locally for my user with the pip install --user package==1.0.2, which worked. However, now I want to uninstall my locally installed version and remain with the global one.
I've tried pip uninstall --user package==1.0.2, pip uninstall --user package, and a few other options but nothing seems to work. I always get this error:
Usage:
pip <command> [options]
no such option: --user
I also tried pip install --user package=1.0.0 but now I have both versions installed locally and python uses the most recent.
How can I do what I want?
Apparently this cannot be done with pip directly. I ended up solving it just by removing the package from ~/.local/lib/python3.5/site-packages/. A bit more manual than I was hoping I'd have to do.
The --user option for pip seems to have been removed but is still an option with setuptools.
So if you want to use the --user function what you can do is use pip download which will download the .whl file. You then need to extract the file using wheel unpack. I then ran python setup.py install --user (worked for numpy) and it installed the package to my home directory under .local.
I followed the documentation here.
Today I wanted to install Django with steps of Django site, but when I installing that I get this error and searched but I couldn't find good answer:
Hash of the package https://pypi.python.org/packages/py2.py3/D/Django/Django-1.8.5-py2.py3-none-any.whl#md5=3c182cf9de00382ecf27fdc65fcfbe70 (from https://pypi.python.org/simple/django/) (37e1d67ae64ad916aeb1e0b1f58a3b5e) doesn't match the expected hash 3c182cf9de00382ecf27fdc65fcfbe70!
Bad md5 hash for package https://pypi.python.org/packages/py2.py3/D/Django/Django-1.8.5-py2.py3-none-any.whl#md5=3c182cf9de00382ecf27fdc65fcfbe70 (from https://pypi.python.org/simple/django/)
I use windows 10.
There are couple of things you can do. First, you can tell pip to ignore looking at the cache:
~$ pip install --ignore-installed Django
or you can try downloading the tarball instead:
~$ pip install https://www.djangoproject.com/download/1.8.5/tarball/
This problem is because terminal is using cache version of Django for install. use below code
pip install django --no-cache-dir
The same error,I too got...This is due to the presence of a cache of Djanco.
pip install django --no-cache-dir
RECOMMENDED TO WINDOWS 10 USERS
Pretty new to linux/suse and python so excuse me if I cause some simple questions.
I've search through stackoverflow and haven't gotten a result for my question.
I'm running on Windows with a Virtual machine using SUSE. I'm trying to install py.test, but to install it, it needs either pip or easy_install. I've heard pip is preferred over easy_install, so I tried installing that with get-pip.py.
I run it with
python get-pip.py
and it tells me it has been installed, this is what it ouputs
Collecting pip
Using cached pip-6.1.1-py2.py3-none-any.whl
Collecting setuptools
Using cached setuptools-15.1-py2.py3-none-any.whl
Installing collected packages: pip, setuptools
Successfully installed pip-6.1.1 setuptools-15.1
I tried running
pip install -U pytest
however the command pip has not been found. I also looked into python-pip package via openSUSE, though I'm not sure how to open a .ymp file through a VM.
Would I have to add a path for it to work? Pointers would be appreciated.
It looks like pip was unstalled by a regular user, so it was installed under the user's homedir, thus needs to be explicitly added to the path.
On openSUSE I'd suggest installing it using YaST (as root) and it'll end up in /usr/bin/pip, shareable by all users. Here's how it looks like on openSUSE 13.2:
$> which pip
/usr/bin/pip
$> rpm -qf /usr/bin/pip
python3-pip-1.5.6-2.1.3.noarch
Just search for pip in the software management tool.
Also many additional python packages/modules come prepackaged as openSUSE RPMs, better check the software management tool 1st.