小编Ale*_* S的帖子

PyCharm,有些软件包无法导入Pandas,ImportError:C扩展名:StringIO未构建

我有一个非常奇怪的错误,无法解决它.

我有一个具有以下目录结构的项目:

ptouch/
    ptouch/
        __init__.py
        ptouch.py
        io.py
    tests/
        __init__.py
        tests.py
Run Code Online (Sandbox Code Playgroud)

我正在使用PyCharm社区版和Anaconda python发行版.

该文件:ptouch.py包含以下代码:

__author__ = 'foo'
import pandas as pd
df = pd.DataFrame()
Run Code Online (Sandbox Code Playgroud)

执行此文件会出现以下错误:

C:\Anaconda\python.exe ~/ptouch.py
Traceback (most recent call last):
  File "~/ptouch.py", line 2, in <module>
    import pandas as pd
File "C:\Anaconda\lib\site-packages\pandas\__init__.py", line 13, in <module>
  "extensions first.".format(module))
ImportError: C extension: StringIO not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext --inplace' to build the C …
Run Code Online (Sandbox Code Playgroud)

python pycharm python-2.7 pandas

4
推荐指数
1
解决办法
1106
查看次数

标签 统计

pandas ×1

pycharm ×1

python ×1

python-2.7 ×1