如何在没有Internet访问的Windows 10上安装virtualenvwrapper-win?

时间:2019-06-12 04:36:53

标签: python windows pip offline virtualenvwrapper

我需要在Windows 10上安装virtualenvwrapper-win。但是那台机器无法访问互联网。无论如何,我可以下载并安装它而不是pip install virtualenvwrapper吗?

我已经尝试下载virtualenvwrapper-4.8.4.tar.gz和

pip install /PATH/TO/FILE/virtualenvwrapper-4.8.4.tar.gz

但我知道

Complete output from command python setup.py egg_info:
Download error on https://pypi.python.org/simple/pbr/: [Errno 11001] getaddrinfo failed -- Some packages may not be found!
Couldn't find index page for 'pbr' (maybe misspelled?)
Download error on https://pypi.python.org/simple/: [Errno 11001] getaddrinfofailed -- Some packages may not be found!
No local packages or working download links found for pbr
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\n2007107\AppData\Local\Temp\2\pip-_4e665tg-build\setup.py", line 7, in <module>
    pbr=True,
  File "c:\users\n2007107\appdata\local\programs\python\python36\lib\distutils\core.py", line 108, in setup
    _setup_distribution = dist = klass(attrs)
  File "c:\users\n2007107\appdata\local\programs\python\python36\lib\site-packages\setuptools\dist.py", line 315, in __init__
    self.fetch_build_eggs(attrs['setup_requires'])
  File "c:\users\n2007107\appdata\local\programs\python\python36\lib\site-packages\setuptools\dist.py", line 361, in fetch_build_eggs
    replace_conflicting=True,
  File "c:\users\n2007107\appdata\local\programs\python\python36\lib\site-packages\pkg_resources\__init__.py", line 850, in resolve
    dist = best[req.key] = env.best_match(req, ws, installer)
  File "c:\users\n2007107\appdata\local\programs\python\python36\lib\site-packages\pkg_resources\__init__.py", line 1122, in best_match
    return self.obtain(req, installer)
  File "c:\users\n2007107\appdata\local\programs\python\python36\lib\site-packages\pkg_resources\__init__.py", line 1134, in obtain
    return installer(requirement)
  File "c:\users\n2007107\appdata\local\programs\python\python36\lib\site-packages\setuptools\dist.py", line 429, in fetch_build_egg
    return cmd.easy_install(req)
  File "c:\users\n2007107\appdata\local\programs\python\python36\lib\site-packages\setuptools\command\easy_install.py", line 659, in easy_install
    raise DistutilsError(msg)
distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('pbr')

1 个答案:

答案 0 :(得分:0)

在连接了互联网的主机上运行

pip download virtualenvwrapper-win

pip下载程序包及其所有依赖项。将所有下载的文件移至离线(未连接)主机并运行

pip install --no-index --find-links=\path\to\downloads virtualenvwrapper-win

\path\to\downloads替换为将下载的安装文件移动到的目录的路径。

但是我不认为pbr是依赖项。如果仍然无法安装或运行virtualenvwrapper-win脚本,则分别下载并安装pbr