No module named 'clang' in python3

See original GitHub issue

I’ve followed the instructions, and installed the packages ‘clang’ and ‘python-clang-3.4’ (Ubuntu 14.04). But it seems like I’ve missed something because the plugin fails to find ‘clang’ python bindings.

The error I get in Sublime’s console is:

INFO:EasyClangComplete.EasyClangComplete: init completer based on libclang
INFO:EasyClangComplete.plugin.completion.base_complete: Getting version from command: `clang++ --version`
INFO:EasyClangComplete.plugin.completion.base_complete: Found clang version: 3.4
WARNING:EasyClangComplete.plugin.completion.lib_complete: cannot get default cindex with error: No module named 'clang'
WARNING:EasyClangComplete.plugin.completion.lib_complete: using bundled one: EasyClangComplete.clang.cindex34

However, i’m able to import the allegedly missing library manually when executing python interpreter from the terminal. I’m pretty sure it is due to the fact that Sublime runs python3, and the python bindings are installed under /usr/lib/python2.7/dist-packages/clang/… I tried to find an official python3 package for the python bindings without success.

The README file of this plugin states that the python bindings are working fine on Ubuntu, so I’m pretty sure i did something wrong. Can you give me a hand?

Thanks ahead

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
niosuscommented, Jun 6, 2016

It’s the first of it’s kind which i’ve managed to get to work properly.

Yay! I am happy to hear this! This is exactly the reason why I have created it!

Anyway, I guess it is impossible to run the plugin with default python bindings as they are python 2 only (which drives me nuts) while sublime text now uses python 3. The ones I provide have been changed to run with python 3. If they work for many people I may try to push them upstream (but there are already attempts that don’t get much attention)

Regarding the warning message I should probably not even try to find the system installed bindings and just use mine.

I will close this issue for now.

0reactions
niosuscommented, Jun 6, 2016

I have opened another issue #39 to remove the confusing warning and will do it sometime during the week.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix "ModuleNotFoundError: No module named 'clang'"
You must first install the package before you can use it in your code. Run the following command to install the package and...
Read more >
clang-ctags error: ImportError: No module named clang.cindex
clang -ctags is producing the following error
Read more >
ModuleNotFoundError: No module named 'clang'
Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'clang' How to remove the ModuleNotFou.
Read more >
Python3 files installed to /usr/lib/python2.7 - Debian Bug report ...
One test involves python3-clang(-9) as currently found in Debian ... import Index ModuleNotFoundError: No module named 'clang' ``` This is ...
Read more >
clang - PyPI
Project description. This is the python bindings subdir of llvm clang repository. https://github.com/llvm-mirror/clang/tree/master/ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found