我试图使用Wine将Linux平台上的Python脚本交叉编译成Windows可执行文件。我已经成功地在Wine环境中安装了python3.6.0forwindows64位和pyinstaller,以及程序的所有Python依赖项。在
运行wine py my_file.py可以正确运行我的程序,而不会引发任何错误。但是,尝试运行使用pyinstaller生成的交叉编译的.exe时,出现以下错误:File "site-packages\pandas\__init__.py", line 35, in
ImportError: C extension: No module named 'pandas._libs.tslibs.timedeltas' 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.
[275] Failed to execute script parser
我使用git clone https://github.com/pandas-dev/pandas.git将Pandas源代码下载到Winedrive\文件夹中,然后运行wine py setup.py build_ext --inplace --force并收到以下错误:
^{pr2}$
但是,运行wine py -m pip freeze表明我已经安装了这些模块的正确版本:altgraph==0.14
beautifulsoup4==4.6.0
bs4==0.0.1
future==0.16.0
html5lib==0.999999999
lxml==4.1.1
macholib==1.8
numpy==1.13.3
pandas==0.21.0
pefile==2017.11.5
PyInstaller==3.3
pypiwin32==220
python-dateutil==1.5
pytz==2017.3
six==1.11.0
webencodings==0.5.1
我还可以从Python解释器成功导入这些模块:Python 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import dateutil
>>> print(dateutil.__version__)
1.5
>>> import numpy
>>> print(numpy.__version__)
1.13.3
>>>
是什么阻止了我在葡萄酒环境中培育熊猫?在