我有一个非常奇怪的错误,无法解决它.
我有一个具有以下目录结构的项目:
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)