gpt4 book ai didi

python - 尝试在 ubuntu 上安装 arosics 时出现 ImportError : cannot import name util,

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:17:21 32 4
gpt4 key购买 nike

尝试在 ubuntu 16.04 LTS 上安装 AROSICS ( https://pypi.python.org/pypi/arosics/0.8.2) 时。

当我这样做时:

~$ sudo pip install arosics

然后我得到:

The directory '/home/user/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/user/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting arosics
Downloading arosics-0.8.4.tar.gz (21.9MB)
100% |################################| 21.9MB 32kB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-PRYU7V/arosics/setup.py", line 8, in <module>
from importlib import util
ImportError: cannot import name util

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-PRYU7V/arosics/

还试过:

sudo -H pip install arosics
Collecting arosics
Downloading arosics-0.8.4.tar.gz (21.9MB)
100% |################################| 21.9MB 23kB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-cTU5Br/arosics/setup.py", line 8, in <module>
from importlib import util
ImportError: cannot import name util

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-cTU5Br/arosics/

我不确定出了什么问题。我尝试了 pip install python-util 但在那之后我一直收到上面相同的错误。

请问如何进行?

最佳答案

Arosics 目前只能与 Python3 一起使用。 from importutil import util 在 Python 2.7 下不起作用,因为它不受支持。

如果切换到 Python3 是一个选项,那么您就可以开始了。如果不是,则必须修改 Arosics 项目的 setup.py。

我能够使用 sudo pip3 install arosics 成功安装

关于python - 尝试在 ubuntu 上安装 arosics 时出现 ImportError : cannot import name util,,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49164347/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com