在 PyCharm 中配置解释器:“请使用不同的 SDK 名称"; [英] Configuring interpreter in PyCharm: "please use a different SDK name"

查看:147
本文介绍了在 PyCharm 中配置解释器:“请使用不同的 SDK 名称";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用 Pycharm 多年,从未遇到任何问题.但是,在最近的 PyCharm 更新之后,我无法再配置解释器.

I have been using Pycharm for years and have never had any problem. However, after my most recent PyCharm update I can no longer configure the interpreter.

此外,每次我创建一个新项目时,它都会在我的项目下创建一个 vent 目录.当我转到 File/Default Settings/Project Interpreter 时,我会看到新的选项.

Also each time I create a new project it creates a vent directory under my project. When I go to File/Default Settings/Project Interpreter, I am provided with new options.

在此窗口中,您可以配置虚拟环境、conda 环境和系统解释器.我假设我应该配置系统解释器.从那里我将 PyCharm 指向我 Mac 上 /usr/local/Cellar/python3/3.6.3/bin/python3 的解释器,然后点击 OK.

In this window it allows you to configure a virtual environment, the conda environment, and the system interpreter. I am assuming that I should configure the system interpreter. From there I point PyCharm to the interpreter on my Mac at /usr/local/Cellar/python3/3.6.3/bin/python3 and hit OK.

然后它带我回到主窗口,在那里它显示了项目解释器中的路径.此时我点击应用并收到一条消息:

It then takes me back to the main window where it shows the path in the project interpreter. At this point I hit apply and get a message:

无法保存设置,请使用不同的 SDK 名称

Cannot Save Settings please use a different SDK name

无论我选择哪个口译员,我都会收到相同的信息.有没有其他人遇到过同样的问题,我该如何解决?

It doesn't matter which interpreter I choose, I get the same message. Has anyone else come up with the same problem and how do I fix this?

有趣的是,我的旧项目仍然可以正常工作.

Interestingly my old projects still work correctly.

推荐答案

Jon;我也注意到最新版本的 PyCharm 的不同之处.似乎它现在对最新的工具venv"有了亲和力.当您创建解释器时 - 这就是您所得到的.

Jon; I too noticed the difference in the latest version of PyCharm. It seems that it now has an affinity for the latest tool 'venv'. When you create an interpreter - that is what you get.

您仍然可以手动创建一个 virtualenv 并将其指向那里.我还没有考虑将它指向一个基本的 python-bin,因为(坦率地说)你通常不应该这样做.

You can still create a virtualenv manually and point it there instead. I haven't looked into pointing it to a base python-bin because (frankly) you shouldn't generally do it.

我的建议(以及我提出的答案)是接受这种变化,让它为你创造一个venv".从那里,通过alt-F12"完成所有安装.这将打开一个控制台,激活您的虚拟环境——因此您的 PIP 安装到虚拟环境中.

My advice (and my proposed answer) is to embrace the change and let it create a 'venv' for you. From there, do all of your installs by "alt-F12". That will open a console with your virtual environment activate -- so your PIP installs into the virtual environment.

一旦我开始使用虚拟环境,我就再也没有回头.它使 Python 世界的生活变得更加轻松.Pycharm 似乎也知道这一点,并试图真正鼓励您做正确的事情.

Once I began using virtual environments, I never looked back. It has made life much easier in the python world. Pycharm seems to know this as well and is trying to really encourage you to do the right thing.

史蒂夫

这篇关于在 PyCharm 中配置解释器:“请使用不同的 SDK 名称";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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