简体   繁体   English

Pycharm 无法安装 TensorFlow

[英]Pycharm Can't install TensorFlow

I cannot install tensorflow in pycharm on windows 10, though I have tried many different things:我无法在 Windows 10 上的 pycharm 中安装 tensorflow,尽管我尝试了很多不同的东西:

  1. went to settings > project interpreter and tried clicking the green plus button to install it, gave me the error: non-zero exit code (1) and told me to try installing via pip in the command line, which was successful, but I can't figure out how to make Pycharm use it when it's installed there转到设置>项目解释器并尝试单击绿色加号按钮进行安装,给了我错误:非零退出代码(1)并告诉我尝试通过命令行中的pip安装,这是成功的,但我可以不知道如何让 Pycharm 在安装时使用它
  2. tried changing to a Conda environment, which still would not allow me to run tensorflow since when I input into the python command line: pip.main(['install', 'tensorflow']) it gave me another error and told me to update pip尝试更改为 Conda 环境,该环境仍然不允许我运行 tensorflow,因为当我输入 python 命令行时: pip.main(['install', 'tensorflow']) 它给了我另一个错误并告诉我更新点子
  3. updated pip then tried step 2 again, but now that I have pip 10.0.1, I get the error 'pip has no attribute main'.更新 pip 然后再次尝试第 2 步,但现在我有 pip 10.0.1,我收到错误“pip 没有属性 main”。 I tried reverted pip to 9.0.3 in the command line, but this won't change the version used in pycharm, which makes no sense to me.我尝试在命令行中将 pip 恢复为 9.0.3,但这不会改变 pycharm 中使用的版本,这对我来说没有意义。 I reinstalled anaconda, as well as pip, and deleted and made a new project and yet it still says that it is using pip 10.0.1 which makes no sense to me我重新安装了 anaconda 和 pip,并删除并创建了一个新项目,但它仍然说它正在使用 pip 10.0.1,这对我来说毫无意义

So in summary, I still can't install tensorflow, and I now have the wrong version of pip being used in Pycharm.所以总而言之,我仍然无法安装tensorflow,并且我现在在Pycharm中使用了错误版本的pip。 I realize that there are many other posts about this issue but I'm pretty sure I've been to all of them and either didn't get an applicable answer or an answer that I understand.我意识到还有很多其他关于这个问题的帖子,但我很确定我去过所有这些帖子,要么没有得到适用的答案,要么没有得到我理解的答案。

您可以尝试按照“ Pycharm anaconda导入张量流库问题 ”中的步骤进行操作以解决您的问题(“您需要执行以下步骤:”

what worked for is this;这样做的目的是什么;

  1. I installed TensorFlow on the command prompt as an administrator using this command pip install tensorflow我使用此命令pip install tensorflow在命令提示符下以管理员身份安装了 TensorFlow
  2. then I jumped back to my pycharm and clicked the red light bulb pop-up icon, it will have a few options when you click it, just select the one that says install tensor flow.然后我跳回我的 pycharm 并单击红色灯泡弹出图标,单击它时会有几个选项,只需选择安装张量流的选项即可。 This would not install in from scratch but basically, rebuild and update your pycharm workspace to note the newly installed tensorflow这不会从头开始安装,但基本上,重建和更新您的 pycharm 工作区以注意新安装的 tensorflow

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

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