简体   繁体   English

在Pycharm中更改解释器,但不起作用

[英]Change the interpreter in Pycharm but it doesn't work

I changed the interpreter from python3.7 to python2.7 in Pycharm. 我在Pycharm中将解释器从python3.7更改为python2.7。 But after I did this process, the interpreter showed success but actually, when I ran the code it still was running with python 3.7. 但是在执行完此过程之后,解释器显示出了成功,但实际上,当我运行代码时,解释器仍在python 3.7上运行。

The interpreters are set from the anaconda. 口译员来自蟒蛇。

This image shows that I have changed the external library to Python 2.7 but when I test the type of python in the terminal, it still shows in Python3.7. 该图显示我已将外部库更改为Python 2.7,但是当我在终端中测试python类型时,它仍显示在Python3.7中。

I really struggle about this problem, hope someone can help me. 我真的在这个问题上挣扎,希望有人能帮助我。

I believe you face a known PyCharm bug: PY-23417 . 我相信您会遇到一个已知的PyCharm错误: PY-23417 IDE fails to activate the conda environment in the terminal so you end up running Python 2 instead of 3 by python executable as it uses the first interpreter in PATH . IDE无法激活终端中的conda环境,因此您最终使用python可执行文件运行Python 2而不是3,因为它使用PATH的第一个解释器。

Try PyCharm 2019.1 EAP build . 尝试使用PyCharm 2019.1 EAP build The problem should be resolved there. 该问题应该在那里解决。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM