ImportError:尝试在ubuntu上安装arosics时无法导入名称util

时间:2021-11-07 23:41:19

While trying to install AROSICS (https://pypi.python.org/pypi/arosics/0.8.2) on ubuntu 16.04 LTS.

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

When I do:

当我做:

~$ sudo pip install arosics

Then I get:

然后我得到:

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/

Also tried:

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/

I'm not sure what is going wrong. I tried to pip install python-util but event after that I keep getting the same error above.

我不确定出了什么问题。我尝试pip安装python-util但事件之后我一直得到同样的错误。

May I ask how to proceed?

请问如何继续?

1 个解决方案

#1


0  

Arosics currently will only work with Python3. from importutil import util does not work under Python 2.7 as it is not supported.

Arosics目前只适用于Python3。来自importutil import util在Python 2.7下不起作用,因为它不受支持。

If switching to Python3 is an option you are good to go. If not, the Arosics project's setup.py will have to be modified.

如果切换到Python3是一个选项,你很高兴。如果没有,则必须修改Arosics项目的setup.py。

I was able to install successfully with sudo pip3 install arosics

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

#1


0  

Arosics currently will only work with Python3. from importutil import util does not work under Python 2.7 as it is not supported.

Arosics目前只适用于Python3。来自importutil import util在Python 2.7下不起作用,因为它不受支持。

If switching to Python3 is an option you are good to go. If not, the Arosics project's setup.py will have to be modified.

如果切换到Python3是一个选项,你很高兴。如果没有,则必须修改Arosics项目的setup.py。

I was able to install successfully with sudo pip3 install arosics

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