You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Then if there is a system install of numpy, in /usr/local/lib/python3.7/site-packages/ it will be loaded instead of the AppImage one. You can check this by running:
The reason is that at its init Python thinks it is running from a system install and as so it adds this fixed location to is search path before the AppImage site packages. You can see this by running:
The last item is the AppImage site packages. It is preceded by the fixed /usr/local/lib/python3.7/site-packages/ search path.
Possible solution: remove this /usr/local/lib/python3.7/site-packages/ at Python's init by adding a sitecustomize.py file to the AppImage site packages. For example as here. Note that it might happen that someone explicitly requests this location by adding it to PYTHONPATH. In this case it should not be removed from the search path.
The text was updated successfully, but these errors were encountered:
That's quite new to me. I was pretty sure that conda stuff really is isolated.
Your solution looks somewhat elegant to me, may I just copy that (giving credit, but using this project's license)? I'm pretty confident conda supports putting your own sitecustomize.py somewhere into the prefix.
@TheAssassin : I think that it is a problem in the Python path initialisation itself. It is not meant to operate with a variable install prefix, as we have with the AppImage. Then, Python fails to properly initialise its search path for site packages, and it sets a fallback.
Please feel free to copy / adapt the sitecustomize.py file. I change the whole license to MIT to be consistent with linuxdeploy.
Let say that we generate a conda image with numpy packaged inside, e.g. as:
Then if there is a system install of numpy, in
/usr/local/lib/python3.7/site-packages/
it will be loaded instead of the AppImage one. You can check this by running:The reason is that at its init Python thinks it is running from a system install and as so it adds this fixed location to is search path before the AppImage site packages. You can see this by running:
The last item is the AppImage site packages. It is preceded by the fixed
/usr/local/lib/python3.7/site-packages/
search path.Possible solution: remove this
/usr/local/lib/python3.7/site-packages/
at Python's init by adding asitecustomize.py
file to the AppImage site packages. For example as here. Note that it might happen that someone explicitly requests this location by adding it to PYTHONPATH. In this case it should not be removed from the search path.The text was updated successfully, but these errors were encountered: