I'm deploying a Django app to a dev server and am hitting this error when i run pip install requirements.txt:
Traceback (most recent call last):
File "/var/www/mydir/virtualenvs/dev/bin/pip", line 5, in <module>
from pkg_resources import load_entry_point
ImportError: No module named pkg_resources
pkg_resources appears to be distributed with setuptools. Initially I thought this might not be installed to the python in the virtualenv so I installed setuptools (2.6, same version as Python) to the Python site-packages in the virtualenv with the following command
sh setuptools-0.6c11-py2.6.egg --install-dir /var/www/mydir/virtualenvs/dev/lib/python2.6/site-packages
EDIT This only happens inside the virtualenv. If I open a console outside the virtualenv then pkg_resources is present
but I am still getting the same error. Any ideas as to why pkg_resources is not on the path?
Needed a little bit more sudo. Then used easy_install to install pip. Works.
just reinstall your
setuptools
by :then everything will be fine.
yum -y install python-setuptools
i configure the Ceph there is a problem execute command
"$ ceph-deploy new node1"
, and I execute the command"$ yum -y install python-setuptools"
, then the problem is gone.ThanksI had this problem today as well. I only got the problem inside the virtual env.
The solution for me was deactivating the virtual env, deleting and then uninstalling virtualenv with pip and reinstalling it. After that I created a new virtual env for my project, then pip worked fine both inside the virtual environment as in the normal environment.
For me a good fix was to use
--no-download
option to virtualenv (VIRTUALENV_NO_DOWNLOAD=1 tox
for tox.)I came across this answer when I was trying to follow this guide for OSX. What worked for me was, after running
python get-pip
, I had to ALSOeasy_install pip
. That fixed the issue of not being able to run pip at all. I did have a bunch of old macport stuff installed. That may have conflicted.