我正在尝试在我的虚拟环境中安装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。
答案 0 :(得分:2)
tf-nightly-2.0-preview仅针对Python 2.7和3.6发行MacOS二进制文件。
答案 1 :(得分:1)
建议始终使用稳定版本的tf-nightly,请使用命令
!pip install tf-nightly
答案 2 :(得分:0)
我遇到了同样的问题,只有在使用Python 3.6时才成功,请尝试一下。