【问题标题】:ModuleNotFoundError when importing TensorFlow导入 TensorFlow 时出现 ModuleNotFoundError
【发布时间】:2021-05-10 17:40:30
【问题描述】:
我尝试将 TensorFlow(通过 pip 下载)导入 Jupyter notebook 或 PyCharm ce,但两者都出现 ModuleNotFound 错误。我之前也安装了 Anaconda 并删除了该应用程序,但我认为文件仍然存在,当我尝试在终端中写入“conda”时,它说找不到命令。
【问题讨论】:
标签:
python
tensorflow
jupyter-notebook
pycharm
anaconda
【解决方案1】:
这些步骤将帮助您在 Anaconda 中安装 Tensorflow
1. Download the anaconda package from https://www.anaconda.com/download/
or
curl -O https://repo.anaconda.com/archive/Anaconda3-x-x-x-x.sh
2. Verify the Data Integrity of the Installer (optional)
sha256sum Anaconda3-x-x-x-x.sh
3. Run the Anaconda Script
bash Anaconda3-x-x-x-x.sh
4. Activate Installation
source ~/.bashrc
5. Test Installation
conda list
6. Set Up Anaconda Environments
conda create --name tf python=3
7. Activate the new Environment
source activate tf
8. Install Tensorflow
tf$pip install tensorflow