在anaconda环境中使用pyinstaller [英] Using pyinstaller with anaconda environment
问题描述
我有一个非常简单的应用程序,它是使用 python(v 3.6)
制作的,我想使用pyinstaller冻结它。 ,我在那里安装了所需的软件包(youtube_dl)。我需要有关如何使用在其内部包含所有软件包的环境创建的应用程序(Main.py)使用pyinstaller的帮助。
如果我运行 pyinstaller Main.py,则会出现此错误:
I have a very simple application made on python(v 3.6)
, and I wanted to freeze it using pyinstaller.I have made the app using an environment created with anaconda, and I installed there the packages I needed(youtube_dl). I need help on how to use pyinstaller for my app(Main.py) using the environment I created with all its packages inside it.
If I run "pyinstaller Main.py" I get this error:
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的目录中创建的环境?
How can I make pyinstaller use the environment I created at anaconda´s directory?
推荐答案
外观就像您在anaconda环境中安装了 youtube_dl
,并且在anaconda环境之外运行pyinstaller一样,它找不到所需的模块。您是否尝试过在 pyinstaller Main.py
之前先进行 pip安装youtube_dl
?
Looks like you installed the youtube_dl
in the anaconda environment and you are running the pyinstaller outside the anaconda environment and it can't find the needed module. Did you try just doing pip install youtube_dl
before pyinstaller Main.py
?
这篇关于在anaconda环境中使用pyinstaller的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!