简体   繁体   English

PyCharm:配置Python控制台

[英]PyCharm : Configuring Python Console

I am running Conda environments on a Ubuntu VM box (that has no display). 我在Ubuntu VM盒(没有显示)上运行Conda环境。 I am trying to use PyCharm but the PyCharm Python Console won't import libraries correctly for some reason. 我正在尝试使用PyCharm,但是由于某些原因,PyCharm Python控制台无法正确导入库。 Eg import pandas gives: 例如, import pandas给出:

 Backend Qt5Agg is interactive backend. Turning interactive mode on. QXcbConnection: Could not connect to display bash: line 1: 12547 Aborted (core dumped) env "PYTHONUNBUFFERED"="1" "PYTHONPATH"="/home/local/US/me/max:/home/local/US/me/.pycharm_helpers/pydev" "PYCHARM_HOSTED"="1" "IPYTHONENABLE"="True" "PYTHONDONTWRITEBYTECODE"="1" "JETBRAINS_REMOTE_RUN"="1" "PYTHONIOENCODING"="UTF-8" /home/local/US/me/conda/envs/research/bin/python2.7 /home/local/US/me/.pycharm_helpers/pydev/pydevconsole.py 0 0 Process finished with exit code 134 

I tried uninstalling and reinstalling pandas , conda , and everything and nothing fixes this. 我尝试卸载并重新安装pandasconda ,所有内容均conda Also, when I run Python or IPython from the terminal in PyCharm, then everything works perfectly. 另外,当我从PyCharm的终端运行Python或IPython时,一切都将完美运行。 I can import all packages as needed with no errors. 我可以根据需要导入所有程序包,而不会出现错误。

Perhaps you don't select correct python interpreter. 也许您没有选择正确的python解释器。 select correct in settings like 选择正确的设置,例如 这个

also look at this https://www.jetbrains.com/help/pycharm/2017.1/configuring-python-interpreter-for-a-project.html 也请看这个https://www.jetbrains.com/help/pycharm/2017.1/configuring-python-interpreter-for-a-project.html

In addition yo cat use -X (big x) in ssh for X forwarding 另外,哟猫在ssh中使用-X (big x)进行X转发

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

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