How to solve this error ImportError: cannot import name 'StaticModule' from 'setuptools.config'?

How to solve this error ImportError: cannot import name 'StaticModule' from 'setuptools.config'?

我正在尝试使用 pip install . 安装 python 软件包,但在安装过程中出现错误:

更新:

  File "/Users/user/miniconda3/envs/galaxy-lab/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 972, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/private/var/folders/8w/ldbd6zrd2dd87g6vlckzjn193kdndm/T/pip-build-env-07a9m59q/overlay/lib/python3.9/site-packages/jupyter_packaging/__init__.py", line 6, in <module>
    from .setupbase import *
  File "/private/var/folders/8w/ldbd6zrd2dd87g6vlckzjn193kdndm/T/pip-build-env-07a9m59q/overlay/lib/python3.9/site-packages/jupyter_packaging/setupbase.py", line 37, in <module>
    from setuptools.config import StaticModule
ImportError: cannot import name 'StaticModule' from 'setuptools.config' (/private/var/folders/8w/ldbd6zrd2dd87g6vlckzjn193kdndm/T/pip-build-env-07a9m59q/overlay/lib/python3.9/site-packages/setuptools/config/__init__.py)

更新

python 套餐

https://github.com/g2nb/nbtools/tree/lab

pip版本

pip 21.2.4

Python

python 3.9

我尝试重新安装 setuptoolsjupyter_packaging,但没有解决问题。

如何解决这个问题?

谢谢

setuptools 61 将 setuptools.config.StaticModule 移动到 setuptools.config.expand.StaticModule(参见 #365). This bug was reported to the jupyter-packaging developers in #130 and fixed in #131,它最初包含在 jupyter-packaging 0.12 中。因此要么降级到 setuptools 60,要么升级到 jupyter-packaging 0.12 应该可以解决你的问题。