randy3k / radian

A 21 century R console
MIT License
1.96k stars 73 forks source link

Building wheel for rchitect (setup.py) ... error #408

Closed rrodrigueznt closed 1 year ago

rrodrigueznt commented 1 year ago

Hi! Trying to install Radian on AnLinux Ubuntu on Termux I find the error below:

t@localhost:~# pip install -U radian         
Collecting radian                                 
Using cached radian-0.6.4-py3-none-any.whl    
Requirement already satisfied: prompt-toolkit<3.1,>=3.0.15 in /usr/local/lib/python3.9/dist-packages (from radian) (3.0.38)                     
Collecting rchitect<0.4.0,>=0.3.39                
Using cached rchitect-0.3.40.tar.gz (32 kB)     
Preparing metadata (setup.py) ... done        
Requirement already satisfied: pygments>=2.5.0 in /usr/local/lib/python3.9/dist-packages (from radian) (2.14.0)                                 
Requirement already satisfied: wcwidth in /usr/local/lib/python3.9/dist-packages (from prompt-toolkit<3.1,>=3.0.15->radian) (0.2.6)             
Requirement already satisfied: cffi>=1.10.0 in /usr/local/lib/python3.9/dist-packages (from rchitect<0.4.0,>=0.3.39->radian) (1.15.1)           
Requirement already satisfied: six>=1.9.0 in /usr/lib/python3/dist-packages (from rchitect<0.4.0,>=0.3.39->radian) (1.16.0)                     
Requirement already satisfied: pycparser in /usr/local/lib/python3.9/dist-packages (from cffi>=1.10.0->rchitect<0.4.0,>=0.3.39->radian) (2.21)  
Building wheels for collected packages: rchitect  
Building wheel for rchitect (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [49 lines of output]
      /usr/local/lib/python3.9/dist-packages/setuptools/__init__.py:85: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated. Requirements should be satisfied by a PEP 517 installer. If you are using pip, you can try `pip install --use-pep517`.
        dist.fetch_build_eggs(dist.setup_requires)
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-aarch64-cpython-39
      creating build/lib.linux-aarch64-cpython-39/rchitect
      copying rchitect/__init__.py -> build/lib.linux-aarch64-cpython-39/rchitect
      copying rchitect/callbacks.py -> build/lib.linux-aarch64-cpython-39/rchitect
      copying rchitect/completion.py -> build/lib.linux-aarch64-cpython-39/rchitect
      copying rchitect/console.py -> build/lib.linux-aarch64-cpython-39/rchitect
      copying rchitect/dispatch.py -> build/lib.linux-aarch64-cpython-39/rchitect
      copying rchitect/interface.py -> build/lib.linux-aarch64-cpython-39/rchitect
      copying rchitect/py_tools.py -> build/lib.linux-aarch64-cpython-39/rchitect
      copying rchitect/repl.py -> build/lib.linux-aarch64-cpython-39/rchitect
      copying rchitect/setup.py -> build/lib.linux-aarch64-cpython-39/rchitect
      copying rchitect/types.py -> build/lib.linux-aarch64-cpython-39/rchitect
      copying rchitect/utils.py -> build/lib.linux-aarch64-cpython-39/rchitect
      copying rchitect/xptr.py -> build/lib.linux-aarch64-cpython-39/rchitect
      creating build/lib.linux-aarch64-cpython-39/rchitect/reticulate
      copying rchitect/reticulate/__init__.py -> build/lib.linux-aarch64-cpython-39/rchitect/reticulate
      copying rchitect/reticulate/path.py -> build/lib.linux-aarch64-cpython-39/rchitect/reticulate
      copying rchitect/reticulate/py_config.py -> build/lib.linux-aarch64-cpython-39/rchitect/reticulate
      copying rchitect/reticulate/config.R -> build/lib.linux-aarch64-cpython-39/rchitect/reticulate
      creating build/lib.linux-aarch64-cpython-39/rchitect/src
      copying rchitect/src/R.h -> build/lib.linux-aarch64-cpython-39/rchitect/src
      copying rchitect/src/gil.c -> build/lib.linux-aarch64-cpython-39/rchitect/src
      copying rchitect/src/gil.h -> build/lib.linux-aarch64-cpython-39/rchitect/src
      copying rchitect/src/libR.c -> build/lib.linux-aarch64-cpython-39/rchitect/src
      copying rchitect/src/libR.h -> build/lib.linux-aarch64-cpython-39/rchitect/src
      copying rchitect/src/parse.c -> build/lib.linux-aarch64-cpython-39/rchitect/src
      copying rchitect/src/parse.h -> build/lib.linux-aarch64-cpython-39/rchitect/src
      copying rchitect/src/process_events.c -> build/lib.linux-aarch64-cpython-39/rchitect/src
      copying rchitect/src/process_events.h -> build/lib.linux-aarch64-cpython-39/rchitect/src
      running build_ext
      generating cffi module 'build/temp.linux-aarch64-cpython-39/rchitect._cffi.c'
      creating build/temp.linux-aarch64-cpython-39
      building 'rchitect._cffi' extension
      creating build/temp.linux-aarch64-cpython-39/build
      creating build/temp.linux-aarch64-cpython-39/build/temp.linux-aarch64-cpython-39
      creating build/temp.linux-aarch64-cpython-39/rchitect
      creating build/temp.linux-aarch64-cpython-39/rchitect/src
      aarch64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -Irchitect/src -I/usr/include/python3.9 -c build/temp.linux-aarch64-cpython-39/rchitect._cffi.c -o build/temp.linux-aarch64-cpython-39/build/temp.linux-aarch64-cpython-39/rchitect._cffi.o
      build/temp.linux-aarch64-cpython-39/rchitect._cffi.c:50:14: fatal error: pyconfig.h: No such file or directory
         50 | #    include <pyconfig.h>
            |              ^~~~~~~~~~~~
      compilation terminated.
      error: command '/bin/aarch64-linux-gnu-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 rchitect
  Running setup.py clean for rchitect
Failed to build rchitect
Installing collected packages: rchitect, radian
  Running setup.py install for rchitect ... error
  error: subprocess-exited-with-error

  × Running setup.py install for rchitect did not run successfully.
  │ exit code: 1
  ╰─> [51 lines of output]
      /usr/local/lib/python3.9/dist-packages/setuptools/__init__.py:85: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated. Requirements should be satisfied by a PEP 517 installer. If you are using pip, you can try `pip install --use-pep517`.
        dist.fetch_build_eggs(dist.setup_requires)
      running install
      /usr/local/lib/python3.9/dist-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-aarch64-cpython-39
      creating build/lib.linux-aarch64-cpython-39/rchitect
      copying rchitect/__init__.py -> build/lib.linux-aarch64-cpython-39/rchitect
      copying rchitect/callbacks.py -> build/lib.linux-aarch64-cpython-39/rchitect
      copying rchitect/completion.py -> build/lib.linux-aarch64-cpython-39/rchitect
      copying rchitect/console.py -> build/lib.linux-aarch64-cpython-39/rchitect
      copying rchitect/dispatch.py -> build/lib.linux-aarch64-cpython-39/rchitect
      copying rchitect/interface.py -> build/lib.linux-aarch64-cpython-39/rchitect
      copying rchitect/py_tools.py -> build/lib.linux-aarch64-cpython-39/rchitect
      copying rchitect/repl.py -> build/lib.linux-aarch64-cpython-39/rchitect
      copying rchitect/setup.py -> build/lib.linux-aarch64-cpython-39/rchitect
      copying rchitect/types.py -> build/lib.linux-aarch64-cpython-39/rchitect
      copying rchitect/utils.py -> build/lib.linux-aarch64-cpython-39/rchitect
      copying rchitect/xptr.py -> build/lib.linux-aarch64-cpython-39/rchitect
      creating build/lib.linux-aarch64-cpython-39/rchitect/reticulate
      copying rchitect/reticulate/__init__.py -> build/lib.linux-aarch64-cpython-39/rchitect/reticulate
      copying rchitect/reticulate/path.py -> build/lib.linux-aarch64-cpython-39/rchitect/reticulate
      copying rchitect/reticulate/py_config.py -> build/lib.linux-aarch64-cpython-39/rchitect/reticulate
      copying rchitect/reticulate/config.R -> build/lib.linux-aarch64-cpython-39/rchitect/reticulate
      creating build/lib.linux-aarch64-cpython-39/rchitect/src
      copying rchitect/src/R.h -> build/lib.linux-aarch64-cpython-39/rchitect/src
      copying rchitect/src/gil.c -> build/lib.linux-aarch64-cpython-39/rchitect/src
      copying rchitect/src/gil.h -> build/lib.linux-aarch64-cpython-39/rchitect/src
      copying rchitect/src/libR.c -> build/lib.linux-aarch64-cpython-39/rchitect/src
      copying rchitect/src/libR.h -> build/lib.linux-aarch64-cpython-39/rchitect/src
      copying rchitect/src/parse.c -> build/lib.linux-aarch64-cpython-39/rchitect/src
      copying rchitect/src/parse.h -> build/lib.linux-aarch64-cpython-39/rchitect/src
      copying rchitect/src/process_events.c -> build/lib.linux-aarch64-cpython-39/rchitect/src
      copying rchitect/src/process_events.h -> build/lib.linux-aarch64-cpython-39/rchitect/src
      running build_ext
      generating cffi module 'build/temp.linux-aarch64-cpython-39/rchitect._cffi.c'
      creating build/temp.linux-aarch64-cpython-39
      building 'rchitect._cffi' extension
      creating build/temp.linux-aarch64-cpython-39/build
      creating build/temp.linux-aarch64-cpython-39/build/temp.linux-aarch64-cpython-39
      creating build/temp.linux-aarch64-cpython-39/rchitect
      creating build/temp.linux-aarch64-cpython-39/rchitect/src
      aarch64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -Irchitect/src -I/usr/include/python3.9 -c build/temp.linux-aarch64-cpython-39/rchitect._cffi.c -o build/temp.linux-aarch64-cpython-39/build/temp.linux-aarch64-cpython-39/rchitect._cffi.o
      build/temp.linux-aarch64-cpython-39/rchitect._cffi.c:50:14: fatal error: pyconfig.h: No such file or directory
         50 | #    include <pyconfig.h>
            |              ^~~~~~~~~~~~
      compilation terminated.
      error: command '/bin/aarch64-linux-gnu-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.
╰─> rchitect

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
root@localhost:~#

Wheel is installed as per:

root@localhost:~# pip3 show wheel
Name: wheel
Version: 0.37.1 Summary: A built-package format for Python
Home-page: https://github.com/pypa/wheel
Author: Daniel Holth
Author-email: dholth@fastmail.fm License: MIT
Location: /usr/lib/python3/dist-packages
Requires: Required-by:
root@localhost:~#

Please, could you help me to understand where am I failing at setting my Python build environment? Thanks!

rrodrigueznt commented 1 year ago

Solved. My error: I'm using a multiple-releases installation of Python, and I didn't set up the right default version. What I don't understand is how to reach pyconfig.h, installed in only one of the releases, to build from the others. Perhaps it is not possible. In any case, it is not a radian-related issue.

Please, accept my apologies for the noise. Thanks!