Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use tensorflow in pycharm

Shulou Source: shulou.com Published: 2022-06-02 13:45:45 11月15日 Update

This article will explain in detail how to use tensorflow in pycharm, Xiaobian thinks it is quite practical, so share it with you as a reference, I hope you can gain something after reading this article.

Requirements:

Need to run a deep learning project in pycharm

But tensorflow packets cannot be imported

Problem analysis:

Currently using version 3.8 of anaconda, unable to download tensorflow package normally, you need to build a virtual environment using 3.7 and below interpreters

Leveraging the anaconda virtual environment

First open anaconda prompt: Create a new 3.7 virtual environment:

//mirror only domestic conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/conda config --set show_channel_urls yes//create new virtual environment conda create -n tensorflow python=3.7

After typing these commands, you can see the tensorflow environment we created under the envs folder:

Activate virtual environment and pip install

conda activate tensorflowpip install tensorflow==1.14.0

We see it's downloaded.

Change pycharm interpreter to tensorflow virtual environment

Change interpreter to version 3.7 in setting, we can see tensorflow inside

Verification of results:

The red line disappeared! Success!!

About "how to use tensorflow method in pycharm" this article is shared here, I hope the above content can be of some help to everyone, so that you can learn more knowledge, if you think the article is good, please share it to let more people see.

Tags: Environment articles methods more versions interpreters interpreters good practical successful Lieutenant General content commands files folders articles depth activation knowledge red lines Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info Linux macOS Apple MariaDB