Failed building wheel for typed-ast
Asked Answered
D

5

25

While trying to install requirements for a program (pip install -r requirements.txt) pip fails with the following full output:

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.

I tried with pip instead of pip3 but the command instantly returns another error message.

Does anybody know how I can resolve this?

Dextrous answered 14/6, 2020 at 19:48 Comment(5)
Apparently, typed-ast depends on some native code, so pip attempts to build it using a compiler located at /usr/local/aarch64-unknown-linux-gnueabi/bin/aarch64-unknown-linux-gnueabi-ccache-gcc, but this file doesn't exist. Does your NAS has a compiler?Fordo
Thanks for your reply. Would my NAS be on the following list if it had a compiler ?help.synology.com/developer-guide/compile_applications/…Dextrous
Looks like you need to get a toolchain, as described in the docs.Fordo
Ok I found the toolchain, downloaded it and extracted it on my computer. Do I have to place in /usr/local on my NAS through SSH?Dextrous
Depends on whether the NAS' CPU can run these executables. The documentation says this toolchain is intended for cross-compiling, so it runs on your host machine and generates executables for the NAS.Fordo
T
21

It seems to be a version issue. I manually installed typed_ast:

pip3 install typed_ast

This installed version 1.4.2

I then updated requirements.txt to match:

typed-ast==1.4.2

After that, installation from requirements.txt worked (not that I needed to do it, but I wanted to check the process)

pip3 install -r requirements.txt
Trella answered 8/3, 2021 at 12:38 Comment(1)
in my project couldn't update my requirements to typed-ast==1.4.0. it shows Failed to build typed-ast ERROR: Could not build wheels for typed-ast, which is required to install pyproject.toml-based projectsMeda
P
5

I got a similar error message when trying to pip install -r requirements.txt in a conda environment that was using python=3.9. When I switched to a conda environment, my_env, using python=3.8, then installing requirements worked fine: conda create -n my_env python=3.8

Pee answered 14/10, 2020 at 9:4 Comment(1)
What i did is to change the python version in the current conda environment with following command: conda install python=3.18Cyclist
H
1

It's a great idea to run into cmd terminal as follows:

pip install typed_ast

Then you should update your requirements.txt file with current updated version, like

typed-ast==1.5.4

Finally run -

pip install -r requirements.txt

Hopes that will work.

Hooker answered 14/6, 2020 at 19:49 Comment(1)
This is a duplicate of the answer provided by Little Brian further up.Forzando
F
0

You got an error that says unable to execute '/usr/local/aarch64-unknown-linux-gnueabi/bin/aarch64-unknown-linux-gnueabi-ccache-gcc': No such file or directory.

I had a similar issue and was able to resolve it by installing python3-dev and build-essential as mentioned in this thread.

Run

sudo apt-get install python3-dev

if you're using Python 3.x followed by

sudo apt-get install build-essential

This should allow you to install typed_ast without any errors.

Forzando answered 15/5 at 14:35 Comment(0)
M
-3

I was having the same problem with typed-ast and Pillow installation. you can see my problem here Stackoverflow Question. Try to create a virtual environment using the same python version you used while developing your project then install in your env pip install -r requirements.txt. If you problem is version compatibility related problem this might work.

Meda answered 21/1 at 9:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.