-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sys.prefix
should not be used to discover non-dev data directories?
#1320
Comments
No. This works perfectly (I'm running it right now and I wouldn't have pushed it if it didn't work). Tested both running from source and installed, Arch and Ubuntu. How could this only work in a virtual environment when Ulauncher doesn't run in a virtual environment? The documentation says the Unix default is /usr/local for non-virtual environments, but for Arch and Ubuntu it's just It may be wrong to use sys.prefix here for Nix and/or other OSes though. Both me or the original maintainer have been learning how to handle these things as needed and by trial and error. |
Makes sense. It assumes The more I think about it the more it seems to be something Nix-specific due to separation of the Python interpreter and per-application packages. |
Those 2 code pieces seem to be responsible: |
Yeah, I think the assumptions we have works for traditional package managers where you can only have one version installed of each package. But seemingly not for Nix, and likely not for flatpak (which we should try to support at some point in time). Maybe you can set the ULAUNCHER_DATA_DIR variable exteranally as a workaround? Or if you need something else, let me know. |
- adds explicit ULAUNCHER_DATA_DIR to solve Ulauncher#1320 - fix No module named 'gi' in extensions, related to Ulauncher#1306
- adds explicit ULAUNCHER_DATA_DIR to solve Ulauncher#1320 - fix No module named 'gi' in extensions, related to Ulauncher#1306
- adds explicit ULAUNCHER_DATA_DIR to solve Ulauncher#1320 - fix No module named 'gi' in extensions, related to Ulauncher#1306
- adds explicit ULAUNCHER_DATA_DIR to solve Ulauncher#1320 - fix No module named 'gi' in extensions, related to Ulauncher#1306
Environment
NixOS
Bug description
When packaging ulauncher for Nix (#1307) I noticed it tried to read web app files from within Python installation's directory so I patched it
{sys.prefix}
->$out
.Today I started digging into issue and seems like this is a proper behavior according to Python docs:
This means
sys.prefix
does what you want it to do only inside the virtualenv itself (in a development environment?) while:ULAUNCHER_DATA_DIR
is set up only for development (where it seems not to be needed)ULAUNCHER_DATA_DIR
is missing, which has no chance of workingLog output
No response
Communication guidelines
Not an extension issue
Ulauncher v6
The text was updated successfully, but these errors were encountered: