我正在尝试使用pip安装TensorFlow:
$ pip install tensorflow --user
Collecting tensorflow
Could not find a version that satisfies the requirement tensorflow (from versions: )
No matching distribution found for tensorflow
我做错了什么?到目前为止,我使用Python和pip没有任何问题。
我正在尝试使用pip安装TensorFlow:
$ pip install tensorflow --user
Collecting tensorflow
Could not find a version that satisfies the requirement tensorflow (from versions: )
No matching distribution found for tensorflow
我做错了什么?到目前为止,我使用Python和pip没有任何问题。
当前回答
通过勾选“添加python到路径”来安装python Pip3安装——升级https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.12.0-py3-none-any.whl
这适用于windows 10.0
其他回答
使用管理权限启动命令提示符 输入以下命令python -m pip install——upgrade pip 接下来输入命令pip install tensorflow
你需要一个64位版本的Python,在你的情况下,你使用的是32位版本。到目前为止,Tensorflow只支持64位版本的Python 3.5。X和3.8。Windows操作系统。请参阅安装文档以了解当前支持的内容
要检查您正在运行的Python版本,输入Python或python3启动解释器,然后输入import struct;print(struct.calcsize("P") * 8),这将打印32或64来告诉您正在运行的Python的比特版本。
评论:
要下载不同版本的Windows Python,请访问python.org/downloads/windows并向下滚动,直到看到以“64”结尾的版本。这将是64位版本,应该与张量流一起工作
按照以下步骤安装tensorflow和keras:
从https://repo.anaconda.com/archive/下载python 3.6附带的Anaconda3-5.2.0 安装Anaconda并打开Anaconda提示符并执行以下命令 Conda安装jupyter Conda安装scipy PIP安装sklearn PIP安装msgpack PIP安装熊猫 PIP安装panda -datareader PIP安装matplotlib PIP安装枕 PIP安装请求 PIP install h5py PIP安装tensorflow PIP安装keras
这个问题有很多种答案。这个答案旨在概括一组答案:
可能没有一个TensorFlow版本与你的Python版本兼容。如果您使用的是Python的新版本,这一点尤其正确。例如,在Python的新版本发布和该版本的Python的TensorFlow发布之间可能会有延迟。
在这种情况下,我相信你的选择是:
升级或降级到不同版本的Python。(虚拟环境很好,例如conda install python=3.6) 选择与你的python版本兼容的特定版本的tensorflow,例如,如果你仍在使用python3.4: pip install tensorflow==2.0 从源代码编译TensorFlow。 等待一个与你的Python版本兼容的TensorFlow的新版本。
为了解决这个错误,你可能需要先升级pip,然后安装TensorFlow,如下所示
# Requires the latest pip
pip install --upgrade pip
# Current stable release for CPU and GPU
pip install tensorflow
如果你使用蟒蛇提示,那么试试这个
conda install -c anaconda tensorflow-gpu