You are not logged in.
Pages: 1
Hi there,
I have installed YCM from this repo with C# disabled.
However, YCM cant run as following error occured:
2017-05-02 07:52:37,906 - ERROR - Error occurred while loading global extra conf /usr/share/vim/vimfiles/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py
Traceback (most recent call last):
File "/usr/share/vim/vimfiles/third_party/ycmd/ycmd/../ycmd/extra_conf_store.py", line 94, in _CallGlobalExtraConfMethod
module = Load( global_ycm_extra_conf, force = True )
File "/usr/share/vim/vimfiles/third_party/ycmd/ycmd/../ycmd/extra_conf_store.py", line 173, in Load
module = LoadPythonSource( _RandomName(), module_file )
File "/usr/share/vim/vimfiles/third_party/ycmd/ycmd/../ycmd/utils.py", line 402, in LoadPythonSource
return importlib.machinery.SourceFileLoader( name, pathname ).load_module()
File "<frozen importlib._bootstrap_external>", line 399, in _check_name_wrapper
File "<frozen importlib._bootstrap_external>", line 823, in load_module
File "<frozen importlib._bootstrap_external>", line 682, in load_module
File "<frozen importlib._bootstrap>", line 251, in _load_module_shim
File "<frozen importlib._bootstrap>", line 675, in _load
File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
File "/usr/share/vim/vimfiles/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py", line 32, in <module>
import ycm_core
ImportError: dynamic module does not define module export function (PyInit_ycm_core)
2017-05-02 07:52:37,909 - ERROR - ycm_core library compiled for Python 2 but loaded in Python 3.
Traceback (most recent call last):
File "/usr/share/vim/vimfiles/third_party/ycmd/ycmd/server_utils.py", line 95, in CompatibleWithCurrentCore
ycm_core = ImportCore()
File "/usr/share/vim/vimfiles/third_party/ycmd/ycmd/server_utils.py", line 87, in ImportCore
import ycm_core as ycm_core
ImportError: dynamic module does not define module export function (PyInit_ycm_core)As I'm not familiar with this situation, does anyone have any ideas on how to fix it?
Thank you
Offline
2017-05-02 07:52:37,909 - ERROR - ycm_core library compiled for Python 2 but loaded in Python 3grep -r '/usr/bin/python' /usr/share/vim/vimfiles/third_party/ycmdEnsure the shebangs in all files (if any present) say "#!/usr/bin/python2" and *not* "#!/usr/bin/python"
Offline
2017-05-02 07:52:37,909 - ERROR - ycm_core library compiled for Python 2 but loaded in Python 3grep -r '/usr/bin/python' /usr/share/vim/vimfiles/third_party/ycmdEnsure the shebangs in all files (if any present) say "#!/usr/bin/python2" and *not* "#!/usr/bin/python"
Thank you for your help.
I have tried to run
grep -Er '^[[:space:]]*\#!/usr/bin/python$' /usr/share/vim/vimfiles/third_party/ycmdAnd it returns
/usr/share/vim/vimfiles/third_party/ycmd/third_party/JediHTTP/vendor/jedi/test/test_evaluate/buildout_project/bin/app:#!/usr/bin/python
/usr/share/vim/vimfiles/third_party/ycmd/third_party/JediHTTP/vendor/jedi/test/test_evaluate/test_buildout_detection.py: #!/usr/bin/pythonHowever,
[tjm@ArchPad tmp]$ cat /usr/share/vim/vimfiles/third_party/ycmd/third_party/JediHTTP/vendor/jedi/test/test_evaluate/buildout_project/bin/app
#!/usr/bin/python
import sys
sys.path[0:0] = [
'/usr/lib/python3.4/site-packages',
'/tmp/.buildout/eggs/important_package.egg'
]
import important_package
if __name__ == '__main__':
sys.exit(important_package.main())
[tjm@ArchPad tmp]$ cat -b /usr/share/vim/vimfiles/third_party/ycmd/third_party/JediHTTP/vendor/jedi/test/test_evaluate/test_buildout_detection.py |grep -E -B 3 -A 5 '#!/usr/bin/python'
54 def test_path_from_sys_path_assignment():
55 SRC = dedent(u("""
56 #!/usr/bin/python
57 import sys
58 sys.path[0:0] = [
59 '/usr/lib/python3.4/site-packages',
60 '/home/test/.buildout/eggs/important_package.egg'It seems that there are only /usr/share/vim/vimfiles/third_party/ycmd/third_party/JediHTTP/vendor/jedi/test/test_evaluate/buildout_project/bin/app that does not strict itself to python2, but its code seems like working for python3.
And here comes the full result of grep -r '/usr/bin/python' /usr/share/vim/vimfiles/third_party/ycmd
[tjm@ArchPad tmp]$ grep -r '/usr/bin/python' /usr/share/vim/vimfiles/third_party/ycmd
/usr/share/vim/vimfiles/third_party/ycmd/cpp/ycm/tests/gmock/gtest/xcode/gtest.xcodeproj/project.pbxproj: shellScript = "# Remember, this \"Run Script\" build phase will be executed from $SRCROOT\n/usr/bin/python Scripts/versiongenerate.py ../ $PROJECT_TEMP_DIR";
/usr/share/vim/vimfiles/third_party/ycmd/third_party/JediHTTP/vendor/jedi/test/test_evaluate/buildout_project/bin/app:#!/usr/bin/python
/usr/share/vim/vimfiles/third_party/ycmd/third_party/JediHTTP/vendor/jedi/test/test_evaluate/test_buildout_detection.py: #!/usr/bin/python
/usr/share/vim/vimfiles/third_party/ycmd/third_party/python-future/tests/test_future/test_futurize.py: u"#!/usr/bin/python2\n",
/usr/share/vim/vimfiles/third_party/ycmd/third_party/python-future/tests/test_future/test_futurize.py: u"#! /usr/bin/python3\n",
/usr/share/vim/vimfiles/third_party/ycmd/third_party/python-future/src/libfuturize/fixer_util.py: #!/usr/bin/python3Offline
Ok?
I guess /usr/share/vim/vimfiles/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py is called by vim and is called by either "py3", "python3" or "pyx" resp. "pythonx" where for the latter the "pyxversion" variable is set to 3 or 0 and in the last case there's a py3 call before.
Afaik one cannot mix python2 & python3 modules in vim so either there might be a conflict *in* this package or *with* another package you might have installed.
grummelbrummelgrummelih8pythongrummelbrummelgrummel...
Offline
Pages: 1