I want to use PyYaml in my pip project, but am having trouble using it as a dependency. Mainly the problem is thet PyYaml in pip is not a cross platform install.
How do I install pyyaml using pip so that it works. Note, on a current fresh Ubuntu install I get the following error when running pip install pyyaml
Installing collected packages: pyyaml
Running setup.py install for pyyaml
checking if libyaml is compilable
gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -fPIC -I/usr/include/python3.2mu -c build/temp.linux-x86_64-3.2/check_libyaml.c -o build/temp.linux-x86_64-3.2/check_libyaml.o
build/temp.linux-x86_64-3.2/check_libyaml.c:2:18: fatal error: yaml.h: No such file or directory
compilation terminated.
libyaml is not found or a compiler error: forcing --without-libyaml
(if libyaml is installed correctly, you may need to
specify the option --include-dirs or uncomment and
modify the parameter include_dirs in setup.cfg)
Successfully installed pyyaml
Note that the error says "successfully installed" but it is not.
I can not import yaml
I am not looking for answers that say "use apt-get" due to my very first sentence. I need the install to be cross platform and work as a pip dependency I am not simply wondering on how to install it correctly.
If this is not possible, is there any library I can use in replacement?
PyYAML is a YAML parser and emitter for Python.
Download suitable(Python version, 32/64 bit) .exe file from http://pyyaml.org/wiki/PyYAML, then double click it to install PyYAML to your Windows 10 PC following the wizard window. Just double click the .exe file, and flow the guide window, very simple.
Pip is able to install packages configured with their dependencies, because most authors package their code as wheels by default before submitting to PyPI.
You will need some extra packages to build it.
First of all you need to uninstall pyyaml
, or it will complain later that it is already installed
pip uninstall pyyaml
Then install the following packages:
sudo apt-get install libyaml-dev libpython2.7-dev
Finally install it again
pip install pyyaml
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With