简体   繁体   中英

Python module installed on Windows 10 with Ubuntu bash is not recognized

I have to use TensorFlow on my Windows 10 laptop, on which I have installed python 2.7, 3.2 and 3.4.2. I followed the instructions on the first answer here . I managed to install pip3 and tensorflow with the Ubuntu bash environment and I successfully tested TensorFlow on the command prompt. However, when I try to import it in my IEP environment (using Python 3.4), the module is not recognized. I am pretty new in managing python modules. What am I missing?

UPDATE: I found out that, when using Python via the ubuntu bash, the version is 3.4.3, but I never installed this version. Is there a way I can make it work with the versions I installed?

Looks like you are trying to make things complex to start with and having 3 (actually 4) python environment is making it even more harder if you are new to python. If you want to start using TF quickly and avoid platform specific problem, the quick route will be to remove most of platform 3.x installs and keep one if you really need 3.x otherwise you can do a lot with python 2.7. Once you have only 1 python environment, it will be very easy for you to manage and run faster. If you don't want to change anything and get you going with python do the following:

  • Install pip 8.1 or above
  • Install virtualenv for python 2.7 using pip - (This will help you to keep all the python specific modules within a specific folder)
  • Install TF for python 2.7 from https://www.tensorflow.org/get_started/os_setup
  • Use python 2.7 shell

If you run this command it will show which TF module you are using and where it is install (you must have TF installed):

python -c 'import os; import inspect; import tensorflow; print(os.path.dirname(inspect.getfile(tensorflow)))'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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