我的PyCharm无法以某种方式在Python控制台中导入pandas模块。
import pandas
Backend Qt5Agg is interactive backend. Turning interactive mode on.
Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)
当然,当我在项目中运行脚本时,也会出现相同的错误。您可能会注意到,我正在使用anaconda3环境。建立和启动新的anaconda环境无法正常工作。
/home/work/.conda/envs/siegellab/bin/python3.5 /snap/pycharm-community/169/plugins/python-ce/helpers/pydev/pydevconsole.py --mode=client --port=45913
import sys; print('Python %s on %s' % (sys.version, sys.platform))
sys.path.extend(['/home/work/phd/protabank'])
Python 3.5.6 |Anaconda, Inc.| (default, Aug 26 2018, 21:41:56)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.5.0 -- An enhanced Interactive Python. Type '?' for help.
PyDev console: using IPython 6.5.0
Python 3.5.6 |Anaconda, Inc.| (default, Aug 26 2018, 21:41:56)
[GCC 7.3.0] on linux
import os
...:os.environ['PYCHARM_DEBUG'] = 'True'
...:runfile('/home/work/project/sequence_manager.py', wdir='/home/work/project')
...:
Backend Qt5Agg is interactive backend. Turning interactive mode on.
Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)
有趣的是,可以通过PyCharm终端中的ipython加载熊猫。
Python 3.6.3 |Anaconda, Inc.| (default, Oct 13 2017, 12:02:49)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.1.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import pandas
In [2]:
numpy和os模块不会发生此问题。是否有任何建议可将熊猫加载到PyCharm中?
答案 0 :(得分:0)
版本不匹配。终端ipython使用Python 3.5,而PyCharm则使用Python 3.6。
重新安装环境并匹配python版本即可解决此问题。