yavide icon indicating copy to clipboard operation
yavide copied to clipboard

Python error

Open ikouchiha47 opened this issue 8 years ago • 17 comments

screenshot from 2016-11-11 21 04 58

  copying lib3/yaml/constructor.py -> build/lib.linux-x86_64-3.4/yaml
  running build_ext
  creating build/temp.linux-x86_64-3.4
  checking if libyaml is compilable
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.4m -c build/temp.linux-x86_64-3.4/check_libyaml.c -o build/temp.linux-x86_64-3.4/check_libyaml.o
  checking if libyaml is linkable
  x86_64-linux-gnu-gcc -pthread build/temp.linux-x86_64-3.4/check_libyaml.o -lyaml -o build/temp.linux-x86_64-3.4/check_libyaml
  building '_yaml' extension
  creating build/temp.linux-x86_64-3.4/ext
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.4m -c ext/_yaml.c -o build/temp.linux-x86_64-3.4/ext/_yaml.o
  ext/_yaml.c:4:20: fatal error: Python.h: No such file or directory
   #include "Python.h"
                      ^
  compilation terminated.
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  
  ----------------------------------------
  Failed building wheel for PyYAML
  Running setup.py clean for PyYAML
Failed to build PyYAML
Installing collected packages: PyYAML, pathtools, watchdog
  Running setup.py install for PyYAML ... error
    Complete output from command /usr/bin/python3.4 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ozg2u4uc/PyYAML/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-j0w6n66s-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.4
    creating build/lib.linux-x86_64-3.4/yaml
    copying lib3/yaml/serializer.py -> build/lib.linux-x86_64-3.4/yaml
    copying lib3/yaml/dumper.py -> build/lib.linux-x86_64-3.4/yaml
    copying lib3/yaml/parser.py -> build/lib.linux-x86_64-3.4/yaml
    copying lib3/yaml/reader.py -> build/lib.linux-x86_64-3.4/yaml
    copying lib3/yaml/emitter.py -> build/lib.linux-x86_64-3.4/yaml
    copying lib3/yaml/nodes.py -> build/lib.linux-x86_64-3.4/yaml
    copying lib3/yaml/cyaml.py -> build/lib.linux-x86_64-3.4/yaml
    copying lib3/yaml/events.py -> build/lib.linux-x86_64-3.4/yaml
    copying lib3/yaml/loader.py -> build/lib.linux-x86_64-3.4/yaml
    copying lib3/yaml/resolver.py -> build/lib.linux-x86_64-3.4/yaml
    copying lib3/yaml/tokens.py -> build/lib.linux-x86_64-3.4/yaml
    copying lib3/yaml/error.py -> build/lib.linux-x86_64-3.4/yaml
    copying lib3/yaml/representer.py -> build/lib.linux-x86_64-3.4/yaml
    copying lib3/yaml/__init__.py -> build/lib.linux-x86_64-3.4/yaml
    copying lib3/yaml/scanner.py -> build/lib.linux-x86_64-3.4/yaml
    copying lib3/yaml/composer.py -> build/lib.linux-x86_64-3.4/yaml
    copying lib3/yaml/constructor.py -> build/lib.linux-x86_64-3.4/yaml
    running build_ext
    creating build/temp.linux-x86_64-3.4
    checking if libyaml is compilable
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.4m -c build/temp.linux-x86_64-3.4/check_libyaml.c -o build/temp.linux-x86_64-3.4/check_libyaml.o
    checking if libyaml is linkable
    x86_64-linux-gnu-gcc -pthread build/temp.linux-x86_64-3.4/check_libyaml.o -lyaml -o build/temp.linux-x86_64-3.4/check_libyaml
    building '_yaml' extension
    creating build/temp.linux-x86_64-3.4/ext
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.4m -c ext/_yaml.c -o build/temp.linux-x86_64-3.4/ext/_yaml.o
    ext/_yaml.c:4:20: fatal error: Python.h: No such file or directory
     #include "Python.h"
                        ^
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1


Command "/usr/bin/python3.4 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ozg2u4uc/PyYAML/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-j0w6n66s-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-ozg2u4uc/PyYAML/

What error is this. debian 8.

ikouchiha47 avatar Nov 11 '16 15:11 ikouchiha47

Please attach the whole log. Something is not right with installing the Python dependencies.

JBakamovic avatar Nov 11 '16 15:11 JBakamovic

ok . I have to do it once again

ikouchiha47 avatar Nov 13 '16 12:11 ikouchiha47

Have you solved this problem? I have the same one.

petermeng avatar Feb 19 '17 06:02 petermeng

It's Python dependency missing. I can't really tell more without more information. I haven't got Debian system running here.

Can you try running apt get install python-dev and let me know if it works out for you? This is dependency which should be installed by the install.sh script but something may have gone wrong.

JBakamovic avatar Feb 19 '17 13:02 JBakamovic

I have install python-dev and also tried to reinstall pip. But it still does not work.

petermeng avatar Feb 20 '17 03:02 petermeng

Can you try installing python3-dev package?

JBakamovic avatar Feb 20 '17 07:02 JBakamovic

Yes, I have install python3-dev. Building dependency tree
Reading state information... Done python3-dev is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

By the way, I tried to install "clang watchdog" manually. But it failed.

#pip2 install "clang watchdog" Invalid requirement: 'clang watchdog' Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 82, in init req = Requirement(req) File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/packaging/requirements.py", line 96, in init requirement_string[e.loc:e.loc + 8])) InvalidRequirement: Invalid requirement, parse error at "'watchdog'"

petermeng avatar Feb 20 '17 08:02 petermeng

Correct syntax should be pip2 install clang watchdog. You have extra "" there.

JBakamovic avatar Feb 20 '17 09:02 JBakamovic

$ pip2 install clang watchdog Requirement already satisfied: clang in /usr/local/lib/python2.7/dist-packages Requirement already satisfied: watchdog in /usr/local/lib/python2.7/dist-packages Requirement already satisfied: PyYAML>=3.10 in /usr/local/lib/python2.7/dist-packages (from watchdog) Requirement already satisfied: argh>=0.24.1 in /usr/local/lib/python2.7/dist-packages (from watchdog) Requirement already satisfied: pathtools>=0.1.1 in /usr/local/lib/python2.7/dist-packages (from watchdog)

I tried it again, and it still does not work.

petermeng avatar Feb 21 '17 01:02 petermeng

In any case I didn't see clang/watchdog failure in the log but only the one related to libyaml-dev. Can you please try running apt-get install libyaml-dev?

JBakamovic avatar Feb 21 '17 08:02 JBakamovic

I have installed libyaml-dev. By the way, is it possilbe that some of libs are very old? sudo apt-get install libyaml-dev [sudo] password for peter: Reading package lists... Done Building dependency tree
Reading state information... Done libyaml-dev is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.

petermeng avatar Feb 22 '17 01:02 petermeng

As far as I understood your implementation works only with a vim version supporting python 2.x, correct? Are there any plans to support vim compiled with '-python +python3'?

Claudius42 avatar Jun 19 '17 06:06 Claudius42

Hm, having python3 support should not break anything as long as there is python2 support compiled in as well. However, using python3 interpreter only would not work as project is python 2.x based. I am not sure I will be porting the code to new Python version. Probably not.

JBakamovic avatar Jun 19 '17 09:06 JBakamovic

That's my problem, my installed vim (8.0.x) only supports python3 and not python 2.x. I use Ubuntu 14.04 LTS due to other requirements. I haven't found any pre-compiled binaries of vim supporting python 2.x and GUI for this target platform. Which vim version do you use and did you get it? Can you provide any link or the parameters for the configure command to build vim from scratch in order to use your great setup?

Claudius42 avatar Jun 19 '17 09:06 Claudius42

First of all, Yavide requires gvim so what you should be really looking is if your gvim has been compiled with python2 support or not. This is a limitation mostly due to the clientserver feature which most distributions do not include in plain vim. There are numerous instructions on the web how to compile vim from the sources but I would advise to have a try with something from this stackoverflow answer. Read the comments as well.

JBakamovic avatar Jun 19 '17 11:06 JBakamovic

I have installed vim.gnome-py2, which has both python and clientserver support. Also, I ran update-alternatives for both vim and gvim.

Is there a way to get Yavide work through vim and not gvim? Right now, the command yavide opens gvim.

yoni206 avatar Jan 27 '18 06:01 yoni206

Is there a way to get Yavide work through vim and not gvim? Right now, the command yavide opens gvim.

As I mentioned it above, vim is not distributed with clientserver support compiled in. If you find one elsewhere or compile vim yourself so it has that feature, with minor fix you should be able to run yavide without any problems. Fix is replacing gvim occurrence with vim here and here.

JBakamovic avatar Jan 27 '18 08:01 JBakamovic