Amira Deuraseh
Amira Deuraseh

Reputation: 23

Unable to create process because python.exe & pythonw.exe under Conda environment MISSING/GONE

From [Anaconda installer archive], I install Anaconda3-4.2.0-Windows-x86_64.exe, I open a conda prompt. I create conda environment.

conda create -n keras_tensorflow_2 python=3.5

Activate it.

activate keras_tensorflow_2

Install Theano, Tensorflow & Keras.

conda install theano
pip install --ignore-installed --upgrade tensorflow
pip install keras

*Although here, theano is successfully installed but does not work. But that's a different matter.

Run python & test for tensorflow inside the conda prompt.

python
import tensorflow

No error. It works. So now I want to open using Spyder. If I directly open Spyder, and import tensorflow inside the IPython, error shows:

ImportError: No module named tensorflow

So what I did that work is

  1. Open Anaconda Navigator
  2. Anaconda Navigator>Environments. Click keras_tensorflow_2 environment. [Pic_1]
  3. Anaconda Navigator>Home. At dropdown menu for "Applications on", choose tensorflow_2. Install Spyder. [Pic_2]

Then, open Spyder from Start Menu. Windows Security Alert pop up. Click Allow access. [Pic_3] . Test tensorflow, still not working.

So have to go back to Conda Prompt. Type

activate tensorflow_2
spyder

Conda prompt will automatically close and Spyder will automatically open. Import Tensorflow. Finally WORKS!

Up until this point, the folder Anaconda3>envs>tensorflow_2 still has python.exe and pythonw.exe as show here [Pic_4].

HOWEVER, once I close/restart Spyder, the folder Anaconda3>envs>tensorflow_2automatically has MISSING python.exe and pythonw.exe. [Pic_5] I don't know why this would happen. So I can no longer use this environment. When I tried to 'Open with IPython' through anaconda navigator [Pic_1], error:

Unable to create process using 'C:\Anaconda3\envs\keras_tensorflow_2\python.exe C:\Anaconda3\envs\keras_tensorflow_2\Scripts\ipython-script.py -i'

And every time I want to use Tensorflow, I have to recreate the environment. Any advice please? Thank you.

All pictures available here: https://drive.google.com/open?id=0B6eS8bjSwwBLSzFRTFVHdG9zTTA

Upvotes: 1

Views: 3312

Answers (1)

Amira Deuraseh
Amira Deuraseh

Reputation: 23

I found a way around it. Python.exe and Pythonw.exe still missing. Maybe it actually doesn't matter them being missing. I don't know.

Anyway, when inside conda prompt, if I navigate to my specific environment's Script, activate the environment and then run Spyder from there, it will work.

cd C:\Anaconda3\envs\keras_tensorflow_2\Scripts
activate keras_tensorflow_2
spyder

Reference: How to ensure that Spyder runs within a conda environment?

Upvotes: 0

Related Questions