
- Is PyCharm your python IDE?
- Did you install tensorflow using a virtual environment?
If so, this is a way to combine both, your tensorflow code running in a virtual environment used by PyCharm and from command line.
This article assumes you installed Python3 and pip3 already.
First step would be to create a new virtual environment using PyCharms Project Interpreter dialog for your existing project:

The settings symbol on the left upper corner allows you to initiate a new virtual environment creation:

As in the tensorflow installtion guide you should inherit global site-packages:

After the virtual environment is created, I did test it first from using command line:
# optional $ cd ~/tensorflow_pycharm # activate the virtual env $ source ~/tensorflow_pycharm/bin/activate # deactivate the virtual env after your prompt should have changed (tensorflow)$ deactivate

Now its time to define & install the correct tensorflow binary to install as defined in the tensorflow installtion guide. In my case it would be:
$ cd ~/tensorflow_pycharm $ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.10.0rc0-cp34-cp34m-linux_x86_64.whl $ sudo pip3 install --upgrade $TF_BINARY_URL

This virtual environment can then be used in a PyCharm project run configuration:


Select the just created virtual environment in case it is not preselected yet:

Set the script to be run. The intro tensorflow script (from tensorflow introduction) is used for this post:


No you are ready to run your script via virtual environment from both, PyCharm and command line:
- PyCharm:
run script using PyCharm virtual env - command line:
run script using command line virtual env
related links:
- http://stackoverflow.com/questions/37447906/how-to-get-virtualenv-tensorflow-to-work-in-pycharm
- https://www.jetbrains.com/help/pycharm/2016.1/configuring-python-interpreter-for-a-project.html#d29405e148
- https://www.jetbrains.com/help/pycharm/2016.1/adding-existing-virtual-environment.html
- https://www.youtube.com/watch?v=X3yTxWem7iY
i can run in pycharm, but my pycharm also can not configure tensorflow apis…
I am not sure if I understand your question. Tensorflow functionality can be used in python code by importing the tensorflow module. Would that answer your question?
I mean my pycharm do not configure tensorflow envirenmont, but my command does.I have followed your step
Pls elaborate on the details of what does not work as you expect it. May that be connected to the virtual environment setup?
Thanks for this.Worked like a charm!
Super! Vielen Dank Lothar!