« first day (2310 days earlier)      last day (1268 days later) » 

13:16
Hey, if I need to specify where a python module will look for a custom shared library object, what environment variable do I change ? I tried LD_LIBRARY_PATH and its not working. This is under linux.
By "custom shared library object", do you mean another compiled/python library or some dependency for compiled code?
i compiled a c library that generates its own python bindings, updating pythpath finds the module but the module loads and complains it cant find the .so file
13:37
Problems like these are why I can never manage to make a project that isn't one flat directory
I've only recently started making "resources" and "documents" folders because I can use them without being at the mercy of the module search path. But even that has caused me a little aggravation
how is the Python code attempting to load the library? What works depends on whether you are using Cython, ctypes, or something else (and then sometimes on how exactly you are using them)
(not a C person; coming from the other direction the question I suppose is what you are using to provide Python bindings, but the fundamental question is the same)
its using the importlib, the error is being thrown by a call to what looks like a native lib I can't debug in the python ide, call frozen-importlib using a module called 'bootstrap' and a method called _gcd_import
thats what it resolves to and where the error is being thrown
the top level method is import_lib.import_module
sort of. its a swig wrapper, and for some reason inside the module name 'gdal' its calling import with '_gdal'... now inside the package directory there is a file named '_gdal.cpython-39-x86_64-linux-gnu.so'
since I can't step into the _bootstrap thingamajig since thats probably where the code turns native, I can't figure out wtf its doing and how that '_gdal' turns into libgdal.so.28
which is what it is saying it can't find
so i'm kind of blind here, I don't know what environment variable to tweak to make sure it knows where to find that library, which has been installed in a custom directory. with c++ its simple I just change the pkgconfig and ld paths
13:56
Well, there's always the forbidden art of adding whatever directories you want to sys.path
yeah you mean to update pythonpath ? yeah thats what I already did otherwise it wouldnt't find the module :P
can we skip ahead to the point where the help was provided instead of chatting with bots lol
I have a feeling I just bit the bullet and retreated back to c# on windows or c++ on linux lol
There's definitely a paragraph in the documentation that explains exactly where import looks for modules, but it has escaped my grasp at the moment
its not modules :P
its a shared library the module is loading somehow
this is throwing an importerror and it finds the python module just find lol
read LOL
why won't it read LOL
whats happening is the MODULE is loaded, and tries to load ANOTHER module, which then somehow tries to load a SHARED OBJECT (.so) FILE which is a COMPILED C/C++ LIBRARY
and THAT is where its throwing the error
14:04
Ok got it
A shared object is also a module. Python can import it.
Now please stop acting like you know better than the people who're trying to help you.
yes but making the distinction because in python I can't find where that .so file is actually being loaded explicitly
i can't browse through the code to that point snarky bot
Aaand that's a block.
FWIW I'm the most sleep deprived that I've been all year, so pardon me if I miss the finer details
kevin no no
kevin i'm just getting frustrated because this should be documented more explicitly
since what, tons of python modules are written wrapping native code it would seem ?
14:06
Then again even when I'm awake I tend to meander towards the solution along a circuitous path only I can see
So gosh dang whimsical
kevin :P
anyway whats with the cython modules in the same directory beginning with '_gdal' ? thats the name being passed to the import statement INSIDE the module I import which is 'gdal', the only thing that looks like that in the package is file named '_gdal.cpython-39-x86_64-linux-gnu.so'
i'm guessing this gets loaded and then what we'd call a side-by-side error occurs as the final error resolves to the PROPER shared object file libgdal.so.28
I should try to learn what .so files actually are, one of these days
:P I'm starting to think maybe i should look at how swig functions myself lol
kevin: did I mention I know you're joking ? :P
kevin, so anyway I'm a complete python noob but it was indicated to me that cython is python code that has been backended to c and compiled correct ?
More or less. I believe Cython has a somewhat more restricted syntax, but on average it's very Pythonlike
andras deak: been encountering that alot where it feels like we're all just recreating the same content already like this already happened
which it has
kevin: so anyway, would it default like that ? if the only submodule of the package namespace was a cython lib in the same directory ?
14:27
52 messages moved from Python
Andras Desk I have reported you to stack
have a nice day
Say it isn't so :'(
3 messages moved from Python
1 message moved from Python

« first day (2310 days earlier)      last day (1268 days later) »