无法在 virtualenv 中安装较旧的 wxPython(无法解压文件/无法确定存档格式)

Unable to install older wxPython within virtualenv (Cannot unpack file / Cannot determine archive format)

在基于 Python 2.6.6 构建的 virtualenv 中, 我正在尝试 pip install 2.8 .10.1 2.6 unicode dmg 发现 here 因此:

pip install -Iv http://sourceforge.net/projects/wxpython/files/wxPython/2.8.10.1/wxPython2.8-osx-unicode-2.8.10.1-universal-py2.6.dmg/download

当然,URL 是一个猜测。

我得到(将日志一分为二):

MacBook-Pro-de-Pyderman:Pyderman$ pip install -Iv http://sourceforge.net/projects/wxpython/files/wxPython/2.8.10.1/wxPython2.8-osx-unicode-2.8.10.1-universal-py2.6.dmg/download -U --trusted-host sourceforge.net
Collecting http://sourceforge.net/projects/wxpython/files/wxPython/2.8.10.1/wxPython2.8-osx-unicode-2.8.10.1-universal-py2.6.dmg/download
  Starting new HTTP connection (1): sourceforge.net
  "GET /projects/wxpython/files/wxPython/2.8.10.1/wxPython2.8-osx-unicode-2.8.10.1-universal-py2.6.dmg/download HTTP/1.1" 302 519
  Starting new HTTP connection (1): downloads.sourceforge.net
  "GET /project/wxpython/wxPython/2.8.10.1/wxPython2.8-osx-unicode-2.8.10.1-universal-py2.6.dmg?r=&ts=1452906240&use_mirror=superb-dca2 HTTP/1.1" 302 433
  Starting new HTTP connection (1): superb-dca2.dl.sourceforge.net
  "GET /project/wxpython/wxPython/2.8.10.1/wxPython2.8-osx-unicode-2.8.10.1-universal-py2.6.dmg HTTP/1.1" 200 39136817
  Downloading http://sourceforge.net/projects/wxpython/files/wxPython/2.8.10.1/wxPython2.8-osx-unicode-2.8.10.1-universal-py2.6.dmg/download (39.1MB)
  Downloading from URL http://sourceforge.net/projects/wxpython/files/wxPython/2.8.10.1/wxPython2.8-osx-unicode-2.8.10.1-universal-py2.6.dmg/download
    100% |████████████████████████████████| 39.1MB 1.9MB/s 
  Cannot unpack file /private/var/folders/t3/yhd5b6lj2cz_b82qzw4zcwh40000gn/T/pip-mLGthu-unpack/download.dmg (downloaded from /var/folders/t3/yhd5b6lj2cz_b82qzw4zcwh40000gn/T/pip-FRcExS-build, content-type: application/x-apple-diskimage); cannot detect archive format
Cleaning up...
Cannot determine archive format of /var/folders/t3/yhd5b6lj2cz_b82qzw4zcwh40000gn/T/pip-FRcExS-build

-

Exception information:Pyderman
Traceback (most recent call last):
  File "/Users/Pyderman/Downloads/Pyderman/venv/lib/python2.6/site-packages/pip/basecommand.py", line 211, in main
    status = self.run(options, args)
  File "/Users/Pyderman/Downloads/Pyderman/venv/lib/python2.6/site-packages/pip/commands/install.py", line 305, in run
    wb.build(autobuilding=True)
  File "/Users/Pyderman/Downloads/Pyderman/venv/lib/python2.6/site-packages/pip/wheel.py", line 705, in build
    self.requirement_set.prepare_files(self.finder)
  File "/Users/Pyderman/Downloads/Pyderman/venv/lib/python2.6/site-packages/pip/req/req_set.py", line 334, in prepare_files
    functools.partial(self._prepare_file, finder))
  File "/Users/Pyderman/Downloads/Pyderman/venv/lib/python2.6/site-packages/pip/req/req_set.py", line 321, in _walk_req_to_install
    more_reqs = handler(req_to_install)
  File "/Users/Pyderman/Downloads/Pyderman/venv/lib/python2.6/site-packages/pip/req/req_set.py", line 491, in _prepare_file
    session=self.session)
  File "/Users/Pyderman/Downloads/Pyderman/venv/lib/python2.6/site-packages/pip/download.py", line 825, in unpack_url
    session,
  File "/Users/Pyderman/Downloads/Pyderman/venv/lib/python2.6/site-packages/pip/download.py", line 677, in unpack_http_url
    unpack_file(from_path, location, content_type, link)
  File "/Users/Pyderman/Downloads/Pyderman/venv/lib/python2.6/site-packages/pip/utils/__init__.py", line 665, in unpack_file
    'Cannot determine archive format of %s' % location
InstallationError: Cannot determine archive format of /var/folders/t3/yhd5b6lj2cz_b82qzw4zcwh40000gn/T/pip-FRcExS-build
Starting new HTTPS connection (1): pypi.python.org
/Users/Pyderman/Downloads/Pyderman/venv/lib/python2.6/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
There was an error checking the latest version of pip
Traceback (most recent call last):
  File "/Users/Pyderman/Downloads/Pyderman/venv/lib/python2.6/site-packages/pip/utils/outdated.py", line 126, in pip_version_check
    headers={"Accept": "application/json"},
  File "/Users/Pyderman/Downloads/Pyderman/venv/lib/python2.6/site-packages/pip/_vendor/requests/sessions.py", line 477, in get
    return self.request('GET', url, **kwargs)
  File "/Users/Pyderman/Downloads/Pyderman/venv/lib/python2.6/site-packages/pip/download.py", line 373, in request
    return super(PipSession, self).request(method, url, *args, **kwargs)
  File "/Users/Pyderman/Downloads/Pyderman/venv/lib/python2.6/site-packages/pip/_vendor/requests/sessions.py", line 465, in request
    resp = self.send(prep, **send_kwargs)
  File "/Users/Pyderman/Downloads/Pyderman/venv/lib/python2.6/site-packages/pip/_vendor/requests/sessions.py", line 573, in send
    r = adapter.send(request, **kwargs)
  File "/Users/Pyderman/Downloads/Pyderman/venv/lib/python2.6/site-packages/pip/_vendor/cachecontrol/adapter.py", line 46, in send
    resp = super(CacheControlAdapter, self).send(request, **kw)
  File "/Users/Pyderman/Downloads/Pyderman/venv/lib/python2.6/site-packages/pip/_vendor/requests/adapters.py", line 431, in send
    raise SSLError(e, request=request)
SSLError: [Errno 1] _ssl.c:490: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

"There was an error checking the latest version of pip"重要吗?

pip 是 virtualenv 自己的:

/Users/Pyderman/Downloads/Pyderman/venv/bin/pip --version
pip 7.1.2 from /Users/Pyderman/Downloads/Pyderman/venv/lib/python2.6/site-    
packages (python 2.6)

我不认为错误检查版本对您的问题很重要(这只是 pip 试图自我更新)但它导致了错误。也许 Python 的旧版本不支持所需的 SSL 设置?您可以使用以下方式禁用此更新检查:

pip install -Iv http://sourceforge.net/projects/wxpython/files/wxPython/2.8.10.1/wxPython2.8-osx-unicode-2.8.10.1-universal-py2.6.dmg/download --disable-pip-version-check