Python venv on top of conda base #8302
Unanswered
dennisvang
asked this question in
Help
Replies: 1 comment 3 replies
-
Considering that the error is raised in # program.py
import pkg_resources
print("hello") in a venv created under base miniconda environment (and considering python version is 3.11.5, that's the latest Miniconda installer/release), with just PyInstaller installed in it? Can you confirm that? FWIW, it seems to work if I try it with the following steps:
|
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
On a Windows 10 system I use (mini)conda to manage multiple Python versions (exclusively).
Miniconda is installed per-user, so it's located in
AppData\Local\Programs
.Now I've got a project that requires a local
venv
(for a specific reason). This venv is created usingpython -m venv venv
from a terminal where the condabase
environment has been activated.Pyinstaller is only installed in the
venv
. The condabase
environment only has python (and some default packages installed by conda).With both the conda
base
env and thevenv
activated, the project runs normally, from source.However, an executable created using
pyinstaller.exe my-app.spec --clean --onedir
fails with import errors similar to #2084, #6564, #6565.Specifically, I'm seeing:
However,
platformdirs
is available invenv/Lib/site-packages/pkg_resources/_vendor
.The following warning arises multiple times when building:
Here's the pyvenv.cfg:
If I install all the required packages in a separate
conda
environment, i.e. without the extra pythonvenv
, the pyinstaller bundle does work as expected.Is there some way to work around this issue?
Beta Was this translation helpful? Give feedback.
All reactions