elsampsa / valkka-core

Valkka - Create video surveillance, management and analysis programs with PyQt
GNU Lesser General Public License v3.0
186 stars 35 forks source link

Install issue #33

Closed jjehl closed 2 years ago

jjehl commented 2 years ago

Python Path issue

When installing with the PPA, the python path for library is:

/usr/lib/python3/dist-packages/

On my system and I guess I'm not the only one, I use:

/opt/conda/lib/python3.8/site-packages

Do you have a way to change the PATH, like using PYTHONPATH env var because the default python installation is system dependant ?

elsampsa commented 2 years ago

(a) libValkka has (1) python code and (2) C++ code that is compiled and that has dependencies on other (non-python, binary) libraries. Because of the latter, it must be packaged as a debian package, so that (non-python, binary) dependencies (say, opengl and the like) are fulfilled automatically by the packaging system.

(b) And since it is a debian package, it must be installed system-wide, somewhere.

(c) I believe that the standard, system-wide installation path for python packages is /usr/lib/python3/dist-packages, so there it goes (there you can look, under valkka, for the shared library .so object file .. that's the compiled C++ code.. everything else is mostly just a python interface to that)

(Ana)conda is a 3.rd. party system that was created to solve similar problem: python packages might have C(++) extension code that depends on other binary (non-python) libraries.. now everything, all the nasty shared library dependencies & copies of those libraries go somehow under /opt/conda/lib/etc... directories, omitting natively installed shared libraries (please correct me if I'm wrong). Not sure if this is so great an idea, btw.

So the correct way to "fix" this, would actually be to create an official anaconda package for libValkka - someday.

If you want to contribute, you're welcome. :)

Meanwhile, you can use python3 without anaconda or maybe create a link from /usr/lib/python3/dist-packages to /opt/conda/etc.., or use PYTHONPATH as you suggested.

But anyway this is a deep-going problem, especially for a library like libValkka that is NOT a python library, but basically a C++ library that is only interfaced to python. And then that C++ code has dependencies on system libraries that have dependencies on other system libraries that have dependencies.. which are of course much better handled by the debian package/dependency system than with some auxiliary-packaging-system-of-the-day which is Conda.