Ошибки с пакетом cajarename при установке некоторых модулей Python в Ubuntu 18.04

Я пытался установить модуль python polygon в Ubuntu 18.04. Я просто использую: -

pip install Polygon2

Но потом я получаю ошибки вроде: -

cajarename 17.3.28 requires caja, which is not installed.
cajarename 17.3.28 requires gir1.2-gtk-3.0, which is not installed.
cajarename 17.3.28 requires python-caja, which is not installed.
cajarename 17.3.28 requires python-gi, which is not installed.
jsonschema 2.6.0 requires functools32; python_version == "2.7", which is not installed.

Так что я думаю, что это как-то связано с пакетом cajarename или какой-то ошибкой в ​​дистрибутиве Ubuntu сам. Пожалуйста, помогите найти исправление.

Полная ошибка ниже: -

Collecting Polygon2
  Using cached https://files.pythonhosted.org/packages/73/9e/fe761e03de28b51b445ddf01ddae87441b7e7040df7d830b86db8f945808/Polygon2-2.0.8.tar.gz
cajarename 17.3.28 requires caja, which is not installed.
cajarename 17.3.28 requires gir1.2-gtk-3.0, which is not installed.
cajarename 17.3.28 requires python-caja, which is not installed.
cajarename 17.3.28 requires python-gi, which is not installed.
jsonschema 2.6.0 requires functools32; python_version == "2.7", which is not installed.
Installing collected packages: Polygon2
  Running setup.py install for Polygon2 ... error
    Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-9FYaXv/Polygon2/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-hQqeIk/install-record.txt --single-version-externally-managed --compile:
    Using NumPy extension!
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-2.7
    creating build/lib.linux-x86_64-2.7/Polygon
    copying Polygon/Utils.py -> build/lib.linux-x86_64-2.7/Polygon
    copying Polygon/Shapes.py -> build/lib.linux-x86_64-2.7/Polygon
    copying Polygon/__init__.py -> build/lib.linux-x86_64-2.7/Polygon
    copying Polygon/IO.py -> build/lib.linux-x86_64-2.7/Polygon
    running build_ext
    building 'Polygon.cPolygon' extension
    creating build/temp.linux-x86_64-2.7
    creating build/temp.linux-x86_64-2.7/src
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-nbjU53/python2.7-2.7.15~rc1=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DDEFAULT_STYLE=STYLE_LIST -DWITH_NUMPY=1 -Isrc -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/usr/include/python2.7 -c src/gpc.c -o build/temp.linux-x86_64-2.7/src/gpc.o
    src/gpc.c: In function ‘gpc_read_polygon’:
    src/gpc.c:1037:3: warning: ignoring return value of ‘fscanf’, declared with attribute warn_unused_result [-Wunused-result]
       fscanf(fp, "%d", &(p->num_contours));
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    src/gpc.c:1044:5: warning: ignoring return value of ‘fscanf’, declared with attribute warn_unused_result [-Wunused-result]
         fscanf(fp, "%d", &(p->contour[c].num_vertices));
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    src/gpc.c:1047:7: warning: ignoring return value of ‘fscanf’, declared with attribute warn_unused_result [-Wunused-result]
           fscanf(fp, "%d", &(p->hole[c]));
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    src/gpc.c:1054:7: warning: ignoring return value of ‘fscanf’, declared with attribute warn_unused_result [-Wunused-result]
           fscanf(fp, "%lf %lf", &(p->contour[c].vertex[v].x),
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                 &(p->contour[c].vertex[v].y));
                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    src/gpc.c: In function ‘gpc_polygon_clip’:
    src/gpc.c:1471:7: warning: ‘dy’ may be used uninitialized in this function [-Wmaybe-uninitialized]
           build_intersection_table(&it, aet, dy);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    src/gpc.c:1672:12: warning: ‘yt’ may be used uninitialized in this function [-Wmaybe-uninitialized]
             if ((edge->top.y == yt) && succ_edge)
                ^
    src/gpc.c:1133:38: warning: ‘tr’ may be used uninitialized in this function [-Wmaybe-uninitialized]
       int            vclass, bl, br, tl, tr;
                                          ^~
    src/gpc.c:1133:34: warning: ‘tl’ may be used uninitialized in this function [-Wmaybe-uninitialized]
       int            vclass, bl, br, tl, tr;
                                      ^~
    src/gpc.c:1133:30: warning: ‘br’ may be used uninitialized in this function [-Wmaybe-uninitialized]
       int            vclass, bl, br, tl, tr;
                                  ^~
    src/gpc.c:1328:50: warning: ‘bl’ may be used uninitialized in this function [-Wmaybe-uninitialized]
             vclass= tr + (tl << 1) + (br << 2) + (bl << 3);
                                                  ~~~~^~~~~
    src/gpc.c:1330:12: warning: ‘contributing’ may be used uninitialized in this function [-Wmaybe-uninitialized]
             if (contributing)
                ^
    src/gpc.c: In function ‘gpc_tristrip_clip’:
    src/gpc.c:2131:7: warning: ‘dy’ may be used uninitialized in this function [-Wmaybe-uninitialized]
           build_intersection_table(&it, aet, dy);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    src/gpc.c:2361:12: warning: ‘yt’ may be used uninitialized in this function [-Wmaybe-uninitialized]
             if ((edge->top.y == yt) && succ_edge)
                ^
    src/gpc.c:1794:38: warning: ‘tr’ may be used uninitialized in this function [-Wmaybe-uninitialized]
       int            vclass, bl, br, tl, tr;
                                          ^~
    src/gpc.c:1794:34: warning: ‘tl’ may be used uninitialized in this function [-Wmaybe-uninitialized]
       int            vclass, bl, br, tl, tr;
                                      ^~
    src/gpc.c:1794:30: warning: ‘br’ may be used uninitialized in this function [-Wmaybe-uninitialized]
       int            vclass, bl, br, tl, tr;
                                  ^~
    src/gpc.c:1981:50: warning: ‘bl’ may be used uninitialized in this function [-Wmaybe-uninitialized]
             vclass= tr + (tl << 1) + (br << 2) + (bl << 3);
                                                  ~~~~^~~~~
    src/gpc.c:1983:12: warning: ‘contributing’ may be used uninitialized in this function [-Wmaybe-uninitialized]
             if (contributing)
                ^
    src/gpc.c:2062:16: warning: ‘cft’ may be used uninitialized in this function [-Wmaybe-uninitialized]
                 if (cft == LED)
                    ^
    src/gpc.c:2064:26: warning: ‘cf’ may be used uninitialized in this function [-Wmaybe-uninitialized]
                   if (cf->bot.y == yb)
                       ~~~~~~~^~
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-nbjU53/python2.7-2.7.15~rc1=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DDEFAULT_STYLE=STYLE_LIST -DWITH_NUMPY=1 -Isrc -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/usr/include/python2.7 -c src/cPolygon.c -o build/temp.linux-x86_64-2.7/src/cPolygon.o
    src/cPolygon.c:4:10: 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/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-9FYaXv/Polygon2/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-hQqeIk/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-9FYaXv/Polygon2/
0
задан 30 June 2018 в 00:37

1 ответ

Я не могу воспроизвести вашу проблему на чистой Ubuntu 18.04 LTS. Я установил pip и build-essential и пакет разработки Python2:

sudo apt-get install python-pip build-essential libpython2.7-dev

Ваши предупреждения касаются пропущенных зависимостей установленных модулей Python.

Здесь есть два варианта:

  • установить упомянутые зависимости с помощью

    sudo apt-get install caja gir1.2-gtk-3.0 python-caja python-gi
    
  • удалить сломанные python-модули

    pip uninstall cajarename 
    pip uninstall jsonschema
    
1
ответ дан 30 June 2018 в 00:37

Другие вопросы по тегам:

Похожие вопросы: