Установите пакет python на Synology DiskStation - PullRequest
0 голосов
/ 15 февраля 2020

tldr: Невозможно установить python -docx и l xml на моем Synology DiskStation через pip3 или python 3-м pip установку.

Длинная версия : У меня уже были проблемы с установкой pip3 и django, но у меня все получилось. Теперь я хотел создать до c файлов в django. Итак, python -docx был рекомендован. Однако я не могу просто сказать «pip3 install python -docx».

[Здесь я стер старые данные, потому что они больше не действительны.]

Я не знаю, что делать делать дальше Я также пытался установить libxml2:

python3 -m pip install libxml2
Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement libxml2 (from versions: none)
ERROR: No matching distribution found for libxml2

Я гуглил, но многие сайты просто рекомендуют, как установить определенные пакеты dev на debian, что мне не помогает.

Подскажите пожалуйста как продолжить?

Редактировать После нескольких часов чтения и пробных попыток, включая установку entware, у меня теперь немного другой вывод.

python3 -m pip install python-docx
Defaulting to user installation because normal site-packages is not writeable
Processing /volume1/homes/admin/.cache/pip/wheels/5c/b3/f7/0b2150abcd02387566859213e86c490e38070d0aad388c1105/python_docx-0.8.10-py3-none-any.whl
Collecting lxml>=2.3.2
  Using cached lxml-4.5.0.tar.gz (4.5 MB)
Building wheels for collected packages: lxml
  Building wheel for lxml (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/local/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-9_1bbtke/lxml/setup.py'"'"'; __file__='"'"'/tmp/pip-install-9_1bbtke/lxml/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-h4ugg_2s
       cwd: /tmp/pip-install-9_1bbtke/lxml/
  Complete output (91 lines):
  Building lxml version 4.5.0.
  Building without Cython.
  ERROR: b'/bin/sh: xslt-config: command not found\n'
  ** make sure the development packages of libxml2 and libxslt are installed **

  Using build configuration of libxslt
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-armv7l-3.5
  creating build/lib.linux-armv7l-3.5/lxml
  copying src/lxml/doctestcompare.py -> build/lib.linux-armv7l-3.5/lxml
  copying src/lxml/pyclasslookup.py -> build/lib.linux-armv7l-3.5/lxml
  copying src/lxml/cssselect.py -> build/lib.linux-armv7l-3.5/lxml
  copying src/lxml/usedoctest.py -> build/lib.linux-armv7l-3.5/lxml
  copying src/lxml/__init__.py -> build/lib.linux-armv7l-3.5/lxml
  copying src/lxml/ElementInclude.py -> build/lib.linux-armv7l-3.5/lxml
  copying src/lxml/builder.py -> build/lib.linux-armv7l-3.5/lxml
  copying src/lxml/_elementpath.py -> build/lib.linux-armv7l-3.5/lxml
  copying src/lxml/sax.py -> build/lib.linux-armv7l-3.5/lxml
  creating build/lib.linux-armv7l-3.5/lxml/includes
  copying src/lxml/includes/__init__.py -> build/lib.linux-armv7l-3.5/lxml/includes
  creating build/lib.linux-armv7l-3.5/lxml/html
  copying src/lxml/html/defs.py -> build/lib.linux-armv7l-3.5/lxml/html
  copying src/lxml/html/formfill.py -> build/lib.linux-armv7l-3.5/lxml/html
  copying src/lxml/html/_diffcommand.py -> build/lib.linux-armv7l-3.5/lxml/html
  copying src/lxml/html/_html5builder.py -> build/lib.linux-armv7l-3.5/lxml/html
  copying src/lxml/html/soupparser.py -> build/lib.linux-armv7l-3.5/lxml/html
  copying src/lxml/html/clean.py -> build/lib.linux-armv7l-3.5/lxml/html
  copying src/lxml/html/_setmixin.py -> build/lib.linux-armv7l-3.5/lxml/html
  copying src/lxml/html/usedoctest.py -> build/lib.linux-armv7l-3.5/lxml/html
  copying src/lxml/html/__init__.py -> build/lib.linux-armv7l-3.5/lxml/html
  copying src/lxml/html/builder.py -> build/lib.linux-armv7l-3.5/lxml/html
  copying src/lxml/html/html5parser.py -> build/lib.linux-armv7l-3.5/lxml/html
  copying src/lxml/html/ElementSoup.py -> build/lib.linux-armv7l-3.5/lxml/html
  copying src/lxml/html/diff.py -> build/lib.linux-armv7l-3.5/lxml/html
  creating build/lib.linux-armv7l-3.5/lxml/isoschematron
  copying src/lxml/isoschematron/__init__.py -> build/lib.linux-armv7l-3.5/lxml/isoschematron
  copying src/lxml/etree.h -> build/lib.linux-armv7l-3.5/lxml
  copying src/lxml/etree_api.h -> build/lib.linux-armv7l-3.5/lxml
  copying src/lxml/lxml.etree.h -> build/lib.linux-armv7l-3.5/lxml
  copying src/lxml/lxml.etree_api.h -> build/lib.linux-armv7l-3.5/lxml
  copying src/lxml/includes/schematron.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
  copying src/lxml/includes/c14n.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
  copying src/lxml/includes/relaxng.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
  copying src/lxml/includes/xpath.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
  copying src/lxml/includes/dtdvalid.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
  copying src/lxml/includes/xmlparser.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
  copying src/lxml/includes/tree.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
  copying src/lxml/includes/xslt.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
  copying src/lxml/includes/uri.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
  copying src/lxml/includes/xmlschema.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
  copying src/lxml/includes/__init__.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
  copying src/lxml/includes/config.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
  copying src/lxml/includes/htmlparser.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
  copying src/lxml/includes/xmlerror.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
  copying src/lxml/includes/xinclude.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
  copying src/lxml/includes/etreepublic.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
  copying src/lxml/includes/lxml-version.h -> build/lib.linux-armv7l-3.5/lxml/includes
  copying src/lxml/includes/etree_defs.h -> build/lib.linux-armv7l-3.5/lxml/includes
  creating build/lib.linux-armv7l-3.5/lxml/isoschematron/resources
  creating build/lib.linux-armv7l-3.5/lxml/isoschematron/resources/rng
  copying src/lxml/isoschematron/resources/rng/iso-schematron.rng -> build/lib.linux-armv7l-3.5/lxml/isoschematron/resources/rng
  creating build/lib.linux-armv7l-3.5/lxml/isoschematron/resources/xsl
  copying src/lxml/isoschematron/resources/xsl/XSD2Schtrn.xsl -> build/lib.linux-armv7l-3.5/lxml/isoschematron/resources/xsl
  copying src/lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl -> build/lib.linux-armv7l-3.5/lxml/isoschematron/resources/xsl
  creating build/lib.linux-armv7l-3.5/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
  copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_svrl_for_xslt1.xsl -> build/lib.linux-armv7l-3.5/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
  copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_message.xsl -> build/lib.linux-armv7l-3.5/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
  copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_skeleton_for_xslt1.xsl -> build/lib.linux-armv7l-3.5/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
  copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_abstract_expand.xsl -> build/lib.linux-armv7l-3.5/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
  copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_dsdl_include.xsl -> build/lib.linux-armv7l-3.5/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
  copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt -> build/lib.linux-armv7l-3.5/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
  running build_ext
  building 'lxml.etree' extension
  creating build/temp.linux-armv7l-3.5
  creating build/temp.linux-armv7l-3.5/src
  creating build/temp.linux-armv7l-3.5/src/lxml
  /opt/bin/gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DSYNO_FIX_FLAG_BUG -DOPENSSL_NO_SSL3 -DOPENSSL_NO_SSL2 -mhard-float -mfpu=vfpv3-d16 -march=armv7-a -mcpu=marvell-pj4 -mtune=marvell-pj4 -DSYNOPLAT_F_ARMV7 -O2 -fno-diagnostics-show-caret -Wno-unused-local-typedefs -include /usr/syno/include/platformconfig.h -DSYNO_ENVIRONMENT -DBUILD_ARCH=32 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -g -DSDK_VER_MIN_REQUIRED=600 -pipe -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -O2 -Wno-unused-result -fPIC -DCYTHON_CLINE_IN_TRACEBACK=0 -Isrc -Isrc/lxml/includes -I/volume1/@appstore/py3k/usr/local/include/python3.5m -c src/lxml/etree.c -o build/temp.linux-armv7l-3.5/src/lxml/etree.o -w
  gcc: error trying to exec 'as': execvp: No such file or directory
  cc1: fatal error: /usr/syno/include/platformconfig.h: No such file or directory
  compilation terminated.
  Compile failed: command '/opt/bin/gcc' failed with exit status 1
  creating tmp
  cc -I/usr/include/libxml2 -c /tmp/xmlXPathInit_wqm9l9k.c -o tmp/xmlXPathInit_wqm9l9k.o
  unable to execute 'cc': No such file or directory
  *********************************************************************************
  Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
  *********************************************************************************
  error: command '/opt/bin/gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for lxml
  Running setup.py clean for lxml
Failed to build lxml
Installing collected packages: lxml, python-docx
    Running setup.py install for lxml ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/local/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-9_1bbtke/lxml/setup.py'"'"'; __file__='"'"'/tmp/pip-install-9_1bbtke/lxml/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-_uhfue_j/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /var/services/homes/admin/.local/include/python3.5m/lxml
         cwd: /tmp/pip-install-9_1bbtke/lxml/
    Complete output (90 lines):
    Building lxml version 4.5.0.
    Building without Cython.
    ERROR: b'/bin/sh: xslt-config: command not found\n'
    ** make sure the development packages of libxml2 and libxslt are installed **

    Using build configuration of libxslt
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-armv7l-3.5
    creating build/lib.linux-armv7l-3.5/lxml
    copying src/lxml/doctestcompare.py -> build/lib.linux-armv7l-3.5/lxml
    copying src/lxml/pyclasslookup.py -> build/lib.linux-armv7l-3.5/lxml
    copying src/lxml/cssselect.py -> build/lib.linux-armv7l-3.5/lxml
    copying src/lxml/usedoctest.py -> build/lib.linux-armv7l-3.5/lxml
    copying src/lxml/__init__.py -> build/lib.linux-armv7l-3.5/lxml
    copying src/lxml/ElementInclude.py -> build/lib.linux-armv7l-3.5/lxml
    copying src/lxml/builder.py -> build/lib.linux-armv7l-3.5/lxml
    copying src/lxml/_elementpath.py -> build/lib.linux-armv7l-3.5/lxml
    copying src/lxml/sax.py -> build/lib.linux-armv7l-3.5/lxml
    creating build/lib.linux-armv7l-3.5/lxml/includes
    copying src/lxml/includes/__init__.py -> build/lib.linux-armv7l-3.5/lxml/includes
    creating build/lib.linux-armv7l-3.5/lxml/html
    copying src/lxml/html/defs.py -> build/lib.linux-armv7l-3.5/lxml/html
    copying src/lxml/html/formfill.py -> build/lib.linux-armv7l-3.5/lxml/html
    copying src/lxml/html/_diffcommand.py -> build/lib.linux-armv7l-3.5/lxml/html
    copying src/lxml/html/_html5builder.py -> build/lib.linux-armv7l-3.5/lxml/html
    copying src/lxml/html/soupparser.py -> build/lib.linux-armv7l-3.5/lxml/html
    copying src/lxml/html/clean.py -> build/lib.linux-armv7l-3.5/lxml/html
    copying src/lxml/html/_setmixin.py -> build/lib.linux-armv7l-3.5/lxml/html
    copying src/lxml/html/usedoctest.py -> build/lib.linux-armv7l-3.5/lxml/html
    copying src/lxml/html/__init__.py -> build/lib.linux-armv7l-3.5/lxml/html
    copying src/lxml/html/builder.py -> build/lib.linux-armv7l-3.5/lxml/html
    copying src/lxml/html/html5parser.py -> build/lib.linux-armv7l-3.5/lxml/html
    copying src/lxml/html/ElementSoup.py -> build/lib.linux-armv7l-3.5/lxml/html
    copying src/lxml/html/diff.py -> build/lib.linux-armv7l-3.5/lxml/html
    creating build/lib.linux-armv7l-3.5/lxml/isoschematron
    copying src/lxml/isoschematron/__init__.py -> build/lib.linux-armv7l-3.5/lxml/isoschematron
    copying src/lxml/etree.h -> build/lib.linux-armv7l-3.5/lxml
    copying src/lxml/etree_api.h -> build/lib.linux-armv7l-3.5/lxml
    copying src/lxml/lxml.etree.h -> build/lib.linux-armv7l-3.5/lxml
    copying src/lxml/lxml.etree_api.h -> build/lib.linux-armv7l-3.5/lxml
    copying src/lxml/includes/schematron.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
    copying src/lxml/includes/c14n.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
    copying src/lxml/includes/relaxng.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
    copying src/lxml/includes/xpath.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
    copying src/lxml/includes/dtdvalid.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
    copying src/lxml/includes/xmlparser.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
    copying src/lxml/includes/tree.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
    copying src/lxml/includes/xslt.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
    copying src/lxml/includes/uri.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
    copying src/lxml/includes/xmlschema.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
    copying src/lxml/includes/__init__.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
    copying src/lxml/includes/config.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
    copying src/lxml/includes/htmlparser.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
    copying src/lxml/includes/xmlerror.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
    copying src/lxml/includes/xinclude.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
    copying src/lxml/includes/etreepublic.pxd -> build/lib.linux-armv7l-3.5/lxml/includes
    copying src/lxml/includes/lxml-version.h -> build/lib.linux-armv7l-3.5/lxml/includes
    copying src/lxml/includes/etree_defs.h -> build/lib.linux-armv7l-3.5/lxml/includes
    creating build/lib.linux-armv7l-3.5/lxml/isoschematron/resources
    creating build/lib.linux-armv7l-3.5/lxml/isoschematron/resources/rng
    copying src/lxml/isoschematron/resources/rng/iso-schematron.rng -> build/lib.linux-armv7l-3.5/lxml/isoschematron/resources/rng
    creating build/lib.linux-armv7l-3.5/lxml/isoschematron/resources/xsl
    copying src/lxml/isoschematron/resources/xsl/XSD2Schtrn.xsl -> build/lib.linux-armv7l-3.5/lxml/isoschematron/resources/xsl
    copying src/lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl -> build/lib.linux-armv7l-3.5/lxml/isoschematron/resources/xsl
    creating build/lib.linux-armv7l-3.5/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
    copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_svrl_for_xslt1.xsl -> build/lib.linux-armv7l-3.5/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
    copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_message.xsl -> build/lib.linux-armv7l-3.5/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
    copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_skeleton_for_xslt1.xsl -> build/lib.linux-armv7l-3.5/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
    copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_abstract_expand.xsl -> build/lib.linux-armv7l-3.5/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
    copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_dsdl_include.xsl -> build/lib.linux-armv7l-3.5/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
    copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt -> build/lib.linux-armv7l-3.5/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
    running build_ext
    building 'lxml.etree' extension
    creating build/temp.linux-armv7l-3.5
    creating build/temp.linux-armv7l-3.5/src
    creating build/temp.linux-armv7l-3.5/src/lxml
    /opt/bin/gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DSYNO_FIX_FLAG_BUG -DOPENSSL_NO_SSL3 -DOPENSSL_NO_SSL2 -mhard-float -mfpu=vfpv3-d16 -march=armv7-a -mcpu=marvell-pj4 -mtune=marvell-pj4 -DSYNOPLAT_F_ARMV7 -O2 -fno-diagnostics-show-caret -Wno-unused-local-typedefs -include /usr/syno/include/platformconfig.h -DSYNO_ENVIRONMENT -DBUILD_ARCH=32 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -g -DSDK_VER_MIN_REQUIRED=600 -pipe -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -O2 -Wno-unused-result -fPIC -DCYTHON_CLINE_IN_TRACEBACK=0 -Isrc -Isrc/lxml/includes -I/volume1/@appstore/py3k/usr/local/include/python3.5m -c src/lxml/etree.c -o build/temp.linux-armv7l-3.5/src/lxml/etree.o -w
    gcc: error trying to exec 'as': execvp: No such file or directory
    cc1: fatal error: /usr/syno/include/platformconfig.h: No such file or directory
    compilation terminated.
    Compile failed: command '/opt/bin/gcc' failed with exit status 1
    cc -I/usr/include/libxml2 -c /tmp/xmlXPathInit31sc0ump.c -o tmp/xmlXPathInit31sc0ump.o
    unable to execute 'cc': No such file or directory
    *********************************************************************************
    Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
    *********************************************************************************
    error: command '/opt/bin/gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-9_1bbtke/lxml/setup.py'"'"'; __file__='"'"'/tmp/pip-install-9_1bbtke/lxml/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-_uhfue_j/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /var/services/homes/admin/.local/include/python3.5m/lxml Check the logs for full command output.

Если Я вижу это правильно, что-то не так с названием "CC". Но я до сих пор не знаю, что делать.

1 Ответ

0 голосов
/ 17 февраля 2020

Возможно, я нашел решение. Но я все еще должен проверить это. В то же время вам не нужно отвечать.

Через opkg я мог установить некоторые пакеты, а также получил новую установку python3. Несколько смущает меня. Так что теперь у меня есть 2.7, который я никогда не хотел от Synology, и 3.5 от центра пакетов Synology, и, очевидно, более новый от opkg.

Однако я мог установить некоторые пакеты, но другие нет. Например, я попытался установить reportlab как способ создания PDF-файлов, если python -docx не будет работать. Но я также не смог установить reportlab, потому что он, похоже, пропускает что-то вроде libjpeg-dev или около того. И я также не мог найти это в репозитории opkg. Однако внезапно python -docx может быть установлен, и я сейчас с этим работаю.

Извините, что не могу предоставить более подробное описание для тех, у кого может быть такая же проблема, но по крайней мере я пытался сделай мои шаги понятными.

С уважением

...