1

我正在尝试在我的虚拟环境中安装 tensorflowjs,但出现以下错误:

Could not find a version that satisfies the requirement tf-nightly-2.0-preview>=2.0.0.dev20190304 (from tensorflowjs) (from versions: )
No matching distribution found for tf-nightly-2.0-preview>=2.0.0.dev20190304 (from tensorflowjs)

我尝试升级 pip 并使用 virtualenv 和 venv 创建虚拟环境,并使用和不使用选项 --no-cache-dir 进行安装。

为了重现错误,我执行以下操作:

python3 -m venv .env
source .env/bin/activate
pip install tensorflowjs

这导致输出:

Collecting tensorflowjs
  Downloading https://files.pythonhosted.org/packages/79/29/35e1aa467436ff46b98df65a08c49faaedb3429e1c512d1d90fe308040a0/tensorflowjs-1.0.1-py3-none-any.whl
Collecting tensorflow-hub==0.3.0 (from tensorflowjs)
  Downloading https://files.pythonhosted.org/packages/9e/f0/3a3ced04c8359e562f1b91918d9bde797c8a916fcfeddc8dc5d673d1be20/tensorflow_hub-0.3.0-py2.py3-none-any.whl (73kB)
    100% |████████████████████████████████| 81kB 7.6MB/s 
Collecting numpy==1.15.1 (from tensorflowjs)
  Downloading https://files.pythonhosted.org/packages/d4/fd/6c1c98862f78b1aacd8d81811900ddd5cbe34a6ed168e8f84e4df7cac30f/numpy-1.15.1-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (24.5MB)
    100% |████████████████████████████████| 24.5MB 39.6MB/s 
Collecting h5py==2.8.0 (from tensorflowjs)
  Downloading https://files.pythonhosted.org/packages/2a/13/d3fb885ff877578e0fddd8c71e1ed9e22207cec8469c0ef1e483ab5ca0d3/h5py-2.8.0-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (6.0MB)
    100% |████████████████████████████████| 6.1MB 42.3MB/s 
Collecting keras==2.2.4 (from tensorflowjs)
  Downloading https://files.pythonhosted.org/packages/5e/10/aa32dad071ce52b5502266b5c659451cfd6ffcbf14e6c8c4f16c0ff5aaab/Keras-2.2.4-py2.py3-none-any.whl (312kB)
    100% |████████████████████████████████| 317kB 44.3MB/s 
Collecting six==1.11.0 (from tensorflowjs)
  Downloading https://files.pythonhosted.org/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl
Collecting tf-nightly-2.0-preview>=2.0.0.dev20190304 (from tensorflowjs)
  Could not find a version that satisfies the requirement tf-nightly-2.0-preview>=2.0.0.dev20190304 (from tensorflowjs) (from versions: )
No matching distribution found for tf-nightly-2.0-preview>=2.0.0.dev20190304 (from tensorflowjs)

我在 macOS 10.13.6 上使用 Python 3.7.2,pip 19.0.3。

4

3 回答 3

4

tf-nightly-2.0-preview仅针对 Python 2.7 和 3.6 发布适用于 MacOS 的二进制文件。

于 2019-03-26T10:34:34.150 回答
1

建议始终使用稳定版本的tf-nightly,使用命令

!pip install tf-nightly
于 2020-01-30T09:36:51.890 回答
0

我遇到了同样的问题,只在 python 3.6 上取得了成功,如果可以的话,试试看。

于 2019-03-26T09:44:22.773 回答