执行 ./stack.sh 时,setuptools 替换 disutils 时出现上述错误。我使用的是 Ubuntu Server 20.04 VM 并遵循这链接。互联网上没有太多关于此错误的信息。任何帮助都将不胜感激。
整个堆栈跟踪看起来像
/usr/local/lib/python3.8/dist-packages/_distutils_hack/__init__.py:24:
UserWarning: Distutils was imported before Setuptools, but importing
Setuptools also replaces the `distutils` module in `sys.modules`. This
may lead to undesirable behaviors or errors. To avoid these issues,
avoid using distutils directly, ensure that setuptools is installed in
the traditional way (e.g. not an editable install), and/or make sure
that setuptools is always imported before distutils.
warnings.warn(
/usr/local/lib/python3.8/dist-packages/_distutils_hack/__init__.py:36:
UserWarning: Setuptools is replacing distutils.
warnings.warn("Setuptools is replacing distutils.")
Traceback (most recent call last):
File "/opt/stack/devstack/files/get-pip.py", line 27081, in <module>
main()
File "/opt/stack/devstack/files/get-pip.py", line 139, in main
bootstrap(tmpdir=tmpdir)
File "/opt/stack/devstack/files/get-pip.py", line 120, in bootstrap
args = determine_pip_install_arguments()
File "/opt/stack/devstack/files/get-pip.py", line 65, in
determine_pip_install_arguments
import setuptools # noqa
File "/usr/local/lib/python3.8/dist-packages/setuptools/__init__.py",
line 8, in <module>
import _distutils_hack.override # noqa: F401
File "/usr/local/lib/python3.8/dist-
packages/_distutils_hack/override.py", line 1, in <module>
__import__('_distutils_hack').do_override()
File "/usr/local/lib/python3.8/dist-
packages/_distutils_hack/__init__.py", line 73, in do_override
ensure_local_distutils()
File "/usr/local/lib/python3.8/dist-
packages/_distutils_hack/__init__.py", line 61, in
ensure_local_distutils
assert '_distutils' in core.__file__, core.__file__
AssertionError: /usr/lib/python3.8/distutils/core.py
++./stack.sh:main:789 err_trap
++./stack.sh:err_trap:562 local r=1
++./stack.sh:err_trap:563 set +o xtrace
stack.sh failed
Error on exit
World dumping... see /opt/stack/logs/worlddump-2022-01-07-072759.txt for
details`
日志文件显示以下警告
File System Summary
===================
WARN: Device /dev/loop0 (/snap/core18/1880) is 100% full, might be an
issue
WARN: Device /dev/loop1 (/snap/gnome-3-34-1804/36) is 100% full, might
be an issue
WARN: Device /dev/loop2 (/snap/gtk-common-themes/1506) is 100% full,
might be an issue
WARN: Device /dev/loop3 (/snap/snap-store/467) is 100% full, might be an
issue
WARN: Device /dev/loop4 (/snap/snapd/8542) is 100% full, might be an
issue
WARN: Device /dev/loop5 (/snap/snapd/14295) is 100% full, might be an
issue
WARN: Device /dev/loop6 (/snap/core18/2253) is 100% full, might be an
issue
WARN: Device /dev/loop7 (/snap/bare/5) is 100% full, might be an issue
WARN: Device /dev/loop8 (/snap/core20/1270) is 100% full, might be an
issue
WARN: Device /dev/loop9 (/snap/gtk-common-themes/1519) is 100% full,
might be an issue
WARN: Device /dev/loop10 (/snap/gnome-3-34-1804/77) is 100% full, might
be an issue
WARN: Device /dev/loop11 (/snap/snap-store/558) is 100% full, might be
an issue
WARN: Device /dev/loop12 (/snap/gnome-3-38-2004/87) is 100% full, might
be an issue
但没有确切的错误陈述。
答案1
我也有这个问题,完全一样。
在此之前我遇到了另一个错误。这是关于主机 IP 的,在我修复它之后,我遇到了这个错误,就像你一样 :v 关键是第一个错误做了一些事情,导致 openstack 的 pip(Python 包安装程序)与 ubuntu 的 pip 不匹配,从而导致新的错误。
我不知道如何修复 pip。所以我创建了一个全新的 VM 并重新开始,然后成功了!我使用 Azure 的 VM,因此速度很快,我可以快速重新开始。无论如何,如果你无法修复 pip 的问题,你应该在全新的 VM 上重试,它不应该出现此错误
顺便说一句,我也像您一样使用服务器 Ubuntu 20.04.3 LTS,其他信息如下:
- Python 3.8.10
- 2 个 vCPU,8 GB RAM(您至少应使用 6 个 RAM,否则将收到错误“c-api 未启动”)