sighingnow / libclang

(Unofficial) Release libclang (clang.cindex) on pypi.
https://pypi.org/project/libclang
Other
81 stars 21 forks source link

libclang does not seem to be bundled when installing the package? #8

Closed mrakh closed 3 years ago

mrakh commented 3 years ago

Your package claims that

To make the libclang available without install the LLVM toolkits, this package provides bundled static-linked libclang shared library for different platforms, which, should work well on OSX, Windows, as well as usual Linux distributions.

However, downloading it with pip install clang and trying it out immediately yields the error I put in the title of this issue. This is all I am running:

docker run --rm debian:buster bash -c 'apt-get update && apt-get install --no-install-recommends -y python3 python3-pip && pip3 install clang && python3 -c "import clang.cindex; index = clang.cindex.Index.create()"'
# clang.cindex.LibclangError: libclang-11.so: cannot open shared object file: No such file or directory. To provide a path to libclang use Config.set_library_path() or Config.set_library_file().

I did some digging to find out why I was getting this error, and it seems like the PyPI package doesn't contain or install the libclang shared object at all?

sighingnow commented 3 years ago

Hi @mrakh,

Thanks for your attention on this project.

The library is released on pypi as libclang, rather than clang. The package clang is another package which doesn't bundle the shared library. We are seeking chances for collobration.

So, just pip uninstall clang then pip install libclang you will be working with this library.

sighingnow commented 3 years ago

Sorry that I just realized I was typing pip install clang in README.

The issue has been fixed :)