在Python Docker 3.9-3.12中安装apache-flink 1.19.0失败求助
安装PyFlink 1.19.0在Docker Python环境中遇到NoneType路径错误
按照官方教程在Python Docker 3.9-3.12环境中安装PyFlink/apache-flink 1.19.0时遇到困难,报错与返回NoneType的路径有关,不确定如何修复。Python 3.12的报错信息与其他版本一致,暂不附上。
Python 3.9
执行命令:docker run -it python:3.9 python -m pip install apache-flink
× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [22 lines of output] Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module> main() File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main json_out['return_val'] = hook(**hook_input['kwargs']) File "/usr/local/lib/python3.9/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-rdoi1tww/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 162, in get_requires_for_build_wheel return self._get_build_requires( File "/tmp/pip-build-env-rdoi1tww/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 143, in _get_build_requires self.run_setup() File "/tmp/pip-build-env-rdoi1tww/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 267, in run_setup super(_BuildMetaLegacyBackend, File "/tmp/pip-build-env-rdoi1tww/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 158, in run_setup exec(compile(code, __file__, 'exec'), locals()) File "setup.py", line 169, in <module> include_dirs=get_java_include() + ['src/main/c/pemja/core/include'], File "setup.py", line 111, in get_java_include inc = os.path.join(get_java_home(), inc_name) File "/usr/local/lib/python3.9/posixpath.py", line 76, in join a = os.fspath(a) TypeError: expected str, bytes or os.PathLike object, not NoneType [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.
Python 3.10
执行命令:docker run -it python:3.10 python -m pip install apache-flink
× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [22 lines of output] Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module> main() File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main json_out['return_val'] = hook(**hook_input['kwargs']) File "/usr/local/lib/python3.10/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-ptcni4h1/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 162, in get_requires_for_build_wheel return self._get_build_requires( File "/tmp/pip-build-env-ptcni4h1/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 143, in _get_build_requires self.run_setup() File "/tmp/pip-build-env-ptcni4h1/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 267, in run_setup super(_BuildMetaLegacyBackend, File "/tmp/pip-build-env-ptcni4h1/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 158, in run_setup exec(compile(code, __file__, 'exec'), locals()) File "setup.py", line 169, in <module> include_dirs=get_java_include() + ['src/main/c/pemja/core/include'], File "setup.py", line 111, in get_java_include inc = os.path.join(get_java_home(), inc_name) File "/usr/local/lib/python3.10/posixpath.py", line 76, in join a = os.fspath(a) TypeError: expected str, bytes or os.PathLike object, not NoneType [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.
Python 3.11
执行命令:docker run -it python:3.11 python -m pip install apache-flink
× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [27 lines of output] Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module> main() File "/usr/local/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 "/usr/local/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-jpt4cjc2/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 162, in get_requires_for_build_wheel return self._get_build_requires( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/pip-build-env-jpt4cjc2/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 143, in _get_build_requires self.run_setup() File "/tmp/pip-build-env-jpt4cjc2/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 268, in run_setup self).run_setup(setup_script=setup_script) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/pip-build-env-jpt4cjc2/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 158, in run_setup exec(compile(code, __file__, 'exec'), locals()) File "setup.py", line 169, in <module> include_dirs=get_java_include() + ['src/main/c/pemja/core/include'], ^^^^^^^^^^^^^^^^^^ File "setup.py", line 111, in get_java_include inc = os.path.join(get_java_home(), inc_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "<frozen posixpath>", line 76, in join TypeError: expected str, bytes or os.PathLike object, not NoneType [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.
更新于2024年4月15日
该操作在Windows系统可成功,但在Mac上执行docker run -it python:3.11 pip install apache-flink时失败,是否是权限问题?
Mac配置:
- M1 Max
- Sonoma 14.4.1
报错信息:
× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [27 lines of output] Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module> main() File "/usr/local/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 "/usr/local/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-r8xb1epe/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 162, in get_requires_for_build_wheel return self._get_build_requires( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/pip-build-env-r8xb1epe/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 143, in _get_build_requires self.run_setup() File "/tmp/pip-build-env-r8xb1epe/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 268, in run_setup self).run_setup(setup_script=setup_script) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/pip-build-env-r8xb1epe/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 158, in run_setup exec(compile(code, __file__, 'exec'), locals()) File "setup.py", line 169, in <module> include_dirs=get_java_include() + ['src/main/c/pemja/core/include'], ^^^^^^^^^^^^^^^^^^ File "setup.py", line 111, in get_java_include inc = os.path.join(get_java_home(), inc_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "<frozen posixpath>", line 76, in join TypeError: expected str, bytes or os.PathLike object, not NoneType [end of output] note: This error originates from a subprocess, and is likely not a problem with pip.
内容的提问来源于stack exchange,提问作者Ellery Leung
相关产品推荐
相关产品推荐

