Installing tensorflow on Pycharm (Mac)

前端 未结 5 788
攒了一身酷
攒了一身酷 2020-12-31 17:33

I 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 w

5条回答
  •  悲&欢浪女
    2020-12-31 18:04

    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.
    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.

提交回复
热议问题