Reputation: 5646
As per object. I'm running Python 2.7.10 under Windows 7 64 bit. I added C:\Python27\Scripts to my PATH, and I can run pip
, but it's not able to install modules. For example
pip install numpy
gives
Collecting numpy
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after
connection broken by 'ProtocolError('Connection aborted.', gaierror(11004,'getaddrinfo failed'))': /simple/numpy/
It keeps retrying and failing for a while, and then it exits with
Could not find a version that satisfies the requirement numpy (from versions:
)
No matching distribution found for numpy
Probably I'm behind a firewall, but I'm quite disappointed because I can install packages under R perfectly fine with install.packages
, and I don't see why I can't do the same with Python. If I install packages manually (in the case of NumPy, from here
what do I miss, with respect to using pip
?
As per suggestions in the comments, I downloaded the .whl file for NumPy from NumPy. I navigated to the downloads dir and executed
pip install numpy-1.10.1-cp27-none-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
I only got
numpy-1.10.1-cp27-none-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl is not a supported wheel on this platform.
What should I do?
Upvotes: 23
Views: 71773
Reputation: 303
Our company laptops were too locked down (with scripts and pac files in proxy settings, i.e. blackspider settings), and only the following worked for me.
To solve, I used the following simple steps:
pip install "C:\Users\joe\Downloads\python_dateutil-2.8.2-py2.py3-none-any.whl"
Upvotes: 0
Reputation: 133
You could try this one as well! Setting pip configuration using a proxy so that you do not need to concern the proxy issue again when you install packages via pip.
pip config set global.proxy http://restrictedproxy.xxx.com:70
http://restrictedproxy.xxx.com
:70
you could probably ask the proxy domain and the port from IT if you work for a company.
Upvotes: 0
Reputation: 11980
Personally, it was the configuration file in ~/.config/pip/pip.conf
, which contained an extra-index-url
, preventing the download, because it made pip
search for all the packages on this extra url instead of the main pip repository.
I experimented with old pip 8, because upgrading was even worse for this extra-index-url
needed for another project.
Upvotes: 0
Reputation: 64
If you use Anaconda:
I was trying to install Django using cmd, and it just was not working! I opened up the Anaconda prompt and ran the usual
py -m pip install Django
command, and hey presto! Django was installed!
Upvotes: 1
Reputation: 913
To bypass the firewall, you can use a proxy
pip install numpy --proxy <domain\user:password@proxyaddress:port>
For example,
pip install numpy --proxy http://<username>:<password>@proxy.xyz.com:2180
Upvotes: 2
Reputation: 2167
A proxy shall be used. For example:
python.exe -m pip install numpy --proxy="proxy.com:8080"
where "proxy.com:8080" is the proxy server address and port. This can be found in OS settings.
How to get them:
Upvotes: 21