Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python3.11を使用しているUbuntu 22.04の環境でエラーが出る #16

Open
KuraZuzu opened this issue Jul 11, 2024 · 2 comments

Comments

@KuraZuzu
Copy link
Collaborator

KuraZuzu commented Jul 11, 2024

不具合の概要
Python3.11をインストールして使用しているUbuntu 22.04の環境でビルド時にエラーが出る。

環境構築まではうまくいっているように見える。

$ which python3
/usr/local/bin/ptyhon3.11
stack-chan/firmware$ npm run doctor

> [email protected] doctor
> echo stack-chan environment info: && git rev-parse HEAD && git rev-parse --show-toplevel && xs-dev doctor

stack-chan environment info:
1731073f6e39b30b8033938e192fdc71a9d503f6
/home/kurasawa/Projects/stack-chan
Update available: 0.30.4

xs-dev environment info:
  CLI Version                0.28.1                                                             
  OS                         Linux                                                              
  Arch                       x64                                                                
  Shell                      /bin/bash                                                          
  NodeJS Version             v20.11.0 (/home/kurasawa/.volta/tools/image/node/20.11.0/bin/node) 
  Python Version             3.11.4 (/usr/local/bin/python)                                     
  Moddable SDK Version       4.1 (/home/kurasawa/.local/share/moddable)                         
  Supported target devices   lin, esp32                                                         
  ESP32 IDF Directory        /home/kurasawa/.local/share/esp32/esp-idf                          

If this is related to an error when using the CLI, please create an issue at "https://github.com/hipsterbrown/xs-dev/issues/new" with the above info.

再現手順

  1. Linux向けの環境構築手順書通りに実施する
  2. npm run buildを実行する
  3. エラーが出る

想定する挙動
ビルドが成功してスタックチャンに書き込みまでできる、

ログ

npm run buildでエラーが出る

stack-chan/firmware$ npm run build --target=esp32/m5stack_cores3

> [email protected] build
> cross-env npm_config_target?=esp32/m5stack cross-env-shell mcconfig -d -m -p \$npm_config_target -t build ./stackchan/manifest_local.json

mcconfig: mod partition of size 0x40000 created from factory app partition
mcconfig: file storage partition of size 0x10000 created from factory app partition
Detecting the Python interpreter
Checking "python" ...
Python 3.11.4
"python" has been detected
Not using an unsupported version of tool openocd-esp32 found in PATH: 0.11.0.
/home/kurasawa/.local/share/esp32/esp-idf/tools/check_python_dependencies.py:12: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  import pkg_resources
The following Python requirements are not satisfied:
pyserial>=3.3
future>=0.15.2
cryptography>=2.1.4
pyparsing>=2.0.3,<2.4.0
pyelftools>=0.22
idf-component-manager~=1.0
gdbgui==0.13.2.0
pygdbmi<=0.9.0.2
python-socketio<5
jinja2<3.1  # See https://github.com/espressif/esp-idf/issues/8760
itsdangerous<2.1
kconfiglib==13.7.1
reedsolo>=1.5.3,<=1.5.4
bitstring>=3.1.6
ecdsa>=0.16.0
construct==2.10.54
To install the missing packages, please run "/home/kurasawa/.local/share/esp32/esp-idf/install.sh"
Diagnostic information:
    IDF_PYTHON_ENV_PATH: /home/kurasawa/.espressif/python_env/idf4.4_py3.11_env
    Python interpreter used: /home/kurasawa/.espressif/python_env/idf4.4_py3.11_env/bin/python

スクリーンショット
もしあれば、不具合を説明するためのスクリーンショットや写真を添付してください。

環境

  • OS: Ubuntu22.04
  • スタックチャンのバージョン: commit 1731073
  • スタックチャンアールティ ver.

その他

エラー内での以下の提案に従いコマンドを実行してみた

To install the missing packages, please run "/home/kurasawa/.local/share/esp32/esp-idf/install.sh"

提案に従い、sh /home/kurasawa/.local/share/esp32/esp-idf/install.shを実行

$ sh /home/kurasawa/.local/share/esp32/esp-idf/install.sh
Detecting the Python interpreter
Checking "python" ...
Python 3.11.4
"python" has been detected
Installing ESP-IDF tools
Current system platform: linux-amd64
Selected targets are: esp32, esp32s3, esp32c3, esp32s2, esp32h2
Installing tools: xtensa-esp32-elf, xtensa-esp32s2-elf, xtensa-esp32s3-elf, riscv32-esp-elf, esp32ulp-elf, openocd-esp32
Skipping [email protected] (already installed)
Skipping [email protected] (already installed)
Skipping [email protected] (already installed)
Skipping [email protected] (already installed)
Skipping [email protected]_20220830 (already installed)
Skipping [email protected] (already installed)
Installing Python environment and packages
Python 3.11.4
pip 24.1 from /home/kurasawa/.espressif/python_env/idf4.4_py3.11_env/lib/python3.11/site-packages/pip (python 3.11)
Installing Python packages from /home/kurasawa/.local/share/esp32/esp-idf/requirements.txt
Looking in indexes: https://pypi.org/simple, https://dl.espressif.com/pypi
Ignoring None: markers 'sys_platform == "win32"' don't match your environment
Requirement already satisfied: setuptools>=21 in /home/kurasawa/.espressif/python_env/idf4.4_py3.11_env/lib/python3.11/site-packages (from -r /home/kurasawa/.local/share/esp32/esp-idf/requirements.txt (line 4)) (70.1.0)
Requirement already satisfied: click>=7.0 in /home/kurasawa/.espressif/python_env/idf4.4_py3.11_env/lib/python3.11/site-packages (from -r /home/kurasawa/.local/share/esp32/esp-idf/requirements.txt (line 8)) (8.1.7)
Collecting pyserial>=3.3 (from -r /home/kurasawa/.local/share/esp32/esp-idf/requirements.txt (line 9))
  Using cached https://dl.espressif.com/pypi/pyserial/pyserial-3.5-py2.py3-none-any.whl (90 kB)
Collecting future>=0.15.2 (from -r /home/kurasawa/.local/share/esp32/esp-idf/requirements.txt (line 10))
  Using cached https://dl.espressif.com/pypi/future/future-1.0.0-py3-none-any.whl (491 kB)
Collecting cryptography>=2.1.4 (from -r /home/kurasawa/.local/share/esp32/esp-idf/requirements.txt (line 12))
  Using cached https://dl.espressif.com/pypi/cryptography/cryptography-42.0.8-cp39-abi3-manylinux_2_28_x86_64.whl (3.9 MB)
Collecting pyparsing<2.4.0,>=2.0.3 (from -r /home/kurasawa/.local/share/esp32/esp-idf/requirements.txt (line 18))
  Using cached https://dl.espressif.com/pypi/pyparsing/pyparsing-2.3.1-py2.py3-none-any.whl (61 kB)
Collecting pyelftools>=0.22 (from -r /home/kurasawa/.local/share/esp32/esp-idf/requirements.txt (line 19))
  Using cached https://dl.espressif.com/pypi/pyelftools/pyelftools-0.31-py3-none-any.whl (180 kB)
Collecting idf-component-manager~=1.0 (from -r /home/kurasawa/.local/share/esp32/esp-idf/requirements.txt (line 20))
  Using cached https://dl.espressif.com/pypi/idf-component-manager/idf_component_manager-1.5.3-py2.py3-none-any.whl (161 kB)
Collecting gdbgui==0.13.2.0 (from -r /home/kurasawa/.local/share/esp32/esp-idf/requirements.txt (line 22))
  Using cached https://dl.espressif.com/pypi/gdbgui/gdbgui-0.13.2.0-py3-none-any.whl (878 kB)
Collecting pygdbmi<=0.9.0.2 (from -r /home/kurasawa/.local/share/esp32/esp-idf/requirements.txt (line 25))
  Using cached https://dl.espressif.com/pypi/pygdbmi/pygdbmi-0.9.0.2-py3-none-any.whl (16 kB)
Collecting python-socketio<5 (from -r /home/kurasawa/.local/share/esp32/esp-idf/requirements.txt (line 28))
  Using cached https://dl.espressif.com/pypi/python-socketio/python_socketio-4.6.1-py2.py3-none-any.whl (51 kB)
Collecting jinja2<3.1 (from -r /home/kurasawa/.local/share/esp32/esp-idf/requirements.txt (line 29))
  Using cached https://dl.espressif.com/pypi/jinja2/Jinja2-3.0.3-py3-none-any.whl (133 kB)
Collecting itsdangerous<2.1 (from -r /home/kurasawa/.local/share/esp32/esp-idf/requirements.txt (line 30))
  Using cached https://dl.espressif.com/pypi/itsdangerous/itsdangerous-2.0.1-py3-none-any.whl (18 kB)
Collecting kconfiglib==13.7.1 (from -r /home/kurasawa/.local/share/esp32/esp-idf/requirements.txt (line 32))
  Using cached https://dl.espressif.com/pypi/kconfiglib/kconfiglib-13.7.1-py2.py3-none-any.whl (145 kB)
Collecting reedsolo<=1.5.4,>=1.5.3 (from -r /home/kurasawa/.local/share/esp32/esp-idf/requirements.txt (line 35))
  Using cached https://dl.espressif.com/pypi/reedsolo/reedsolo-1.5.4-py3-none-any.whl (28 kB)
Collecting bitstring>=3.1.6 (from -r /home/kurasawa/.local/share/esp32/esp-idf/requirements.txt (line 36))
  Using cached https://dl.espressif.com/pypi/bitstring/bitstring-4.2.3-py3-none-any.whl (71 kB)
Collecting ecdsa>=0.16.0 (from -r /home/kurasawa/.local/share/esp32/esp-idf/requirements.txt (line 37))
  Using cached https://dl.espressif.com/pypi/ecdsa/ecdsa-0.19.0-py2.py3-none-any.whl (149 kB)
Collecting construct==2.10.54 (from -r /home/kurasawa/.local/share/esp32/esp-idf/requirements.txt (line 41))
  Using cached https://dl.espressif.com/pypi/construct/construct-2.10.54-py3-none-any.whl (57 kB)
Collecting Flask<1.0,>=0.12.2 (from gdbgui==0.13.2.0->-r /home/kurasawa/.local/share/esp32/esp-idf/requirements.txt (line 22))
  Using cached https://dl.espressif.com/pypi/flask/Flask-0.12.5-py2.py3-none-any.whl (81 kB)
Collecting Flask-Compress<2.0,>=1.4.0 (from gdbgui==0.13.2.0->-r /home/kurasawa/.local/share/esp32/esp-idf/requirements.txt (line 22))
  Using cached Flask_Compress-1.15-py3-none-any.whl.metadata (8.4 kB)
Collecting Flask-SocketIO<3.0,>=2.9 (from gdbgui==0.13.2.0->-r /home/kurasawa/.local/share/esp32/esp-idf/requirements.txt (line 22))
  Using cached https://dl.espressif.com/pypi/flask-socketio/Flask_SocketIO-2.9.6-py2.py3-none-any.whl (16 kB)
Collecting gevent<2.0,>=1.2.2 (from gdbgui==0.13.2.0->-r /home/kurasawa/.local/share/esp32/esp-idf/requirements.txt (line 22))
  Using cached gevent-1.5.0.tar.gz (5.3 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [319 lines of output]
      Compiling src/gevent/resolver/cares.pyx because it changed.
      [1/1] Cythonizing src/gevent/resolver/cares.pyx
      performance hint: src/gevent/libev/corecext.pyx:1291:5: Exception check on '_syserr_cb' will always require the GIL to be acquired.
      Possible solutions:
          1. Declare '_syserr_cb' as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
          2. Use an 'int' return type on '_syserr_cb' to allow an error code to be returned.
      warning: src/gevent/libev/corecext.pyx:1288:0: Global name __SYSERR_CALLBACK matched from within class scope in contradiction to to Python 'class private name' rules. This may change in a future release.
      warning: src/gevent/libev/corecext.pyx:1288:0: Global name __SYSERR_CALLBACK matched from within class scope in contradiction to to Python 'class private name' rules. This may change in a future release.
      warning: src/gevent/libev/corecext.pyx:1288:0: Global name __SYSERR_CALLBACK matched from within class scope in contradiction to to Python 'class private name' rules. This may change in a future release.
      warning: src/gevent/libev/corecext.pyx:1288:0: Global name __SYSERR_CALLBACK matched from within class scope in contradiction to to Python 'class private name' rules. This may change in a future release.
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
              if events & ~(libev.EV__IOFDSET | libev.EV_READ | libev.EV_WRITE):
                  raise ValueError('illegal event mask: %r' % events)
              # All the vfd_functions are no-ops on POSIX
              cdef int vfd = libev.vfd_open(fd)
              libev.ev_io_init(&self._watcher, <void *>gevent_callback_io, vfd, events)
              self.__watcher = <libev.ev_watcher*>&self._watcher
                               ^
      ------------------------------------------------------------
      
      src/gevent/libev/corecext.pyx:1027:25: Cannot convert 'ev_watcher *' to Python object
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
                  raise ValueError('illegal event mask: %r' % events)
              # All the vfd_functions are no-ops on POSIX
              cdef int vfd = libev.vfd_open(fd)
              libev.ev_io_init(&self._watcher, <void *>gevent_callback_io, vfd, events)
              self.__watcher = <libev.ev_watcher*>&self._watcher
              self.__ss = &io_ss
                          ^
      ------------------------------------------------------------
      
      src/gevent/libev/corecext.pyx:1028:20: Cannot convert 'start_and_stop *' to Python object
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
      
          def __cinit__(self, loop loop, double after=0.0, double repeat=0.0, ref=True, priority=None):
              if repeat < 0.0:
                  raise ValueError("repeat must be positive or zero: %r" % repeat)
              libev.ev_timer_init(&self._watcher, <void *>gevent_callback_timer, after, repeat)
              self.__watcher = <libev.ev_watcher*>&self._watcher
                               ^
      ------------------------------------------------------------
      
      src/gevent/libev/corecext.pyx:1072:25: Cannot convert 'ev_watcher *' to Python object
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
          def __cinit__(self, loop loop, double after=0.0, double repeat=0.0, ref=True, priority=None):
              if repeat < 0.0:
                  raise ValueError("repeat must be positive or zero: %r" % repeat)
              libev.ev_timer_init(&self._watcher, <void *>gevent_callback_timer, after, repeat)
              self.__watcher = <libev.ev_watcher*>&self._watcher
              self.__ss = &timer_ss
                          ^
      ------------------------------------------------------------
      
      src/gevent/libev/corecext.pyx:1073:20: Cannot convert 'start_and_stop *' to Python object
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
              # 1) "libev: ev_signal_start called with illegal signal number"
              #    EV_NSIG might be different from signal.NSIG on some platforms
              # 2) "libev: a signal must not be attached to two different loops"
              #    we probably could check that in LIBEV_EMBED mode, but not in general
              libev.ev_signal_init(&self._watcher, <void *>gevent_callback_signal, signalnum)
              self.__watcher = <libev.ev_watcher*>&self._watcher
                               ^
      ------------------------------------------------------------
      
      src/gevent/libev/corecext.pyx:1117:25: Cannot convert 'ev_watcher *' to Python object
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
              #    EV_NSIG might be different from signal.NSIG on some platforms
              # 2) "libev: a signal must not be attached to two different loops"
              #    we probably could check that in LIBEV_EMBED mode, but not in general
              libev.ev_signal_init(&self._watcher, <void *>gevent_callback_signal, signalnum)
              self.__watcher = <libev.ev_watcher*>&self._watcher
              self.__ss = &signal_ss
                          ^
      ------------------------------------------------------------
      
      src/gevent/libev/corecext.pyx:1118:20: Cannot convert 'start_and_stop *' to Python object
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
      
          cdef libev.ev_idle _watcher
      
          def __cinit__(self, loop loop, ref=True, priority=None):
              libev.ev_idle_init(&self._watcher, <void*>gevent_callback_idle)
              self.__watcher = <libev.ev_watcher*>&self._watcher
                               ^
      ------------------------------------------------------------
      
      src/gevent/libev/corecext.pyx:1133:25: Cannot convert 'ev_watcher *' to Python object
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
          cdef libev.ev_idle _watcher
      
          def __cinit__(self, loop loop, ref=True, priority=None):
              libev.ev_idle_init(&self._watcher, <void*>gevent_callback_idle)
              self.__watcher = <libev.ev_watcher*>&self._watcher
              self.__ss = &idle_ss
                          ^
      ------------------------------------------------------------
      
      src/gevent/libev/corecext.pyx:1134:20: Cannot convert 'start_and_stop *' to Python object
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
      
          cdef libev.ev_prepare _watcher
      
          def __cinit__(self, loop loop, ref=True, priority=None):
              libev.ev_prepare_init(&self._watcher, <void*>gevent_callback_prepare)
              self.__watcher = <libev.ev_watcher*>&self._watcher
                               ^
      ------------------------------------------------------------
      
      src/gevent/libev/corecext.pyx:1146:25: Cannot convert 'ev_watcher *' to Python object
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
          cdef libev.ev_prepare _watcher
      
          def __cinit__(self, loop loop, ref=True, priority=None):
              libev.ev_prepare_init(&self._watcher, <void*>gevent_callback_prepare)
              self.__watcher = <libev.ev_watcher*>&self._watcher
              self.__ss = &prepare_ss
                          ^
      ------------------------------------------------------------
      
      src/gevent/libev/corecext.pyx:1147:20: Cannot convert 'start_and_stop *' to Python object
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
      
          cdef libev.ev_check _watcher
      
          def __cinit__(self, loop loop, ref=True, priority=None):
              libev.ev_check_init(&self._watcher, <void*>gevent_callback_check)
              self.__watcher = <libev.ev_watcher*>&self._watcher
                               ^
      ------------------------------------------------------------
      
      src/gevent/libev/corecext.pyx:1159:25: Cannot convert 'ev_watcher *' to Python object
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
          cdef libev.ev_check _watcher
      
          def __cinit__(self, loop loop, ref=True, priority=None):
              libev.ev_check_init(&self._watcher, <void*>gevent_callback_check)
              self.__watcher = <libev.ev_watcher*>&self._watcher
              self.__ss = &check_ss
                          ^
      ------------------------------------------------------------
      
      src/gevent/libev/corecext.pyx:1160:20: Cannot convert 'start_and_stop *' to Python object
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
      
          cdef libev.ev_fork _watcher
      
          def __cinit__(self, loop loop, ref=True, priority=None):
              libev.ev_fork_init(&self._watcher, <void*>gevent_callback_fork)
              self.__watcher = <libev.ev_watcher*>&self._watcher
                               ^
      ------------------------------------------------------------
      
      src/gevent/libev/corecext.pyx:1172:25: Cannot convert 'ev_watcher *' to Python object
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
          cdef libev.ev_fork _watcher
      
          def __cinit__(self, loop loop, ref=True, priority=None):
              libev.ev_fork_init(&self._watcher, <void*>gevent_callback_fork)
              self.__watcher = <libev.ev_watcher*>&self._watcher
              self.__ss = &fork_ss
                          ^
      ------------------------------------------------------------
      
      src/gevent/libev/corecext.pyx:1173:20: Cannot convert 'start_and_stop *' to Python object
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
              # Note the use of ev_async_pending instead of ev_is_pending
              return True if libev.ev_async_pending(&self._watcher) else False
      
          def __cinit__(self, loop loop, ref=True, priority=None):
              libev.ev_async_init(&self._watcher, <void*>gevent_callback_async)
              self.__watcher = <libev.ev_watcher*>&self._watcher
                               ^
      ------------------------------------------------------------
      
      src/gevent/libev/corecext.pyx:1189:25: Cannot convert 'ev_watcher *' to Python object
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
              return True if libev.ev_async_pending(&self._watcher) else False
      
          def __cinit__(self, loop loop, ref=True, priority=None):
              libev.ev_async_init(&self._watcher, <void*>gevent_callback_async)
              self.__watcher = <libev.ev_watcher*>&self._watcher
              self.__ss = &async_ss
                          ^
      ------------------------------------------------------------
      
      src/gevent/libev/corecext.pyx:1190:20: Cannot convert 'start_and_stop *' to Python object
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
                  raise AttributeError("Child watchers are not supported on Windows")
              if not loop.default:
                  raise TypeError('child watchers are only available on the default loop')
              libev.gevent_install_sigchld_handler()
              libev.ev_child_init(&self._watcher, <void *>gevent_callback_child, pid, trace)
              self.__watcher = <libev.ev_watcher*>&self._watcher
                               ^
      ------------------------------------------------------------
      
      src/gevent/libev/corecext.pyx:1212:25: Cannot convert 'ev_watcher *' to Python object
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
              if not loop.default:
                  raise TypeError('child watchers are only available on the default loop')
              libev.gevent_install_sigchld_handler()
              libev.ev_child_init(&self._watcher, <void *>gevent_callback_child, pid, trace)
              self.__watcher = <libev.ev_watcher*>&self._watcher
              self.__ss = &child_ss
                          ^
      ------------------------------------------------------------
      
      src/gevent/libev/corecext.pyx:1213:20: Cannot convert 'start_and_stop *' to Python object
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
                  self._paths = paths
              else:
                  paths = <bytes>path
                  self._paths = paths
              libev.ev_stat_init(&self._watcher, <void *>gevent_callback_stat, <char*>paths, interval)
              self.__watcher = <libev.ev_watcher*>&self._watcher
                               ^
      ------------------------------------------------------------
      
      src/gevent/libev/corecext.pyx:1263:25: Cannot convert 'ev_watcher *' to Python object
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
              else:
                  paths = <bytes>path
                  self._paths = paths
              libev.ev_stat_init(&self._watcher, <void *>gevent_callback_stat, <char*>paths, interval)
              self.__watcher = <libev.ev_watcher*>&self._watcher
              self.__ss = &stat_ss
                          ^
      ------------------------------------------------------------
      
      src/gevent/libev/corecext.pyx:1264:20: Cannot convert 'start_and_stop *' to Python object
      Compiling src/gevent/libev/corecext.pyx because it changed.
      [1/1] Cythonizing src/gevent/libev/corecext.pyx
      Traceback (most recent call last):
        File "/home/kurasawa/.espressif/python_env/idf4.4_py3.11_env/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/home/kurasawa/.espressif/python_env/idf4.4_py3.11_env/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/kurasawa/.espressif/python_env/idf4.4_py3.11_env/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-1tbqznqf/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 327, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-1tbqznqf/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 297, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-1tbqznqf/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 497, in run_setup
          super().run_setup(setup_script=setup_script)
        File "/tmp/pip-build-env-1tbqznqf/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 313, in run_setup
          exec(code, locals())
        File "<string>", line 49, in <module>
        File "/tmp/pip-install-2mat3cfh/gevent_c6be0862f1634d05b94729a95d756777/_setuputils.py", line 254, in cythonize1
          new_ext = cythonize(
                    ^^^^^^^^^^
        File "/tmp/pip-build-env-1tbqznqf/overlay/lib/python3.11/site-packages/Cython/Build/Dependencies.py", line 1154, in cythonize
          cythonize_one(*args)
        File "/tmp/pip-build-env-1tbqznqf/overlay/lib/python3.11/site-packages/Cython/Build/Dependencies.py", line 1321, in cythonize_one
          raise CompileError(None, pyx_file)
      Cython.Compiler.Errors.CompileError: src/gevent/libev/corecext.pyx
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

[notice] A new release of pip is available: 24.1 -> 24.1.2
[notice] To update, run: python -m pip install --upgrade pip
Traceback (most recent call last):
  File "/home/kurasawa/.local/share/esp32/esp-idf/tools/idf_tools.py", line 1970, in <module>
    main(sys.argv[1:])
  File "/home/kurasawa/.local/share/esp32/esp-idf/tools/idf_tools.py", line 1966, in main
    action_func(args)
  File "/home/kurasawa/.local/share/esp32/esp-idf/tools/idf_tools.py", line 1616, in action_install_python_env
    subprocess.check_call(run_args, stdout=sys.stdout, stderr=sys.stderr, env=env_copy)
  File "/usr/local/lib/python3.11/subprocess.py", line 413, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/home/kurasawa/.espressif/python_env/idf4.4_py3.11_env/bin/python', '-m', 'pip', 'install', '--no-warn-script-location', '-r', '/home/kurasawa/.local/share/esp32/esp-idf/requirements.txt', '--extra-index-url', 'https://dl.espressif.com/pypi']' returned non-zero exit status 1.
@KuraZuzu
Copy link
Collaborator Author

xs-devや、大本のesp-idfで既知の不具合という報告がある。

@KuraZuzu
Copy link
Collaborator Author

KuraZuzu commented Jul 11, 2024

解決策

Ubuntu 22.04側のPython3のバージョンを3.10に引き下げ、最初からスタックチャンの環境を再構築する。

Python3のシンボリックリンクを、Ubuntu 22.04インストール時のシステムにデフォルトであるPython3.10に再設定した。

手順

使用するPython3のバージョンを3.10に再設定する

$ which python3
/usr/bin/python3

一度インストールしたスタックチャン関連の環境(ディレクトリ・ファイル)を削除する

スタックチャンのディレクトリやModdable、ESP-IDF、設定スクリプトを削除する

$ rm -r ~/.local/share/moddable
$ rm -r ~/.espressif
$ rm -r ~/.local/share/esp32
$ rm -r ~/stack-chan
$ rm ~/.local/share$ cat xs-dev-export.sh 

~/.bashrcに追加されているコマンドsource /home/kurasawa/.local/share/xs-dev-export.shを削除する

 $ nano ~/.bashrc

(中略)
source /home/kurasawa/.local/share/xs-dev-export.sh

ターミナルを再起動する。

Linux向けの手順書に沿って再度環境を構築する

無事にビルドできるようになった

環境構築時に環境変数が自動で追加されるため、Python3の指すパスは以下のようになっている。実態はPython3.10であり、Python3.11を使っているとidf4.4_py3.11_envというパスになっている。

$ which python3
/home/<ユーザー名>/.espressif/python_env/idf4.4_py3.10_env/bin/python3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant