2013-09-21 49 views
9

Khi tôi sử dụng lệnh:Cách sử dụng easy_install phía sau proxy http trên cửa sổ?

easy_install spotter

để cài đặt các gói spotter, tôi nhận được thông báo lỗi sau

Searching for spotter 
Reading http://pypi.python.org/simple/spotter/ 
Download error on http://pypi.python.org/simple/spotter/: [Errno 11001] getaddrinfo  failed -- Some packages may not be found! 
Reading http://pypi.python.org/simple/spotter/ 
Download error on http://pypi.python.org/simple/spotter/: [Errno 11001] getaddrinfo failed -- Some packages may not be found! 
Couldn't find index page for 'spotter' (maybe misspelled?) 
Scanning index of all packages (this may take a while) 
Reading http://pypi.python.org/simple/ 
Download error on http://pypi.python.org/simple/: [Errno 11001] getaddrinfo failed -- Some packages may not be found! 
No local packages or download links found for spotter 
error: Could not find suitable distribution for Requirement.parse('spotter') 

Hai biến môi trường: http_proxyhttps_proxy dường như không làm việc?

Installing Python's easy_install using ez_setup.py from behind a proxy server

+0

Setting 'http_proxy' làm việc cho tôi. chính xác là bạn đang làm gì? –

Trả lời

8

Bạn có thử như sau:

$ export http_proxy=http://username:[email protected]:portnumber 
$ export https_proxy=https://username:[email protected]:portnumber 

Và sau đó

$ sudo -E easy_install spotter 

Tôi đã có một vấn đề tương tự như của bạn (tớ ở đằng sau một bức tường lửa + kết hợp ủy quyền rất hạn chế) và tập hợp các lệnh và kết hợp trên làm việc cho tôi (trong môi trường GNU/Linux, đặc biệt là Ubuntu).

+1

Điều này làm việc cho tôi. Tôi đã thiếu '-E' trên' sudo'. – jtpereyda

2

Từ dấu nhắc lệnh Windows, đầu tiên thiết lập các biến hai môi trường:

c:\> set http_proxy=<user>:<password>@<proxy_ip_address>:<port> 
c:\> set https_proxy=<user>:<password>@<proxy_ip_address>:<port> 

Sau đó, tôi đã có thể chạy (trong thiết bị đầu cuối cùng):

easy_install spotter