Python 从本地源安装 anaconda 库

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/34316951/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 14:48:56  来源:igfitidea点击:

Install anaconda library from a local source

pythonanacondapymc

提问by Noel Evans

I have been trying to install pymc for some time on a Windows PC behind a very complicated proxy; effectively making this an installation on a computer not connected to the internet. I have tried - unsuccessfully - to set a proxy in the condarc file but I still get error messages

一段时间以来,我一直试图在一个非常复杂的代理后面的 Windows PC 上安装 pymc;有效地使其安装在未连接到互联网的计算机上。我曾尝试 - 不成功 - 在 condarc 文件中设置代理,但我仍然收到错误消息

conda install -c https://conda.binstar.org/pymcpymc Fetching package metadata: SSL verification error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645)

conda install -c https://conda.binstar.org/pymcpymc 获取包元数据:SSL 验证错误:[SSL: CERTIFICATE_VERIFY_FAILED] 证书验证失败 (_ssl.c:645)

采纳答案by Noel Evans

To solve this, you need to download the tar file (even if using Windows) that the installer is trying to fetch and then use offline mode:

要解决此问题,您需要下载安装程序尝试获取的 tar 文件(即使使用 Windows),然后使用离线模式:

Use this command which will error, to determine the file to be downloaded:

使用这个会出错的命令来确定要下载的文件:

>conda install -c https://conda.binstar.org/pymc pymc
Fetching package metadata: SSL verification error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645)
....
Solving package specifications: ......................

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    pymc-2.3.5                 |      np110py35_0         402 KB  defaults

The following NEW packages will be INSTALLED:

    pymc: 2.3.5-np110py35_0 defaults

Proceed ([y]/n)? y

Fetching packages ...
Could not connect to https://repo.continuum.io/pkgs/free/win-64/pymc-2.3.5-np110py35_0.tar.bz2
... [error message continues]...

Now download the tar file mentioned in the error message:

现在下载错误消息中提到的 tar 文件:

https://repo.continuum.io/pkgs/free/win-64/pymc-2.3.5-np110py35_0.tar.bz2

https://repo.continuum.io/pkgs/free/win-64/pymc-2.3.5-np110py35_0.tar.bz2

And then run this command with the path to the tar file:

然后使用 tar 文件的路径运行此命令:

>conda install --offline C:\pymc-2.3.5-np110py35_0.tar.bz2

回答by Helene

Just of notes: "-c conda-forge" might be handy for some other packages. For example:

注意事项:“-c conda-forge”可能对其他一些软件包很方便。例如:

conda install -c conda-forge python-levenshtein

回答by limtete

Adding to the solution above. Anyone met "SSL verification error" can just turn the verification step off temporarily in ~/.condarc

添加到上面的解决方案中。任何遇到“SSL 验证错误”的人都可以在 ~/.condarc 中暂时关闭验证步骤

channels:
  - defaults
ssl_verify: true

In this way, you could install from your local hub.

通过这种方式,您可以从本地集线器安装。