PyCharm中设置python3解释器

MAC上的PyCharm中默认的python解释器是python2的,windows下的没用过不是很清楚,所以特来记录下设置python3解释器的过程。

python3的查找与安装

如果电脑中没有安装python3可以用brewhome来安装,简单记录下

// 查看python版本
python --version
python3 --version
// 搜索python
brew search python
搜索python
// 安装python3
brew install python3

然后经过一个漫长的过程就安装好了,好,圆规正题

设置PyCharm

打开PyCharm的偏好设置


PyCharm中设置python3解释器_第1张图片
Perferences
// 搜索Interpreter
Interpreter

点击更多按钮,选择【Create VirtualEnv】


PyCharm中设置python3解释器_第2张图片
Project Interpreter
PyCharm中设置python3解释器_第3张图片
more
PyCharm中设置python3解释器_第4张图片
Create VirtualEnv

Name随便写,位置可以跟我一样放到[.virtualenvs]下

/Users/(userName)/.virtualenvs
PyCharm中设置python3解释器_第5张图片
选择python3的位置

查看python位置

python位置
// python2
which python
// python3
which python3

选择【Base interpreter】python3的执行文件位置


PyCharm中设置python3解释器_第6张图片
python3路径
PyCharm中设置python3解释器_第7张图片

点击OK就好了,接下来设置python3做为默认的解释器吧


PyCharm中设置python3解释器_第8张图片
Paste_Image.png
PyCharm中设置python3解释器_第9张图片
欢迎关注微信公众号:linxunfengtop

你可能感兴趣的:(PyCharm中设置python3解释器)