trafficstars
Bug description
Error on installation: AttributeError: module 'pkgutil' has no attribute 'ImpImporter'
Using: pip install metagpt
` 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 "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in
main()
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 112, in get_requires_for_build_wheel
backend = _build_backend()
^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 77, in _build_backend
obj = import_module(mod_path)
^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/importlib/init.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1381, in _gcd_import
File "", line 1354, in _find_and_load
File "", line 1304, in _find_and_load_unlocked
File "", line 488, in _call_with_frames_removed
File "", line 1381, in _gcd_import
File "", line 1354, in _find_and_load
File "", line 1325, in _find_and_load_unlocked
File "", line 929, in _load_unlocked
File "", line 994, in exec_module
File "", line 488, in _call_with_frames_removed
File "/private/var/folders/63/lcq7qhm16nxch3cywq18yt_m0000gn/T/pip-build-env-dkeg_8za/overlay/lib/python3.12/site-packages/setuptools/init.py", line 16, in
import setuptools.version
File "/private/var/folders/63/lcq7qhm16nxch3cywq18yt_m0000gn/T/pip-build-env-dkeg_8za/overlay/lib/python3.12/site-packages/setuptools/version.py", line 1, in
import pkg_resources
File "/private/var/folders/63/lcq7qhm16nxch3cywq18yt_m0000gn/T/pip-build-env-dkeg_8za/overlay/lib/python3.12/site-packages/pkg_resources/init.py", line 2172, 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.`
Screenshots or logs
Resolved when running install on python 3.11 vs 3.12
python3.11 -m pip install metagpt
Recommend using Python 3.9 or 3.10.
Newer versions of Python may encounter situations where pip packages are not yet supported.
This isn't a matter of pip packages not yet supported, but rather the dependency versions constraints of MetaGPT are too old.
numpy<1.25.0 being a prime example.
@voidking can you help us test 3.12? If successful, maybe we can add a versioned ci/cd script that does not run by default, but can be triggered manually