简体   繁体   English

ImportError:没有名为“ tensorflow”的模块

[英]ImportError: No module named 'tensorflow'

This is out there a lot but I cant seem to find my specific circumstance, I think tensorflow is installed but it doesnt import: 这很多,但我似乎找不到我的特定情况,我认为已安装tensorflow但未导入:

C:\Users\Upstairs\AppData\Local\Programs\Python\Python35\Scripts>pip3 install --upgrade tensorflow
Requirement already up-to-date: tensorflow in c:\users\upstairs\appdata\local\programs\python\python35\lib\site-packages
Requirement already up-to-date: wheel>=0.26 in c:\users\upstairs\appdata\local\programs\python\python35\lib\site-packages (from tensorflow)
Requirement already up-to-date: protobuf>=3.1.0 in c:\users\upstairs\appdata\local\programs\python\python35\lib\site-packages (from tensorflow)
Requirement already up-to-date: six>=1.10.0 in c:\users\upstairs\appdata\local\programs\python\python35\lib\site-packages (from tensorflow)
Requirement already up-to-date: numpy>=1.11.0 in c:\users\upstairs\appdata\local\programs\python\python35\lib\site-packages (from tensorflow)
Requirement already up-to-date: setuptools in c:\users\upstairs\appdata\local\programs\python\python35\lib\site-packages (from protobuf>=3.1.0->tensorflow)
Requirement already up-to-date: packaging>=16.8 in c:\users\upstairs\appdata\local\programs\python\python35\lib\site-packages (from setuptools->protobuf>=3.1.0->tensorflow)
Requirement already up-to-date: appdirs>=1.4.0 in c:\users\upstairs\appdata\local\programs\python\python35\lib\site-packages (from setuptools->protobuf>=3.1.0->tensorflow)
Requirement already up-to-date: pyparsing in c:\users\upstairs\appdata\local\programs\python\python35\lib\site-packages (from packaging>=16.8->setuptools->protobuf>=3.1.0->tensorflow)
You are using pip version 8.1.1, however version 9.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

C:\Users\Upstairs\AppData\Local\Programs\Python\Python35\Scripts>cd..

C:\Users\Upstairs\AppData\Local\Programs\Python\Python35>python
Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named 'tensorflow'
>>>

OK I had to delete the tensorflow folder in 好的,我必须删除其中的tensorflow文件夹

C:\Users\Upstairs\AppData\Local\Programs\Python\Python35\Lib\site-packages 

then: 然后:

C:\Users\Upstairs\AppData\Local\Programs\Python\Python35\Scripts>pip3 install --upgrade tensorflow

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM