You are not logged in.

#1 2017-05-02 15:06:40

TJM
Member
Registered: 2016-09-18
Posts: 118

YCM can run as it installed from AUR

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

#2 2017-05-02 15:23:54

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,891

Re: YCM can run as it installed from AUR

2017-05-02 07:52:37,909 - ERROR - ycm_core library compiled for Python 2 but loaded in Python 3
grep -r '/usr/bin/python' /usr/share/vim/vimfiles/third_party/ycmd

Ensure the shebangs in all files (if any present) say "#!/usr/bin/python2" and *not* "#!/usr/bin/python"

Offline

#3 2017-05-02 19:22:24

TJM
Member
Registered: 2016-09-18
Posts: 118

Re: YCM can run as it installed from AUR

seth wrote:
2017-05-02 07:52:37,909 - ERROR - ycm_core library compiled for Python 2 but loaded in Python 3
grep -r '/usr/bin/python' /usr/share/vim/vimfiles/third_party/ycmd

Ensure 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/ycmd

And 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/python

However,

[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/python3

Offline

#4 2017-05-02 19:46:26

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,891

Re: YCM can run as it installed from AUR

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

Board footer

Powered by FluxBB