ImportError:C扩展名:没有名为tslib的模块。。。。如果运行使用PyIns生成的.exe文件,则显示错误

2024-03-29 07:30:07 发布

您现在位置:Python中文网/ 问答频道 /正文

我写了一些使用熊猫的代码。当我从命令提示符执行它时,它工作得很好。但当我将其作为.exe文件并尝试从命令提示符下运行它时,它得到如下错误:

Traceback (most recent call last):
  File "Result_generator.py", line 2, in <module>
  File "c:\users\akhil\appdata\local\temp\pip-build-rccgn1\pyinstaller\PyInstaller\loader\pyimod03_importers.py", line 396, in load_module
  File "result_test.py", line 3, in <module>
  File "c:\users\akhil\appdata\local\temp\pip-build-rccgn1\pyinstaller\PyInstaller\loader\pyimod03_importers.py", line 396, in load_module
  File "site-packages\pandas\__init__.py", line 35, in <module>
ImportError: C extension: No module named tslib not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext --inplace --force' to build the C extensions first.
[12340] Failed to execute script Result_generator

我也安装了tslib包。但没用。我做错什么了?请帮我拿这个。提前谢谢。在

疑问:在错误语句中,它表示运行“python设置.py…”命令。但我没找到设置.py文件在pandas目录中。有什么解决办法?在


Tags: 文件toinpybuildpandas错误line