无法在Python中安装Tensorflow

时间:2017-04-10 16:04:17

标签: python tensorflow python-3.5

我在Windows上运行python 3.5.3

我尝试使用

pip install --upgrade tensorflow 

以及我的回复

Using cached tensorflow-1.0.1-cp35-cp35m-win_amd64.whl
Requirement already up-to-date: wheel>=0.26 in 
c:\users\max\miniconda3\lib\site-packages (from tensorflow)
Exception:
Traceback (most recent call last):
  File "C:\Users\Max\Miniconda3\lib\site-packages\pip\basecommand.py", line 
215, in main
status = self.run(options, args)
  File "C:\Users\Max\Miniconda3\lib\site-packages\pip\commands\install.py", line 335, in run
    wb.build(autobuilding=True)
  File "C:\Users\Max\Miniconda3\lib\site-packages\pip\wheel.py", line 749, in build
    self.requirement_set.prepare_files(self.finder)
  File "C:\Users\Max\Miniconda3\lib\site-packages\pip\req\req_set.py", line 380, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "C:\Users\Max\Miniconda3\lib\site-packages\pip\req\req_set.py", line 666, in _prepare_file
    check_dist_requires_python(dist)
  File "C:\Users\Max\Miniconda3\lib\site-packages\pip\utils\packaging.py", line 48, in check_dist_requires_python
    feed_parser.feed(metadata)
  File "C:\Users\Max\Miniconda3\lib\email\feedparser.py", line 178, in feed
self._input.push(data)
  File "C:\Users\Max\Miniconda3\lib\email\feedparser.py", line 104, in push
self._partial.write(data)
TypeError: string argument expected, got 'NoneType'

我也试过

pip3 install --upgrade tensorflow

但我回来了

'pip3' is not recognized as an internal or external command, operable program or batch file.

我不太确定错误是什么,谷歌搜索没有给我任何结果

1 个答案:

答案 0 :(得分:2)

我也有同样的问题。我正在使用Anaconda,我设法用这些命令安装它:

conda create -n tensorflow 
activate tensorflow
pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.0.1-cp35-cp35m-win_amd64.whl

这对我有用,可能这也适用于miniconda。