1

The Python interpreter works great in the terminal with my environment. As you can see in the picture, after I activate the environment and try tensorflow in python. It works.

enter image description here

However, when I setup up the Project Interpreter using same environment. The IDE complaint that my TensorFlow is still old.

enter image description here

Patrick
  • 797
  • 5
  • 15
  • Possible duplicate of [Keras import error Nadam](https://stackoverflow.com/questions/38809686/keras-import-error-nadam) – ivan_pozdeev Oct 24 '17 at 06:15
  • The difference is that your terminal uses the registered version of python, as stated in the path environments, whereas in PyCharm you can set your interpreter manually. I assume you updated the package only for the standard python, but not for the one you select in PyCharm. – offeltoffel Oct 24 '17 at 06:30
  • @offeltoffel I did set the Project Interpreter in Default Preferences in PyCharm. Which I assume it will used for all the projects I run. However, when I click run in the PyCharm, I do see it using different python3.5 interpreter, so how do I correct this? – Patrick Oct 24 '17 at 06:42
  • 1
    The interpreter is the first thing I set for a new project, no matter what the default settings may be. Open your project, go to File, Settings, Project Interpreter and then choose the one yo like. `OK` will save that to your project and you are good to go. – offeltoffel Oct 24 '17 at 06:45
  • @offeltoffel Yes, that's exactly we I did, you can see the picture (3rd yellow rectangle), the Project Interpreter, I already choose the one I need to use (~/tensorflow_install_ZP_GPU which has tersorflow 1.1.0). But, as you can see in the 1st yellow rectangle, when I run the main.py, somehow PyCharm didn't used the Project Interpreter I choose, instead, it used some Project Interpreter called: /Users/pzhang/anaconda/envs/carnd-term1/bin/python3.5 – Patrick Oct 24 '17 at 06:49
  • 1
    Well, I am not familiar with virtuel environments, but they are likely to cause the problem. Try the `Run` menu and go to `Run/Debug Condigurations`. Maybe this will give you a hint for the problem? – offeltoffel Oct 24 '17 at 06:53
  • 1
    @offeltoffel Issue solved. Looks like I need to change Python interpreter in the Run Config. When I open Run Config, it's not the correct one I want to use. After I changed it, it works now. THanks – Patrick Oct 24 '17 at 07:01

1 Answers1

1

The issue lies in the Settings for Run/Debug which are found in the Run menu. The interpreter can differ from the one specified in the Project Settings.

offeltoffel
  • 2,691
  • 2
  • 21
  • 35