问题
i have to install virtualenv on ubuntu 12.04 but it shows following error
sudo pip install virtualenv
[sudo] password for raushan:
Downloading/unpacking virtualenv
Cannot fetch index base URL http://pypi.python.org/simple/
Could not find any downloads that satisfy the requirement virtualenv
No distributions at all found for virtualenv
Storing complete log in /home/raushan/.pip/pip.log
回答1:
Cannot fetch index base URL http://pypi.python.org/simple/
It sounds like you're unable to access PyPi.
Try navigating to http://pypi.python.org/simple/ in your browser to see if you're able to connect. Do you use a proxy to access websites?
It may also be useful to check if you're able to access PyPi from the command line. Try:
wget http://pypi.python.org/simple/
If you're using a proxy, enable that on the command line:
export HTTP_PROXY="http://your.proxy.address.com:8000"
export HTTPS_PROXY=$HTTP_PROXY
replacing your proxy address and the port with whichever details you have.
回答2:
If you are trying to install it on ubuntu, then try this
sudo apt-get install python-virtualenv
This will work fine.
回答3:
it happens because of heavy load on http://pypi.python.org. other alternatives are the mirror site.download the package from mirror site like mirror site and use this command on terminal >> python setup.py install
回答4:
If you are getting this Error as follow while Yum Update or yum install :
Error: Cannot retrieve metalink for repository: fedora/18/x86_64. Please verify its path and try again
Answer : Please check your Proxies i.e env variables 1. http_proxy 2. https_proxy 3. http_proxy in the /etc/yum.conf
Enter the proxy like :
export http_proxy=xxx.xxx.xxx.xxx:port_no
export https_proxy=xxx.xxx.xxx.xxx:port_no
回答5:
Create your own Python virtual environment called : I have given it VE.
git clone https://github.com/pypa/virtualenv.git
python virtualenv.py VE
To Activate your new virtual environment, run:
. VE/bin/activate Sample outputs (NOTE prompt changed): (VE)c34299@a200dblr$
Delete the cloned repo afterwards.
来源:https://stackoverflow.com/questions/19331782/cant-install-virtualenv-on-ubuntu-12-04