Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing tensorflow on Pycharm (Mac)

enter image description hereenter image description hereI was trying to use tensorflow in Pycharm IDE.

It seems that in Pycharm, it is one-click to install a package. It was very easy with bumpy. Now error occurs when I was trying to install tensorflow. Tensorflow was installed through terminal on Mac, as screenshot shows, using the command

sudo pip install --upgrade https://storage.googleapis.com/tensorflow/mac/tensorflow-0.8.0-py2-none-any.whl (Refer to https://www.tensorflow.org/versions/r0.8/get_started/os_setup.html#pip-installation) Any suggestions ? Thanks.

enter image description here

like image 411
Bill Ancalagon the black Avatar asked May 03 '16 07:05

Bill Ancalagon the black


People also ask

How do I use TensorFlow in PyCharm Mac?

This is a working solution for me, first create a virtualenv from Pycharm and then install tensorflow there: In Pycharm, Preferences -> Project interpreter -> Create VirtualEnv -> give the virtualenv a name and location of your choice, and select "inherit global site-packages" option -> OK.

How can I install TensorFlow in PyCharm?

Click the Python Interpreter tab within your project tab. Click the small + symbol to add a new library to the project. Now type in the library to be installed, in your example "tensorflow" without quotes, and click Install Package . Wait for the installation to terminate and close all popup windows.

Can I install TensorFlow GPU on Mac?

# There is currently no official GPU support for MacOS. Note: TensorFlow with GPU access is supported for WSL2 on Windows 10 19044 or higher. This corresponds to Windows 10 version 21H2, the November 2021 update. You can get the latest update from here: Download Windows 10.


2 Answers

If you install tensorflow with the virtualenv option and want to use it from Pycharm for a project, you need to set up a corresponding virtualenv interpreter. There are a few solutions on the forum, for example How to get VirtualEnv TensorFlow to work in PyCharm?, however, that one didn't work for me with a "python packaging tools not found pycharm" error.

This is a working solution for me, first create a virtualenv from Pycharm and then install tensorflow there:

  1. In Pycharm, Preferences -> Project interpreter -> Create VirtualEnv -> give the virtualenv a name and location of your choice, and select "inherit global site-packages" option -> OK. create virtualenv
  2. In command line, install tensorflow in the virtualenv location you created in Step 1. For the above case, the location is ~/tensorflow_pycharm, therefore, run command virtualenv --system-site-packages ~/tensorflow_pycharm

  3. In Pycharm, select the created project interpreter, and select the tensorflow package, double click to install the package.

  4. If Step 3 is successful, set run configuration, and try run a sample program. run config sample program

like image 108
Shunan Zhang Avatar answered Nov 25 '22 11:11

Shunan Zhang


Update - Nov. 1, 2017:

Tried successfully with Latest Jetbrain PyCharm Community Edition (2017.2.4) and Python 2.7.14, with Installing with virtualenv of https://www.tensorflow.org/install/install_mac.

Install tensorflow with virtualenv

Install tensorflow with virtualenv

virtualenv folder

Add Local to Project Interpreter.

Select Project Interpreter

Pycharm configuration

Run the script

enter image description here

enter image description here

Generate graph

Run tensorboard --logdir=/tmp/tensorflow_logs in Terminal of PyCharm

enter image description here

See graph in browser

like image 42
Paul Lan Avatar answered Nov 25 '22 10:11

Paul Lan