ctypeslib2 gives following error on any anaconda environment whenever installed with pip.
In any conda environment
$ pip install ctypeslib2 clang
$ clang2py Traceback (most recent call last): File "/home/muratbal/anaconda3/envs/gst_env/lib/python3.9/site-packages/clang/cindex.py", line 4173, in get_cindex_library library = cdll.LoadLibrary(self.get_filename()) File "/home/muratbal/anaconda3/envs/gst_env/lib/python3.9/ctypes/init.py", line 460, in LoadLibrary return self._dlltype(name) File "/home/muratbal/anaconda3/envs/gst_env/lib/python3.9/ctypes/init.py", line 382, in init self._handle = _dlopen(self._name, mode) OSError: /home/muratbal/anaconda3/envs/gst_env/lib/clang: cannot read file data: Is a directory
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/muratbal/anaconda3/envs/gst_env/bin/clang2py", line 5, in
I'm not familiar with how anaconda packages libraries. @murat-bal what is your OS ? What is the content of home/muratbal/anaconda3/envs/gst_env/lib/clang ? I'll push a generic fix
@murat-bal would you be able to pip install git+https://github.com/trolldbois/ctypeslib.git to see if the patch I pushed fixes your issue ?
it seems that on your platform, the ctypes.util.find_library returns a library folder path, and not a specific filename.
which is possible as per documentation
https://docs.python.org/3/library/ctypes.html#finding-shared-libraries
@murat-bal would you be able to re-try ?
pip install ctypeslib2 clang==14
or whatever version of clang you are using .