-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation not explicit on dependency on "libclang-dev", not having it results in "'NoneType' object has no attribute 'encode'" #4
Comments
Ok I have just tested with the sample file and still get an error https://github.com/pybind/pybind11_mkdoc/blob/master/tests/sample_header_docs/sample_header.h. The error is the same, is this something to do with my environment? |
Was able to replicate in docker image:
I also tested with branch v2.6 and seems to cause the same issue even with sample file. It seems that this error tends to happen when particular libraries are not found numba/llvmlite#537, but a guess from the cmake python lib similar issue. Are there any particular libraries that this depends on? |
Looking at the code it seems to fail when trying to find libclang, so installed |
The 'NoneType' object has no attribute 'encode' issue comes from these lines here. If you have an empty or incompletely installed llvm / clang then you get an The stdlib.h issue I am yet to fix completely. Though I was able to fix this temporarily by changing the |
oh wow @matthewhagraphcore that worked... why? |
I believe it occurs due to multiple gcc versions, some of which may be incorrectly installed. The #include_next directive will try and look for the next stdlib.h file, but can't find it (possibly it's looking for a newer version which isn't there, not sure). Changing this to #include forces it to look in the same folder where we know the stdlib.h file is present. Maybe removing all gcc installs and reinstalling might fix it, but I am on a shared server so was unwilling to try. |
@matthewhagraphcore thank you for the explanation. I see, that would make sense. I completely agree that requiring configuring the gcc setup is not really something reasonable even on a personal computer. Hopefully the issue that you raised results in the package being updated to support multiple versions of gcc. I will change the title of this issue to focus primarily on outlining that the "libcmake-dev" dependency not being made explicit in the setup seciton of the readme. |
Now I'm confused - why does |
Oh my bad, I meant libclang-dev not libcmake pybind11_mkdoc/pybind11_mkdoc/mkdoc_lib.py Line 268 in 0103839
|
I just had the same problem using some My idea is to add an extra Macro which is only defined when running #ifndef PYBIND11_MKDOC_EXTRACT_DOCSTRING
#include <iostream>
#endif
/**
* Some docstring
*/
class ExampleClass {}; running with the following flag: python3 -m pybind11_mkdoc -DPYBIND11_MKDOC_EXTRACT_DOCSTRING -o ${DOCSTRING_FILE} ${FILES} |
Documentation not explicit on dependency on "libcmake-dev", not having it results in "'NoneType' object has no attribute 'encode'".
Tested on master, on this file: https://github.com/EthicalML/vulkan-kompute/blob/master/single_include/kompute/Kompute.hpp
I also tried on a simpler file (https://github.com/EthicalML/vulkan-kompute/blob/master/src/include/kompute/Manager.hpp) but still get the same error:
Is this due to my environment? I'm testing in Ubuntu 18, Python3. Happy to provide further details.
The text was updated successfully, but these errors were encountered: