typed-ast 的构建轮失败

问题描述 投票:0回答:3

尝试安装程序的要求时 (

pip install -r requirements.txt
) pip 失败并显示以下完整输出:

superadmin@diskstation:/volume1/scripts/movies/trakt.plex.scripts-master$ sudo /volume1/@appstore/py3k/usr/local/bin/pip3 install -r requirements.txt
Password:
Collecting astroid==2.3.2
  Using cached astroid-2.3.2-py3-none-any.whl (205 kB)
Collecting certifi==2019.9.11
  Using cached certifi-2019.9.11-py2.py3-none-any.whl (154 kB)
Collecting chardet==3.0.4
  Using cached chardet-3.0.4-py2.py3-none-any.whl (133 kB)
Collecting idna==2.8
  Using cached idna-2.8-py2.py3-none-any.whl (58 kB)
Collecting isort==4.3.21
  Using cached isort-4.3.21-py2.py3-none-any.whl (42 kB)
Requirement already satisfied: lazy-object-proxy==1.4.2 in /volume1/@appstore/py3k/usr/local/lib/python3.5/site-packages (from -r requirements.txt (line 6)) (1.4.2)
Collecting mccabe==0.6.1
  Using cached mccabe-0.6.1-py2.py3-none-any.whl (8.6 kB)
Collecting oauthlib==3.1.0
  Using cached oauthlib-3.1.0-py2.py3-none-any.whl (147 kB)
Processing /root/.cache/pip/wheels/03/22/4e/8993c46d8cbb81c71115a39595162be5ff7193c1810afd4ce2/PlexAPI-3.2.0-py3-none-any.whl
Collecting pylint==2.4.3
  Using cached pylint-2.4.3-py3-none-any.whl (302 kB)
Collecting python-dotenv==0.10.3
  Using cached python_dotenv-0.10.3-py2.py3-none-any.whl (16 kB)
Collecting requests==2.22.0
  Using cached requests-2.22.0-py2.py3-none-any.whl (57 kB)
Collecting requests-cache==0.5.2
  Using cached requests_cache-0.5.2-py2.py3-none-any.whl (22 kB)
Collecting requests-oauthlib==1.2.0
  Using cached requests_oauthlib-1.2.0-py2.py3-none-any.whl (22 kB)
Requirement already satisfied: six==1.12.0 in /volume1/@appstore/py3k/usr/local/lib/python3.5/site-packages (from -r requirements.txt (line 15)) (1.12.0)
Collecting tqdm==4.36.1
  Using cached tqdm-4.36.1-py2.py3-none-any.whl (52 kB)
Processing /root/.cache/pip/wheels/aa/54/98/934d5f354a3a0e8a74332d5a53db29dd8421938f3394ddeb4e/trakt-2.11.0-py3-none-any.whl
Collecting typed-ast==1.4.0
  Using cached typed_ast-1.4.0.tar.gz (206 kB)
Collecting urllib3==1.25.6
  Using cached urllib3-1.25.6-py2.py3-none-any.whl (125 kB)
Collecting websocket-client==0.56.0
  Using cached websocket_client-0.56.0-py2.py3-none-any.whl (200 kB)
Requirement already satisfied: wrapt==1.11.2 in /volume1/@appstore/py3k/usr/local/lib/python3.5/site-packages (from -r requirements.txt (line 21)) (1.11.2)
Collecting beautifulsoup4==4.9.0
  Using cached beautifulsoup4-4.9.0-py3-none-any.whl (109 kB)
Collecting soupsieve>1.2
  Using cached soupsieve-2.0.1-py3-none-any.whl (32 kB)
Building wheels for collected packages: typed-ast
  Building wheel for typed-ast (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-rpek9gmd/typed-ast/setup.py'"'"'; __file__='"'"'/tmp/pip-install-rpek9gmd/typed-ast/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-aq7ds8gk
       cwd: /tmp/pip-install-rpek9gmd/typed-ast/
  Complete output (23 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-aarch64-3.5
  creating build/lib.linux-aarch64-3.5/typed_ast
  copying typed_ast/conversions.py -> build/lib.linux-aarch64-3.5/typed_ast
  copying typed_ast/ast3.py -> build/lib.linux-aarch64-3.5/typed_ast
  copying typed_ast/ast27.py -> build/lib.linux-aarch64-3.5/typed_ast
  copying typed_ast/__init__.py -> build/lib.linux-aarch64-3.5/typed_ast
  package init file 'ast3/tests/__init__.py' not found (or not a regular file)
  creating build/lib.linux-aarch64-3.5/typed_ast/tests
  copying ast3/tests/test_basics.py -> build/lib.linux-aarch64-3.5/typed_ast/tests
  running build_ext
  building '_ast27' extension
  creating build/temp.linux-aarch64-3.5
  creating build/temp.linux-aarch64-3.5/ast27
  creating build/temp.linux-aarch64-3.5/ast27/Parser
  creating build/temp.linux-aarch64-3.5/ast27/Python
  creating build/temp.linux-aarch64-3.5/ast27/Custom
  /usr/local/aarch64-unknown-linux-gnueabi/bin/aarch64-unknown-linux-gnueabi-ccache-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 -DSYNOPLAT_F_ARMV8 -O2 -include /usr/syno/include/platformconfig.h -DSYNO_ENVIRONMENT -DBUILD_ARCH=64 -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 -Iast27/Include -I/volume1/@appstore/py3k/usr/local/include/python3.5m -c ast27/Parser/acceler.c -o build/temp.linux-aarch64-3.5/ast27/Parser/acceler.o
  unable to execute '/usr/local/aarch64-unknown-linux-gnueabi/bin/aarch64-unknown-linux-gnueabi-ccache-gcc': No such file or directory
  error: command '/usr/local/aarch64-unknown-linux-gnueabi/bin/aarch64-unknown-linux-gnueabi-ccache-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for typed-ast
  Running setup.py clean for typed-ast
Failed to build typed-ast
Installing collected packages: typed-ast, astroid, certifi, chardet, idna, isort, mccabe, oauthlib, tqdm, websocket-client, urllib3, requests, PlexAPI, pylint, python-dotenv, requests-cache, requests-oauthlib, trakt, soupsieve, beautifulsoup4
    Running setup.py install for typed-ast ... 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-rpek9gmd/typed-ast/setup.py'"'"'; __file__='"'"'/tmp/pip-install-rpek9gmd/typed-ast/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-o2yyxpzp/install-record.txt --single-version-externally-managed --compile --install-headers /volume1/@appstore/py3k/usr/local/include/python3.5m/typed-ast
         cwd: /tmp/pip-install-rpek9gmd/typed-ast/
    Complete output (23 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-aarch64-3.5
    creating build/lib.linux-aarch64-3.5/typed_ast
    copying typed_ast/conversions.py -> build/lib.linux-aarch64-3.5/typed_ast
    copying typed_ast/ast3.py -> build/lib.linux-aarch64-3.5/typed_ast
    copying typed_ast/ast27.py -> build/lib.linux-aarch64-3.5/typed_ast
    copying typed_ast/__init__.py -> build/lib.linux-aarch64-3.5/typed_ast
    package init file 'ast3/tests/__init__.py' not found (or not a regular file)
    creating build/lib.linux-aarch64-3.5/typed_ast/tests
    copying ast3/tests/test_basics.py -> build/lib.linux-aarch64-3.5/typed_ast/tests
    running build_ext
    building '_ast27' extension
    creating build/temp.linux-aarch64-3.5
    creating build/temp.linux-aarch64-3.5/ast27
    creating build/temp.linux-aarch64-3.5/ast27/Parser
    creating build/temp.linux-aarch64-3.5/ast27/Python
    creating build/temp.linux-aarch64-3.5/ast27/Custom
    /usr/local/aarch64-unknown-linux-gnueabi/bin/aarch64-unknown-linux-gnueabi-ccache-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 -DSYNOPLAT_F_ARMV8 -O2 -include /usr/syno/include/platformconfig.h -DSYNO_ENVIRONMENT -DBUILD_ARCH=64 -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 -Iast27/Include -I/volume1/@appstore/py3k/usr/local/include/python3.5m -c ast27/Parser/acceler.c -o build/temp.linux-aarch64-3.5/ast27/Parser/acceler.o
    unable to execute '/usr/local/aarch64-unknown-linux-gnueabi/bin/aarch64-unknown-linux-gnueabi-ccache-gcc': No such file or directory
    error: command '/usr/local/aarch64-unknown-linux-gnueabi/bin/aarch64-unknown-linux-gnueabi-ccache-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-rpek9gmd/typed-ast/setup.py'"'"'; __file__='"'"'/tmp/pip-install-rpek9gmd/typed-ast/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-o2yyxpzp/install-record.txt --single-version-externally-managed --compile --install-headers /volume1/@appstore/py3k/usr/local/include/python3.5m/typed-ast Check the logs for full command output.

我尝试使用 pip 而不是 pip3,但该命令立即返回另一条错误消息。

有人知道我该如何解决这个问题吗?

python python-3.x synology
3个回答
17
投票

看来是版本问题。我手动安装了typed_ast:

pip3 install typed_ast

本次安装的是1.4.2版本

然后我更新了requirements.txt以匹配:

typed-ast==1.4.2

之后,从requirements.txt安装就成功了(不是我需要这样做,而是我想检查过程)

pip3 install -r requirements.txt

4
投票

在使用 python=3.9 的 conda 环境中尝试

pip install -r requirements.txt
时,我收到了类似的错误消息。当我切换到 conda 环境
my_env
,使用 python=3.8 时,安装需求工作正常:
conda create -n my_env python=3.8


2
投票

运行cmd终端是个好主意,如下所示:

pip install typed_ast

然后您应该使用当前更新版本更新您的requirements.txt 文件,例如

typed-ast==1.5.4

终于跑了-

pip install -r requirements.txt

希望这会起作用。

© www.soinside.com 2019 - 2024. All rights reserved.