Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pip doesn't see setuptools

I am migrating from python2 to python3.

I created a virtualenv with python3 -m venv py3 and am trying to pip install -r requirements.txt but it says

Collecting mock==1.0.1 (from -r requirements.txt (line 8))
  Using cached mock-1.0.1.tar.gz
  setuptools must be installed to install from a source distribution

I checked my virtualenv and it does have setuptools:

(py3) 1111:d3 1111$ ls py3/lib/python3.4/site-packages/
__pycache__         easy_install.py         pip-6.0.8.dist-info     setuptools
_markerlib          pip             pkg_resources           setuptools-12.0.5.dist-info

but when I still try to reinstall setuptools it says

(py3) 1111:d3 1111$ pip install setuptools
Requirement already satisfied (use --upgrade to upgrade): setuptools in 
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python

So I have 2 questions:

  1. why doesn't it see setuptools in virtualenv folder?
  2. why does it look in Python 2 folders instead of Python 3?

Thanks!

like image 640
kurtgn Avatar asked Mar 11 '15 06:03

kurtgn


2 Answers

This is not an answer to your questions, but for me it was easier to reinstall the virtual environment than trying to solve the issue. After setting up a new virtualenv, I had no problem installing or updating packages again.

like image 111
El Diego Efe Avatar answered Sep 21 '22 22:09

El Diego Efe


In my case it helped to install setuptools under pip user:

pip install -U pip setuptools

like image 41
Datageek Avatar answered Sep 22 '22 22:09

Datageek