无法通过pip install安装软件包(位于企业代理之后)

时间:2019-07-19 11:49:20

标签: python python-3.x

无法通过“ pip install pandas”安装python软件包。

我是公司的代理人。 还设置了HTTP_PROXY和HTTPS_PROXY的环境变量,但仍然无法安装软件包

pip配置编辑给出以下日志

proxy = https://192.168.0.1:8080 超时= 60

也尝试过(如Say。W的建议)

  

pip -v --log /tmp/pip.log --trusted-host pypi.python.org   --trusted-host pypi.org --trusted-host files.pythonhosted.org安装熊猫

但仍然是相同的错误

请帮助建议如何解决此问题?

谢谢, 高拉夫

Windows PowerShell
Copyright (C) 2016 Microsoft Corporation. All rights reserved.

PS C:\Users\Gaurav Patni> pip -v --log /tmp/pip.log install pandas
Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect
Config variable 'WITH_PYMALLOC' is unset, Python ABI tag may be incorrect
Created temporary directory: C:\Users\GAURAV~1\AppData\Local\Temp\pip-ephem-wheel-cache-nmlmjzjs
Created temporary directory: C:\Users\GAURAV~1\AppData\Local\Temp\pip-req-tracker-qqduq1_c
Created requirements tracker 'C:\\Users\\GAURAV~1\\AppData\\Local\\Temp\\pip-req-tracker-qqduq1_c'
Created temporary directory: C:\Users\GAURAV~1\AppData\Local\Temp\pip-install-4dysob1h
Collecting pandas
  1 location(s) to search for versions of pandas:
  * https: //pypi.org/simple/pandas/
  Getting page https: //pypi.org/simple/pandas/
  Looking up "https: //pypi.org/simple/pandas/" in the cache
  Request header has "max_age" as 0, cache bypassed
  Starting new HTTPS connection (1): pypi.org:443
  Incremented Retry for (url='/simple/pandas/'): Retry(total=4, connect=None, read=None, redirect=None, status=None)
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError(
'Cannot connect to proxy.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host',
 None, 10054, None))': /simple/pandas/

Starting new HTTPS connection (6): pypi.org:443
  Could not fetch URL https: //pypi.org/simple/pandas/: connection error: HTTPSConnectionPool(host='pypi.org', port=443):
 Max retries exceeded with url: /simple/pandas/ (Caused by ProxyError('Cannot connect to proxy.', ConnectionResetError(1
0054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))) - skipping
  Could not find a version that satisfies the requirement pandas (from versions: )
Cleaning up...

Removed build tracker 'C:\\Users\\GAURAV~1\\AppData\\Local\\Temp\\pip-req-tracker-qqduq1_c'
No matching distribution found for pandas
Exception information:
Traceback (most recent call last):
  File "c:\python37\lib\site-packages\pip\_internal\cli\base_command.py", line 179, in main
    status = self.run(options, args)

  File "c:\python37\lib\site-packages\pip\_internal\commands\install.py", line 315, in run
    resolver.resolve(requirement_set)

  File "c:\python37\lib\site-packages\pip\_internal\resolve.py", line 131, in resolve
    self._resolve_one(requirement_set, req)

  File "c:\python37\lib\site-packages\pip\_internal\resolve.py", line 294, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)

  File "c:\python37\lib\site-packages\pip\_internal\resolve.py", line 242, in _get_abstract_dist_for
    self.require_hashes

  File "c:\python37\lib\site-packages\pip\_internal\operations\prepare.py", line 269, in prepare_linked_requirement
    req.populate_link(finder, upgrade_allowed, require_hashes)

  File "c:\python37\lib\site-packages\pip\_internal\req\req_install.py", line 196, in populate_link
    self.link = finder.find_requirement(self, upgrade)

  File "c:\python37\lib\site-packages\pip\_internal\index.py", line 688, in find_requirement
    'No matching distribution found for %s' % req

pip._internal.exceptions.DistributionNotFound: No matching distribution found for pandas
Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect
Config variable 'WITH_PYMALLOC' is unset, Python ABI tag may be incorrect
1 location(s) to search for versions of pip:
* https: //pypi.org/simple/pip/
Getting page https: //pypi.org/simple/pip/
Looking up "https: //pypi.org/simple/pip/" in the cache
Request header has "max_age" as 0, cache bypassed
Starting new HTTPS connection (1): pypi.org:443
Could not fetch URL https: //pypi.org/simple/pip/: connection error: HTTPSConnectionPool(host='pypi.org', port=443): Max
retries exceeded with url: /simple/pip/ (Caused by ProxyError('Cannot connect to proxy.', timeout('timed out'))) 
- skipping
PS C:\Users\Gaurav Patni> pip -v --log /tmp/pip.log install pandas^Apip -v --log /tmp/pip.log install pandaspip -v --log
 /tmp/pip.log install pandas

1 个答案:

答案 0 :(得分:0)

尝试一下:

pip -v --log /tmp/pip.log --trusted-host pypi.python.org --trusted-host pypi.org --trusted-host files.pythonhosted.org install pandas