python - 如何从从 https ://pypi. org/simple/* 手动下载的包中安装 TensorFlow?

标签 python tensorflow pip pycharm

我正在尝试安装 TensorFlow在 Windows 上使用 Anaconda,在防火墙后面。

没有尝试

--trusted-host

pip install tensorflow --trusted-host pypi.python.org

conda create

conda create -n tensorflow pip python=3.6
activate tensorflow
pip install --ignore-installed --upgrade tensorflow

--no-cache-dir

pip install tensorflow --no-cache-dir

让我在 Windows 上使用 Anaconda 安装 tensorflow。

问题与访问权限有关

> pip -v install tensorflow
...
* https://pypi.python.org/simple/tensorflow/
...
Starting new HTTPS connection (1): pypi.python.org
...
'NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at ..>:
Failed to establish a new connection:
[WinError 10061] No connection could be made because the target
machine actively refused it',)': /simple/tensorflow/
...

奇怪的是,我可以很好地下载 whl 文件,但是 afterwards

pip -v install tensorflow-1.10.0-cp36-cp36m-win_amd64.whl

Processing c:\...\tensorflow-1.10.0-cp36-cp36m-win_amd64.whl

告诉我

Collecting grpcio>=1.8.6 (from tensorflow==1.10.0)
1 location(s) to search for versions of grpcio:
* https://pypi.python.org/simple/grpcio/

所以我想我会手动安装递归需要的包,从 grpcio 开始,但不是最新的

pip -v install grpcio-1.14.1-cp36-cp36m-win32.whl

pip.exceptions.InstallationError: grpcio-1.14.1-cp36-cp36m-win32.whl is not a supported wheel on this platform.

也不是这个版本的 tensorflow 需要的最旧的

pip -v install grpcio-1.8.6-cp36-cp36m-win32.whl

pip.exceptions.InstallationError: grpcio-1.8.6-cp36-cp36m-win32.whl is not a supported wheel on this platform.

将安装。

我可以从 https://pypi.org/simple/* 下载就好了。如何使用下载的包安装tensorflow?

Conda 4.3.27
Python 3.6.2
Windows 7 Pro

更新 1

recipe 的第一步之后

  • 从 pypi.org/simple 下载 tensorflow-1.10.0-cp36-cp36m-win_amd64.whl
  • 将whl文件放在c:/Users/vrok/.conda/envs
  • 激活c:/Users/vrok/.conda/envs/

第四个

conda install tensorflow-1.10.0-cp36-cp36m-win_amd64.whl

失败

CondaHTTPError: HTTP 000 CONNECTION FAILED for url
<https://repo.continuum.io/pkgs/main/win-64/repodata.json.bz2>

即使我能够手动下载 https://repo.continuum.io/pkgs/main/win-64/repodata.json.bz2

更新 2:

我与 Anaconda 无关。 Windows 上的任何选项都很好。 PyCharm、IIUC Hook 到先前的安装。它本身不提供 python/pip/venvs。不过,在 Settings\Project\Project Interpreter 中,用户不会被告知无法访问哪个 URL。知道这一 pip 将使防火墙后面的人能够打开或请求打开对特定 URL 的访问。

相关:

one , two

最佳答案

为什么你还没有尝试过显而易见的事情?

conda install -n myenv tensorflow=[your version here or leave blank for latest]

或者您可以采用更具交互性的方式:

activate [your environment]
conda install [your thing]

然后你可以测试你的安装

conda list

关于python - 如何从从 https ://pypi. org/simple/* 手动下载的包中安装 TensorFlow?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51862083/

相关文章:

python - 如何在图中表示 bool 数据

python - opencv python错误:断言失败:size.width> 0 && size.height> 0

Python Pandas-查找超过阈值的值的第一个实例

tensorflow 损失最小化类型错误

python - pip - 安装子依赖项会覆盖 requirements.txt 上的其他包

python - 在 virtualenv 中运行 pip 时出现 AttributeError

python - 跨组的 Pyspark 示例数据框

python - InvalidArgumentError(回溯见上): indices[1] = 10 is not in [0, 10)

python - OSError : SavedModel file does not exist at: . ./dnn/mpg_model.h5/{saved_model.pbtxt|saved_model.pb}

python - 无法安装编解码器或升级 pip