Replies: 4 comments 3 replies
-
If the file can be imported by Python, then it should be shown as not missing in Pylance. I think it would make sense to file an issue with your repro and logs to show what the problem is. We won't get info out of the compiled code, but we should be able to know that the import will succeed. |
Beta Was this translation helpful? Give feedback.
-
Compiled modules typically have platform-specific file extensions. For example, Linux and Mac us ".so" and Windows uses ".pyd". Pylance looks for these binary files when it resolves an import. When you install the blender library, do you see a file with the name |
Beta Was this translation helpful? Give feedback.
-
I'm just guessing here, but could it be that Blender embeds Python and makes these modules available as builtin modules? That would mean they cannot be imported when you execute the extension code in the Python executable -- they would only work when it's imported by the special embedded Python interpreter used by Blender to run extensions. |
Beta Was this translation helpful? Give feedback.
-
It seems Blender is open source, so you should be able to find how it is built in its source code. |
Beta Was this translation helpful? Give feedback.
-
Hello,
I'm developing a Blender add-on. Blender has built-in python modules (such as gpu or bgl) that are written in C. When trying to import those, pylance complains with Pylance(reportMissingImports).
Is there a way to deal wit h this/fix it?
For example, pylint has: https://pylint.pycqa.org/en/latest/technical_reference/c_extensions.html
Beta Was this translation helpful? Give feedback.
All reactions