将 PyCharm 定向到 Python 3.3 解释器? [英] Directing PyCharm to Python 3.3 interpreter?

查看:31
本文介绍了将 PyCharm 定向到 Python 3.3 解释器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道为什么我会遇到这么多麻烦.我在 OS X 10.7 上,我使用默认设置安装了 Python,并运行了包含的 .command 文件.

我只想让 PyC​​harm 与 Python 3.3 一起工作,但我似乎找不到工作的解释器.唯一一个我可以立即找到负载(提供分发"和设置工具"包)并给我一些骨架未能生成"错误.如果我选择其中一个 2.7 解释器,它会加载一段时间,但我仍然会收到类似的错误.我也遇到了一些找不到 Python 打包工具的问题(通常是pip").

找了好久还是没找到解决办法.

解决方案

PyCharm 自动检测从 http:/安装的 Python 的 Python 3.3 路径/python.org mpkg 安装程序:

/Library/Frameworks/Python.framework/Versions/3.3/bin/python3

将此解释器添加到 PyCharm 后,安装包管理工具(点击 Install 'distribute',然后点击 Install 'pip'):p>

使用 Upgrade 按钮将 pip 升级到最新版本(分发升级将失败).

现在您可以使用 Install 按钮安装软件包,例如可以从 PyCharm 的解释器对话框中安装 Django:

如果您遇到代码补全问题,请尝试 File |Invalidate Caches,重启 PyCharm 并等待索引完成.对我来说,开箱即用效果很好:

I'm not sure why I'm having so much trouble with this. I'm on OS X 10.7, and I installed Python with default settings and ran the .command file included.

I just want to get PyCharm working with Python 3.3, but I can't seem to find a working interpreter. The only one I can find loads instantly (gives 'distribute' and 'setuptools' packages) and gives me 'some skeletons failed to generate' errors. If I choose one of the 2.7 interpreters it loads for a while but I still get a similar error. I also get some issue with Python packaging tools not being found (usually it's 'pip').

I've searched for a long time but can't find a solution.

解决方案

PyCharm detects Python 3.3 path automatically for the Python installed from http://python.org mpkg installer:

/Library/Frameworks/Python.framework/Versions/3.3/bin/python3

Once you add this interpreter to PyCharm, install the package management tools (click on the Install 'distribute', then click on Install 'pip'):

Upgrade pip to the latest version using the Upgrade button (distribute upgrade will fail).

Now you can install packages with the Install button, for example Django can be installed from the Interpreters dialog in PyCharm:

If you have problems with code completion, try File | Invalidate Caches, restart PyCharm and wait until indexing is finished. For me it worked fine out of the box:

这篇关于将 PyCharm 定向到 Python 3.3 解释器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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