PyCharm无法加载熊猫模块

问题描述 投票:0回答:1

以某种方式,我的PyCharm无法在Python控制台中导入熊猫模块。

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?

python pandas pycharm
1个回答
0
投票

版本不匹配。终端ipython使用Python 3.5,而PyCharm则使用Python 3.6。

重新安装环境并匹配python版本即可解决此问题。

© www.soinside.com 2019 - 2024. All rights reserved.