我制作了一个流线型应用程序作为预测程序的前端,然后我创建了一个 pyinstaller 可执行文件来运行该应用程序。当我运行可执行文件时出现问题,我收到以下错误:pkg_resources.DistributionNotFound: The 'streamlit' distribution was not found and is required by the application
使用此回溯:
Traceback (most recent call last):
File "main.py", line 8, in <module>
File "<frozen importlib._bootstrap>", line 968, in _find_and_load
File "<frozen importlib._bootstrap>", line 957, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
File "/opt/anaconda3/envs/Python35/lib/python3.5/site-packages/PyInstaller/loader/pyimod03_importers.py", line 623, in exec_module
exec(bytecode, module.__dict__)
File "site-packages/streamlit/__init__.py", line 75, in <module>
File "site-packages/pkg_resources/__init__.py", line 476, in get_distribution
File "site-packages/pkg_resources/__init__.py", line 352, in get_provider
File "site-packages/pkg_resources/__init__.py", line 895, in require
File "site-packages/pkg_resources/__init__.py", line 781, in resolve
pkg_resources.DistributionNotFound: The 'streamlit' distribution was not found and is required by the application
[48095] Failed to execute script main
该文件是使用以下命令创建的:pyinstaller --onefile -w main.py
这是在 Conda 环境中使用 python 3.5.6 在 macOS Catalina 上设置的
如果有任何我可能遗漏的细节可以对此有所帮助,请告诉我。