前提
Rasberry Pi 4 Bモデル
Python 3.10.3
Pyenv
実現したいこと
PythonモジュールSeleniumをインストールしたい
発生している問題・エラーメッセージ
下記のエラーにより先に進めません。
Defaulting to user installation because normal site-packages is not writeable Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple Collecting selenium Using cached selenium-4.4.0-py3-none-any.whl (985 kB) Collecting urllib3[secure,socks]~=1.26 Using cached https://www.piwheels.org/simple/urllib3/urllib3-1.26.11-py2.py3-none-any.whl (139 kB) Collecting trio~=0.17 Using cached https://www.piwheels.org/simple/trio/trio-0.21.0-py3-none-any.whl (358 kB) Collecting trio-websocket~=0.9 Using cached https://www.piwheels.org/simple/trio-websocket/trio_websocket-0.9.2-py3-none-any.whl (16 kB) Requirement already satisfied: async-generator>=1.9 in ./.local/lib/python3.10/site-packages (from trio~=0.17->selenium) (1.10) Collecting idna Using cached https://www.piwheels.org/simple/idna/idna-3.3-py3-none-any.whl (64 kB) Requirement already satisfied: sortedcontainers in ./.local/lib/python3.10/site-packages (from trio~=0.17->selenium) (2.4.0) Collecting outcome Using cached https://www.piwheels.org/simple/outcome/outcome-1.2.0-py2.py3-none-any.whl (9.7 kB) Requirement already satisfied: sniffio in ./.local/lib/python3.10/site-packages (from trio~=0.17->selenium) (1.2.0) Requirement already satisfied: attrs>=19.2.0 in ./.local/lib/python3.10/site-packages (from trio~=0.17->selenium) (22.1.0) Requirement already satisfied: wsproto>=0.14 in ./.local/lib/python3.10/site-packages (from trio-websocket~=0.9->selenium) (1.1.0) Collecting cryptography>=1.3.4 Using cached cryptography-37.0.4.tar.gz (585 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... error error: subprocess-exited-with-error × Preparing metadata (pyproject.toml) did not run successfully. x exit code: 1 mq> [96 lines of output] running dist_info creating /tmp/pip-modern-metadata-r0vbqxhx/cryptography.egg-info writing /tmp/pip-modern-metadata-r0vbqxhx/cryptography.egg-info/PKG-INFO writing dependency_links to /tmp/pip-modern-metadata-r0vbqxhx/cryptography.egg-info/dependency_links.txt writing requirements to /tmp/pip-modern-metadata-r0vbqxhx/cryptography.egg-info/requires.txt writing top-level names to /tmp/pip-modern-metadata-r0vbqxhx/cryptography.egg-info/top_level.txt writing manifest file '/tmp/pip-modern-metadata-r0vbqxhx/cryptography.egg-info/SOURCES.txt' reading manifest file '/tmp/pip-modern-metadata-r0vbqxhx/cryptography.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' no previously-included directories found matching 'docs/_build' warning: no previously-included files found matching 'vectors' warning: no previously-included files matching '*' found under directory 'vectors' warning: no previously-included files matching '*' found under directory '.github' warning: no previously-included files found matching 'release.py' warning: no previously-included files found matching '.coveragerc' warning: no previously-included files found matching 'codecov.yml' warning: no previously-included files found matching '.readthedocs.yml' warning: no previously-included files found matching 'dev-requirements.txt' warning: no previously-included files found matching 'tox.ini' warning: no previously-included files found matching 'mypy.ini' warning: no previously-included files matching '*' found under directory '.circleci' adding license file 'LICENSE' adding license file 'LICENSE.APACHE' adding license file 'LICENSE.BSD' adding license file 'LICENSE.PSF' writing manifest file '/tmp/pip-modern-metadata-r0vbqxhx/cryptography.egg-info/SOURCES.txt' creating '/tmp/pip-modern-metadata-r0vbqxhx/cryptography-37.0.4.dist-info' =============================DEBUG ASSISTANCE============================= If you are seeing a compilation error please try the following steps to successfully install cryptography: 1) Upgrade to the latest pip and try again. This will fix errors for most users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip 2) Read https://cryptography.io/en/latest/installation/ for specific instructions for your platform. 3) Check our frequently asked questions for more information: https://cryptography.io/en/latest/faq/ 4) Ensure you have a recent Rust toolchain installed: https://cryptography.io/en/latest/installation/#rust Python: 3.10.3 platform: Linux-5.15.32-v7l+-armv7l-with-glibc2.31 pip: n/a setuptools: 64.0.1 setuptools_rust: 1.5.0 =============================DEBUG ASSISTANCE============================= Traceback (most recent call last): File "/home/hyugo/.local/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module> main() File "/home/hyugo/.local/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main json_out['return_val'] = hook(**hook_input['kwargs']) File "/home/hyugo/.local/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 164, in prepare_metadata_for_build_wheel return hook(metadata_directory, config_settings) File "/tmp/pip-build-env-0fovon24/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 369, in prepare_metadata_for_build_wheel self.run_setup() File "/tmp/pip-build-env-0fovon24/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 334, in run_setup exec(code, locals()) File "<string>", line 39, in <module> File "/tmp/pip-build-env-0fovon24/overlay/lib/python3.10/site-packages/setuptools/__init__.py", line 87, in setup return distutils.core.setup(**attrs) File "/tmp/pip-build-env-0fovon24/overlay/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 185, in setup return run_commands(dist) File "/tmp/pip-build-env-0fovon24/overlay/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 201, in run_commands dist.run_commands() File "/tmp/pip-build-env-0fovon24/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 973, in run_commands self.run_command(cmd) File "/tmp/pip-build-env-0fovon24/overlay/lib/python3.10/site-packages/setuptools/dist.py", line 1217, in run_command super().run_command(command) File "/tmp/pip-build-env-0fovon24/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 992, in run_command cmd_obj.run() File "/tmp/pip-build-env-0fovon24/overlay/lib/python3.10/site-packages/setuptools/command/dist_info.py", line 101, in run bdist_wheel = self.get_finalized_command('bdist_wheel') File "/tmp/pip-build-env-0fovon24/overlay/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 305, in get_finalized_command cmd_obj = self.distribution.get_command_obj(command, create) File "/tmp/pip-build-env-0fovon24/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 864, in get_command_obj klass = self.get_command_class(command) File "/tmp/pip-build-env-0fovon24/overlay/lib/python3.10/site-packages/setuptools/dist.py", line 954, in get_command_class self.cmdclass[command] = cmdclass = ep.load() File "/usr/local/lib/python3.10/importlib/metadata/__init__.py", line 171, in load module = import_module(match.group('module')) File "/usr/local/lib/python3.10/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1050, in _gcd_import File "<frozen importlib._bootstrap>", line 1027, in _find_and_load File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 688, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 883, in exec_module File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "/tmp/pip-build-env-0fovon24/overlay/lib/python3.10/site-packages/wheel/bdist_wheel.py", line 26, in <module> from .macosx_libfile import calculate_macosx_platform_tag File "/tmp/pip-build-env-0fovon24/overlay/lib/python3.10/site-packages/wheel/macosx_libfile.py", line 41, in <module> import ctypes File "/usr/local/lib/python3.10/ctypes/__init__.py", line 8, in <module> from _ctypes import Union, Structure, Array ModuleNotFoundError: No module named '_ctypes' [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed × Encountered error while generating package metadata. mq> See above for output. note: This is an issue with the package mentioned above, not pip. hint: See above for details.
該当のソースコード
python3 -m pip install selenium
試したこと
Pythonの再インストール
libffi のインストール
解決策や原因のご教示お願い致します。
メッセージからはpyenvを使っている雰囲気は感じられません。
OSがなにか、
pyenv versions
which python
pyenv which python
あたりの結果を質問を編集して載せるといいかもしれません。
あとpyenvのインストール方法を見直してみてはどうでしょう。
https://github.com/pyenv/pyenv
https://github.com/pyenv/pyenv/wiki#suggested-build-environment
と書いたところで、pyenvが対応しているOSを使っているのか疑問になってきました。

回答1件
あなたの回答
tips
プレビュー