AsherLi
AsherLi

Reputation: 11

python pip error 'Cannot fetch index base URL' when in virtualenv

it's ok to use pip install -r requirements.txt directly,however,when i tried to use it in virtualenv,it failed with these errors:

test@te:~$ cd flaskbb/
test@te:~/flaskbb$ 
test@te:~/flaskbb$ source .venv/bin/activate
(.venv)test@te:~/flaskbb$ pip install -r requirements.txt 
Obtaining file:///home/test/flaskbb (from -r requirements.txt (line 50))
  Running setup.py egg_info for package from file:///home/test/flaskbb

    no previously-included directories found matching 'flaskbb/themes/*/node_modules'
    no previously-included directories found matching 'flaskbb/themes/*/.sass-cache'
    warning: no previously-included files matching '__pycache__' found anywhere in distribution
    warning: no previously-included files matching '*.py[co]' found anywhere in distribution
Downloading/unpacking alembic==0.9.1 (from -r requirements.txt (line 1))
  Cannot fetch index base URL http://pypi.python.org/simple/
  Could not find any downloads that satisfy the requirement alembic==0.9.1 (from -r requirements.txt (line 1))
No distributions at all found for alembic==0.9.1 (from -r requirements.txt (line 1))
Storing complete log in /home/test/.pip/pip.log
(.venv)test@te:~/flaskbb$

And here is my system:

test@te:~$ uname -ar
Linux te 3.2.0-101-generic #141-Ubuntu SMP Thu Mar 10 21:43:24 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
test@te:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 12.04.5 LTS
Release:    12.04
Codename:   precise
test@te:~$ uname -r
3.2.0-101-generic

Thx for help!!!

Upvotes: 1

Views: 5273

Answers (1)

Riad
Riad

Reputation: 73

you can specify the https URL: sudo pip install -r requirements.txt -i https://pypi.python.org/simple

Upvotes: 6

Related Questions