PyCharm 报告错误的 Python 版本 [英] PyCharm reports wrong Python version

查看:115
本文介绍了PyCharm 报告错误的 Python 版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据屏幕截图,我的系统报告 Python 3.6.5,但 PyCharm 报告的文件与 3.5.2 相同.

As per the screenshot, my system reports Python 3.6.5 but PyCharm is reporting the same file as 3.5.2.

有人知道怎么解决吗?

我怀疑这是因为对于以前的项目,我设置了解释器版本并设置了将此应用于所有未来项目"选项.然后升级了Anaconda.

I suspect it is because for a previous project I set the interpreter version and set "Apply this to all future projects" option. And then upgraded Anaconda.

推荐答案

项目名称是一个自由文本字符串,您可以将其更改为您想要的任何内容.当您去编辑解释器定义时,真正的细节在解释器路径"中.

The name of the project is a free text string, you can change it to whatever you want. The real details are in the "interpreter path" when you go and edit an interpreter definition.

单击齿轮并选择全部显示..."

Click the cog wheel and select "Show All..."

现在你可以看到真正的路径了.

Now you can see the real path.

我怀疑在您更新 anaconda 时名称并未更新,但 Python 版本实际上与您在命令行中看到的相同.您可以通过在 pycharm 中运行它来确认这一点:

I suspect the name just wasn't updated when you updated anaconda, but the Python version is actually the same as what you see in the command line. You can confirm this by running this from within pycharm:

import sys
print(sys.version)

如果您看到旧版本,您只需使用正确的 Python 3.6 环境路径向 PyCharm 添加新解释器即可.

If you see the old version, you can just add a new interpreter to PyCharm with the correct path to your Python 3.6 environment.

这篇关于PyCharm 报告错误的 Python 版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆