cnmaps icon indicating copy to clipboard operation
cnmaps copied to clipboard

PIP安装报错 “AttributeError: module 'pkgutil' has no attribute 'ImpImporter'

Open Ray-exia opened this issue 1 year ago • 5 comments

PIP安装报错, python 3.12 , pip 24.2

好像是因为原有的依赖被3.12抛弃后导致的,换个环境吗解决吗???

(venv) C:\PyProject\PythonProject pip install cnmaps Collecting cnmaps Using cached cnmaps-1.1.8-py3-none-any.whl.metadata (5.4 kB) Collecting cartopy>=0.22.0 (from cnmaps) Using cached Cartopy-0.23.0-cp312-cp312-win_amd64.whl.metadata (8.2 kB) Collecting fiona>=1.8.20 (from cnmaps) Using cached fiona-1.10.0-cp312-cp312-win_amd64.whl.metadata (57 kB) Collecting geojson>=2.5.0 (from cnmaps) Using cached geojson-3.1.0-py3-none-any.whl.metadata (16 kB) Collecting geopandas>=0.10.2 (from cnmaps) Using cached geopandas-1.0.1-py3-none-any.whl.metadata (2.2 kB) Collecting matplotlib>=3.4.2 (from cnmaps) Using cached matplotlib-3.9.2-cp312-cp312-win_amd64.whl.metadata (11 kB) Collecting netcdf4>=1.5.8 (from cnmaps) Using cached netCDF4-1.7.1.post2-cp312-cp312-win_amd64.whl.metadata (1.8 kB) Collecting numba>=0.56.0 (from cnmaps) Using cached numba-0.60.0-cp312-cp312-win_amd64.whl.metadata (2.8 kB) Requirement already satisfied: numpy>=1.21.5 in c:\pyproject\pythonproject\venv\lib\site-packages (from cnmaps) (2.0.1) Collecting orjson>=3.7.11 (from cnmaps) Using cached orjson-3.10.7-cp312-none-win_amd64.whl.metadata (51 kB) Collecting scipy>=1.8 (from cnmaps) Using cached scipy-1.14.1-cp312-cp312-win_amd64.whl.metadata (60 kB) Collecting shapely<2.0,>=1.8.0 (from cnmaps) Using cached Shapely-1.8.5.post1.tar.gz (200 kB) 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 ╰─> [33 lines of output] Traceback (most recent call last): File "C:\PyProject\PythonProject\venv\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 353, in main() File "C:\PyProject\PythonProject\venv\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 335, in main json_out['return_val'] = hook(**hook_input['kwargs']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\PyProject\PythonProject\venv\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 112, in get_requires_for_build_wheel backend = _build_backend() ^^^^^^^^^^^^^^^^ File "C:\PyProject\PythonProject\venv\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 77, in build_backend obj = import_module(mod_path) ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Admin\AppData\Local\Programs\Python\Python312\Lib\importlib_init.py", line 90, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1387, in _gcd_import File "", line 1360, in _find_and_load File "", line 1310, in _find_and_load_unlocked File "", line 488, in _call_with_frames_removed File "", line 1387, in _gcd_import File "", line 1360, in _find_and_load File "", line 1331, in _find_and_load_unlocked File "", line 935, in load_unlocked File "", line 995, in exec_module File "", line 488, in call_with_frames_removed File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-fmyqwzd7\overlay\Lib\site-packages\setuptools_init.py", line 16, in import setuptools.version File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-fmyqwzd7\overlay\Lib\site-packages\setuptools\version.py", line 1, in import pkg_resources File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-fmyqwzd7\overlay\Lib\site-packages\pkg_resources_init.py", line 2191, in register_finder(pkgutil.ImpImporter, find_on_path) ^^^^^^^^^^^^^^^^^^^ AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'? [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.

Ray-exia avatar Sep 09 '24 06:09 Ray-exia

@Ray-exia 目前最新版本的 Python 确实无法支持安装 cnmaps

Clarmy avatar Sep 09 '24 17:09 Clarmy

@Ray-exia 目前最新版本的 Python 确实无法支持安装 cnmaps 好的,谢谢大佬回复我一个编程小白。

Ray-exia avatar Sep 11 '24 01:09 Ray-exia

请问,这个问题大概什么时候可以解决,谢谢大佬~

zq200866 avatar Sep 30 '24 01:09 zq200866

当前我使用 uv 管理 python 版本和依赖,降到 3.10 完事儿。

BeiyanYunyi avatar Feb 23 '25 13:02 BeiyanYunyi

谢谢,我改用了3.10 ok了

Get Outlook for iOShttps://aka.ms/o0ukef


From: 北雁云依 @.> Sent: Sunday, February 23, 2025 9:33:22 PM To: cnmetlab/cnmaps @.> Cc: Ray-exia @.>; Mention @.> Subject: Re: [cnmetlab/cnmaps] PIP安装报错 “AttributeError: module 'pkgutil' has no attribute 'ImpImporter' (Issue #135)

当前我使用 uv 管理 python 版本和依赖,降到 3.10 完事儿。

― Reply to this email directly, view it on GitHubhttps://github.com/cnmetlab/cnmaps/issues/135#issuecomment-2676864766, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AUXXGEUIZX62M77FV3EET2L2RHE2FAVCNFSM6AAAAABN3ZRLYOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNZWHA3DINZWGY. You are receiving this because you were mentioned.Message ID: @.***>

[BeiyanYunyi]BeiyanYunyi left a comment (cnmetlab/cnmaps#135)https://github.com/cnmetlab/cnmaps/issues/135#issuecomment-2676864766

当前我使用 uv 管理 python 版本和依赖,降到 3.10 完事儿。

― Reply to this email directly, view it on GitHubhttps://github.com/cnmetlab/cnmaps/issues/135#issuecomment-2676864766, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AUXXGEUIZX62M77FV3EET2L2RHE2FAVCNFSM6AAAAABN3ZRLYOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNZWHA3DINZWGY. You are receiving this because you were mentioned.Message ID: @.***>

Ray-exia avatar Feb 24 '25 01:02 Ray-exia