python - 在 anaconda 环境中使用 pyinstaller

标签 python conda pyinstaller

我有一个在 python(v 3.6) 上制作的非常简单的应用程序,我想使用 pyinstaller 卡住它。我使用 anaconda 创建的环境制作了该应用程序,并在那里安装了我需要的包(youtube_dl)。我需要有关如何使用我创建的包含所有包的环境为我的应用程序 (Main.py) 使用 pyinstaller 的帮助。 如果我运行“pyinstaller Main.py”,我会收到此错误:

Traceback (most recent call last):
  File "Main.py", line 7, in <module>
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/PyInstaller/loader/pyimod03_importers.py", line 631, in exec_module
    exec(bytecode, module.__dict__)
  File "youtube_downloader.py", line 3, in <module>
ModuleNotFoundError: No module named 'youtube_dl'
[2708] Failed to execute script Main
logout

如何让 pyinstaller 使用我在 anaconda 目录中创建的环境?

最佳答案

我通过发出 anaconda 提示符重新安装了 pyinstaller

conda install -c conda-forge pyinstaller

它对我有用。

关于python - 在 anaconda 环境中使用 pyinstaller,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50411931/

相关文章:

python - 从文本文件python中提取一行

python - 无法使用Python的PyCDC.DrawText()绘制Unicode字符

python - 两个 sqlalchemy 查询返回相同的结果,即使它们具有不同的过滤器

python , conda : ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied: 'd:\\anaconda3\\envs\\python39\\scripts\\pip.exe'

python - 可执行构建闪烁并终止

python - 为更新的 exe 创建一个下载栏

python - AWS ElastiCache 描述 CacheClusters

python - 系统参数无法识别

python - M1 芯片上的 Spyder

Python PyInstaller 和包含图标文件