简体   繁体   English

导入已安装的软件包pyCharm

[英]Import installed package pyCharm

I have pyCharm and Python 3.7. 我有pyCharm和Python 3.7。 When I go to project interpreter > packages and try to download tensorflow, it outputs an error that tells me to do the command pip install tensorflow . 当我转到项目interpreter > packages并尝试下载tensorflow时,它输出一个错误,告诉我执行命令pip install tensorflow I did that. 我做到了 Now, how do I import to pyCharm? 现在,如何导入pyCharm? This is the error, but I already did pip update 这是错误,但我已经进行了点子更新

In PyCharm: 在PyCharm中:

Option 1: If you have installed TensorFlow without GPU support, you don't need to do anything. 选项1:如果您安装了不支持GPU的TensorFlow,则无需执行任何操作。 Simply import TensorFlow to your script and you're done. 只需将TensorFlow导入到脚本中就可以了。

Option 2: If you have installed TensorFlow with GPU support, then you would have also installed CUDA Toolkit 9.0 and cuDNN v7.0 (24.05.2018). 选项2:如果您安装了具有GPU支持的TensorFlow,那么您还将安装CUDA Toolkit 9.0和cuDNN v7.0(24.05.2018)。 You can add the appropriate directories to your %PATH% environment variable. 您可以将适当的目录添加到%PATH%环境变量中。 However, even when doing so, PyCharm was complaining! 但是,即使这样做,PyCharm仍在抱怨! Therefore, it's much easier to add these directories directly to your PyCharm project structure. 因此,将这些目录直接添加到PyCharm项目结构中要容易得多。

File > Setting > Project Structure > Add Content Root > Add 文件>设置>项目结构>添加内容根>添加

· path_to_Cuda\\v9.0\\bin ·path_to_Cuda \\ v9.0 \\ bin

· path_to_cuDNN\\v7.0\\bin ·path_to_cuDNN \\ v7.0 \\ bin

Import TensorFlow to your script and you're done :) 将TensorFlow导入您的脚本即可完成:)

Hope this helps! 希望这可以帮助!

Tensorflow is not availble for 3.7 version as of now. 截至目前,Tensorflow不适用于3.7版本。

Downgrade the python version to 3.6.4 将python版本降级到3.6.4

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM