我已经使用死蛇ppa在Ubuntu18.04(系统版本Python3.6.9)上安装了Python3.10。我想使用Python3.10安装一个数值包"Firedrake“。Firedrake不使用默认Python版本(3.6.9)进行安装。当我发出命令:python3.10 firedrake-install
(firedrake是安装firedrake的脚本)时,python3.10仍然尝试使用默认的python3.10 (3.6.9),最后出现以下错误:
Traceback (most recent call last):
File "/home/salil/firedrake-install", line 19, in
from pkg_resources import parse_version
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 77, in
import('pkg_resources.extern.packaging.requirements')
File "/usr/lib/python3/dist-packages/pkg_resources/_vendor/packaging/requirements.py", line 9, in
from pkg_resources.extern.pyparsing import stringStart, stringEnd, originalTextFor, ParseException
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 672, in _load_unlocked
File "", line 632, in _load_backward_compatible
File "/usr/lib/python3/dist-packages/pkg_resources/extern/init.py", line 43, in load_module
import(extant)
File "/usr/lib/python3/dist-packages/pkg_resources/_vendor/pyparsing.py", line 943, in
collections.MutableMapping.register(ParseResults)
AttributeError: module 'collections' has no attribute 'MutableMapping'
我不太熟悉Python,因此不知道如何修复此错误;即如何强制python3.10使用/usr/lib/python3.10。
发布于 2022-10-18 05:15:43
我遇到的问题似乎与这个错误有关。我能够用:git clone https://github.com/pypa/setuptools.git && cd setuptools && sudo python3.10 setup.py install
和curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10
来解决这个问题
公平地说,我不理解bug的细节,但是上面的两个命令解决了我的问题。
https://stackoverflow.com/questions/74099759
复制相似问题