udon2 / udon2 Goto Github PK
View Code? Open in Web Editor NEWA package for manipulating Universal Dependencies trees
Home Page: https://udon2.github.io/
License: MIT License
A package for manipulating Universal Dependencies trees
Home Page: https://udon2.github.io/
License: MIT License
Describe the bug
I am trying (but failing) to install udon2 via pip.
To Reproduce
I tried running
pip install udon2
This fails with a metadata-generation-failed
Defaulting to user installation because normal site-packages is not writeable
Collecting udon2
Using cached udon2-0.1.0.tar.gz (45 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [8 lines of output]
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/tmp/pip-install-z_iz0t73/udon2_ef5a35f34543433fb466908e16db2def/setup.py", line 11, in <module>
BOOST_DIR = os.environ['BOOST_DIR']
File "/usr/lib/python3.10/os.py", line 680, in __getitem__
raise KeyError(key) from None
KeyError: 'BOOST_DIR'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
After taking a look at the docs, I tried to install Boost from my package manager and set LIB_BOOST
accordingly, only to get a legacy-install-failure
:
In file included from udon2_cpp_src/Importer.cpp:5:
udon2_cpp_src/Importer.h:9:10: fatal error: boost/python/list.hpp: No such file or directory
9 | #include <boost/python/list.hpp>
| ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
error: command '/usr/bin/gcc' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for udon2
Running setup.py clean for udon2
Failed to build udon2
Installing collected packages: udon2
Running setup.py install for udon2 ... error
error: subprocess-exited-with-error
× Running setup.py install for udon2 did not run successfully.
│ exit code: 1
╰─> [47 lines of output]
running install
/home/harisont/.local/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_py
creating build
creating build/lib.linux-x86_64-cpython-310
creating build/lib.linux-x86_64-cpython-310/udon2
copying src/udon2/__init__.py -> build/lib.linux-x86_64-cpython-310/udon2
creating build/lib.linux-x86_64-cpython-310/udon2/visual
copying src/udon2/visual/utils.py -> build/lib.linux-x86_64-cpython-310/udon2/visual
copying src/udon2/visual/templates.py -> build/lib.linux-x86_64-cpython-310/udon2/visual
copying src/udon2/visual/render.py -> build/lib.linux-x86_64-cpython-310/udon2/visual
copying src/udon2/visual/__init__.py -> build/lib.linux-x86_64-cpython-310/udon2/visual
running build_ext
building 'udon2.core' extension
creating build/temp.linux-x86_64-cpython-310
creating build/temp.linux-x86_64-cpython-310/udon2_cpp_src
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -ffat-lto-objects -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -fPIC -I/usr/include/python3.10 -I/var/lib/pacman/local/boost-python2-1.78.0-1/include -I/usr/include/python3.10 -c udon2_cpp_src/ConllReader.cpp -o build/temp.linux-x86_64-cpython-310/udon2_cpp_src/ConllReader.o
In file included from udon2_cpp_src/ConllReader.h:12,
from udon2_cpp_src/ConllReader.cpp:5:
udon2_cpp_src/Node.h:211:44: warning: ‘template<class _Arg, class _Result> struct std::unary_function’ is deprecated [-Wdeprecated-declarations]
211 | struct compare_to_node_by_id : public std::unary_function<Node *, bool> {
| ^~~~~~~~~~~~~~
In file included from /usr/include/c++/12.2.0/string:48,
from udon2_cpp_src/ConllReader.h:8:
/usr/include/c++/12.2.0/bits/stl_function.h:117:12: note: declared here
117 | struct unary_function
| ^~~~~~~~~~~~~~
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -ffat-lto-objects -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -fPIC -I/usr/include/python3.10 -I/var/lib/pacman/local/boost-python2-1.78.0-1/include -I/usr/include/python3.10 -c udon2_cpp_src/ConllWriter.cpp -o build/temp.linux-x86_64-cpython-310/udon2_cpp_src/ConllWriter.o
In file included from udon2_cpp_src/ConllWriter.h:10,
from udon2_cpp_src/ConllWriter.cpp:5:
udon2_cpp_src/Node.h:211:44: warning: ‘template<class _Arg, class _Result> struct std::unary_function’ is deprecated [-Wdeprecated-declarations]
211 | struct compare_to_node_by_id : public std::unary_function<Node *, bool> {
| ^~~~~~~~~~~~~~
In file included from /usr/include/c++/12.2.0/string:48,
from udon2_cpp_src/ConllWriter.h:8:
/usr/include/c++/12.2.0/bits/stl_function.h:117:12: note: declared here
117 | struct unary_function
| ^~~~~~~~~~~~~~
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -ffat-lto-objects -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -fPIC -I/usr/include/python3.10 -I/var/lib/pacman/local/boost-python2-1.78.0-1/include -I/usr/include/python3.10 -c udon2_cpp_src/Importer.cpp -o build/temp.linux-x86_64-cpython-310/udon2_cpp_src/Importer.o
In file included from udon2_cpp_src/Importer.cpp:5:
udon2_cpp_src/Importer.h:9:10: fatal error: boost/python/list.hpp: No such file or directory
9 | #include <boost/python/list.hpp>
| ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
error: command '/usr/bin/gcc' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> udon2
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
Expected behavior
Successful installation of udon2.
Environment specs (please complete the following information):
Describe the bug
I followed the documentation (https://udon2.github.io/basic/) and tried to parse a simple conllu file (see example below from https://github.com/EmilStenstrom/conllu/blob/master/README.md) using the IDLE Shell 3.8.10:
import udon2
# assumes that you have a file named 'test.conllu' with a valid CoNLL-U format
roots = udon2.ConllReader.read_file('test.conllu')
It didn't work. Instead, it caused a crash of the shell:
================================ RESTART: Shell ================================
>>>
The follwing error was reported:
Failed to split a line of the CONLL-U format: Resource temporarily unavailable
To Reproduce
1 The the DET DT Definite=Def|PronType=Art 4 det _ _
2 quick quick ADJ JJ Degree=Pos 4 amod _ _
3 brown brown ADJ JJ Degree=Pos 4 amod _ _
4 fox fox NOUN NN Number=Sing 5 nsubj _ _
5 jumps jump VERB VBZ Mood=Ind|Number=Sing|Person=3|Tense=Pres|VerbForm=Fin 0 root _ _
6 over over ADP IN _ 9 case _ _
7 the the DET DT Definite=Def|PronType=Art 9 det _ _
8 lazy lazy ADJ JJ Degree=Pos 9 amod _ _
9 dog dog NOUN NN Number=Sing 5 nmod _ SpaceAfter=No
10 . . PUNCT . _ 5 punct _ _
Expected behavior
The code above should work according to the documentation: https://udon2.github.io/basic/
Screenshots
If applicable, add screenshots to help explain your problem.
Environment specs (please complete the following information):
Additional context
provide some example about classification and clustering.
As kelp do:
https://github.com/SAG-KeLP/kelp-full
Describe the bug
Error: TypeError: write() argument must be str, not None
while trying to visualize the Tree
To Reproduce
import udon2 as ud2
from udon2.visual import render_dep_tree
roots = ud2.ConllReader.read_file('/home/greg/res1.conllu')
render_dep_tree(roots[0], '/home/greg/pict.svg')
I get the picture of the tree on the screen and the mentioned error.
Environment specs (please complete the following information):
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.