我使用pyqt5和几个软件包(例如matplotlib,rasterio,geopandas等)做了一个python 3.7项目。我必须将该项目与Windows和Linux可执行文件一起打包,并且我正在使用pyinstaller来完成这项工作。这是项目的结构
run.py
USLE
| home.py
| inicio.py
| __init__.py
|
+---controllers
| a_controller.py
| c_controller.py
| k_controller.py
| ls_controller.py
| p_controller.py
| r_controller.py
| s_controller.py
| __init__.py
|
+---gui
| home_ui.py
| icons_rc.py
| inicio_ui.py
| __init__.py
|
\---models
a_tab.py
c_tab.py
k_tab.py
r_tab.py
start_tab.py
__init__.py
首先,我遇到了打包rasterio的问题,因为pyinstaller在对作为项目输入文件的run.py文件进行分析并使用并调整了该问题的答案时无法识别该软件包{ {3}}我可以解决raterio打包问题,但是,在执行pyinstaller生成的.exe时,现在会抛出此错误
File "usle\models\k_tab.py", line 2, in <module>
File "C:\Users\david\Anaconda3\envs\car-usle\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 627, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\geopandas\__init__.py", line 1, in <module>
File "C:\Users\david\Anaconda3\envs\car-usle\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 627, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\geopandas\geoseries.py", line 11, in <module>
File "C:\Users\david\Anaconda3\envs\car-usle\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 627, in exec_module
exec(bytecode, module.__dict__)
File "site-packages\pyproj\__init__.py", line 70, in <module>
File "pyproj/_datadir.pyx", line 6, in init pyproj._datadir
ModuleNotFoundError: No module named 'pyproj.datadir'
[9368] Failed to execute script run
有人有什么建议吗?