- In Pycharm,
Preferences -> Project Interpreter -> Create VirtualEnv -> <your_virtualenv_name_and_location>
, and select "inherit global site-packages" option -> OK. - In command line, install tensorflow in the virtualenv location you created in previous step. For the above case, let's assume the location is
~/tensorflow_pycharm
, therefore, run commandvirtualenv --system-site-packages -p python3 ~/tensorflow_pycharm
orpython3 -m venv ~/tensorflow_pycharm
(changed in version 3.5: the use of venv is now recommended for creating virtual environments). - Install tensorflow with one of the following approaches:
- From command line
- Activate the virtualenv environment by issuing one of the following commands:
source ~/tensorflow_pycharm/bin/activate
- Issue the following command to install TensorFlow and all the packages that TensorFlow requires into the active Virtualenv environment:
pip3 install --upgrade tensorflow
. - In PyCharm, select the configured
Project Interpreter
at~/tensorflow_pycharm
- Activate the virtualenv environment by issuing one of the following commands:
- From PyCharm
- In PyCharm, select the previously created
Project Interpreter
(~/tensorflow_pycharm), and click + button and search for tensorflow, and then double click to install the package.
- In PyCharm, select the previously created
- From command line
- Now you are ready to play with
tensorflow
from PyCharm.
Last active
August 29, 2022 19:14
-
-
Save gembin/634b4f462766a8a79c3035a85bbcd7a7 to your computer and use it in GitHub Desktop.
Installing Tensorflow on Pycharm (Mac)
@micolsi you can downgrade to python 3.6
# Install the latest Python 3.6 via brew using its commit id
brew unlink python
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/f2a764ef944b1080be64bd88dca9a1d80130c558/Formula/python.rb
# switch among different versions if needed
brew switch python 3.7.0
brew switch python 3.6.5_1
best guide to install Tensorflow on Mac
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@micolsi probably you are using python 3.7, see this issue tensorflow/tensorflow#20444