Skip to content
This repository has been archived by the owner on Jan 5, 2023. It is now read-only.

Python error #54

Open
ikouchiha47 opened this issue Nov 11, 2016 · 17 comments
Open

Python error #54

ikouchiha47 opened this issue Nov 11, 2016 · 17 comments

Comments

@ikouchiha47
Copy link

ikouchiha47 commented Nov 11, 2016

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.

@JBakamovic
Copy link
Owner

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

@ikouchiha47
Copy link
Author

ok . I have to do it once again

@petermeng
Copy link

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

@JBakamovic
Copy link
Owner

JBakamovic commented Feb 19, 2017

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.

@petermeng
Copy link

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

@JBakamovic
Copy link
Owner

Can you try installing python3-dev package?

@petermeng
Copy link

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'"

@JBakamovic
Copy link
Owner

JBakamovic commented Feb 20, 2017

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

@petermeng
Copy link

petermeng commented Feb 21, 2017

$ 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.

@JBakamovic
Copy link
Owner

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?

@petermeng
Copy link

petermeng commented Feb 22, 2017

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.

@Claudius42
Copy link

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'?

@JBakamovic
Copy link
Owner

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.

@Claudius42
Copy link

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?

@JBakamovic
Copy link
Owner

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.

@yoni206
Copy link

yoni206 commented Jan 27, 2018

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.

@JBakamovic
Copy link
Owner

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants