PIP ไม่ทำงาน - พร็อกซี

python pip ไม่ทำงานหลังพรอกซี

ฉันเหนื่อย

sudo -H pip --proxy https://proxy_ip:proxy_port install <package>

sudo -H pip --proxy https://usename:password@proxy_ip:proxy_port install <package>

sudo easy_install pip

และไม่มีอะไรทำงาน ฉันลองตั้งค่าตัวแปรสภาพแวดล้อม HTTP_PROXY แล้ว แต่มันไม่ทำงาน

ตัวอย่างเช่น นี่เป็นข้อผิดพลาดเมื่อพยายามติดตั้ง toolz:

 Collecting toolz
  Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', error('Tunnel connection failed: 407 Proxy Authentication Required',))': /simple/toolz/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', error('Tunnel connection failed: 407 Proxy Authentication Required',))': /simple/toolz/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', error('Tunnel connection failed: 407 Proxy Authentication Required',))': /simple/toolz/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', error('Tunnel connection failed: 407 Proxy Authentication Required',))': /simple/toolz/
  Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', error('Tunnel connection failed: 407 Proxy Authentication Required',))': /simple/toolz/
  Could not find a version that satisfies the requirement toolz (from versions: )
No matching distribution found for toolz

person severine    schedule 07.07.2017    source แหล่งที่มา
comment
อาจเป็นได้ว่าคุณสามารถอ้างถึง ‹a href=stackoverflow.com/questions/14149422/ โพสต์‹/a›   -  person Asutosh Rana    schedule 07.07.2017


คำตอบ (2)


ฉันใช้ pip install หลังพรอกซีบ่อยครั้ง นี่คือไวยากรณ์ที่เหมาะกับฉัน:

sudo pip --proxy username:password@ip_address:port install <package_name> 
person Mohamed Ali JAMAOUI    schedule 20.07.2017

ปัญหาอยู่ในไฟล์ conf ที่โหลดการตั้งค่าพร็อกซีเก่า นอกจากนี้ตัวแปรสภาพแวดล้อมยังคำนึงถึงขนาดตัวพิมพ์ด้วย ดังนั้นตรวจสอบว่ามีความแตกต่างระหว่าง HTTP_PROXY และ http_proxy โดยใช้ printenv ใน linux หรือไม่

ตามที่ @MedAli แนะนำ: การเพิ่ม --proxy ในขณะที่ใช้ pip จะได้ผล

person severine    schedule 21.07.2017