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

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

Open
Ray-exia opened this issue Sep 9, 2024 · 3 comments

Comments

@Ray-exia
Copy link

Ray-exia commented Sep 9, 2024

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.

@Clarmy
Copy link
Member

Clarmy commented Sep 9, 2024

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

@Ray-exia
Copy link
Author

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

@zq200866
Copy link

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

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

3 participants