Pycharm 的终端在 Project Interpreter 中不会改变 Python 版本对应的 Python 版本 [英] Pycharm's terminal doesn't change the Python version corresponding to Python version at Project Interpreter

查看:57
本文介绍了Pycharm 的终端在 Project Interpreter 中不会改变 Python 版本对应的 Python 版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在 Windows 上安装了 Pycharm 2016.3 并安装了两个版本的 Python(3.5.2 和 2.7.9).我想同时使用这两个版本,所以我在 Project Interpreter 窗口中配置了它.我选择了如下图所示的3.5.2版本

I have installed Pycharm 2016.3 and installed two version of Python (3.5.2 and 2.7.9) on Windows. I would like to use both of these version, so I configured it at the Project Interpreter window. I chose the 3.5.2 version like the image below

之后我打开了 Python 控制台,在 3.5.2 版本的 Python 上一切正常.但是当我打开终端并按 python --version 时,版本仍然没有改变.

After that I opened the Python Console, everything works fine with the 3.5.2 version of Python. But when I open the Terminal and press python --version, the version was still not changed.

我无法使用语句 python manage.py runserver 运行服务器,因为该项目包含一些只能在 Python 3.x 而不是 2.x 中运行的代码.

I couldn't run the server with the statement python manage.py runserver because the project contains some code which could only be ran in Python 3.x, not 2.x.

我该如何解决这个问题?非常感谢

How can I fix this problem? Thank you so much

推荐答案

PyCharm Terminal 是你的本地系统终端,可以在官方 PyCharm 网站.

PyCharm Terminal is your local system terminal, as it can be seen in the official PyCharm website.

所以你需要确保你的本地 python 指向你想要的 python 安装版本.

So you need to make sure that your local python, points to the python setup version you want.

对于 Linux,类似这样:

For Linux, something like that:

alias python=/usr/local/bin/python3.5

对于 Windows,您可能会发现此讨论.

For Windows you may find helpful this discussion.

这篇关于Pycharm 的终端在 Project Interpreter 中不会改变 Python 版本对应的 Python 版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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