apt-get update - error omv-mkaptidx importerror: no modules named 'apt'

  • Hello there,


    I'm receiving an error after apt-get update.
    Here is the output:



    Code
    Traceback (most recent call last):
      File "/usr/sbin/omv-mkaptidx", line 35, in <module>
        import apt
    ImportError: No module named 'apt'
    Reading package lists... Done

    Any idea how to solve this issue?


    Thank you in advance.

  • I got the same result after an apt-get dist-upgrade:


    Traceback (most recent call last):
    File "/usr/sbin/omv-mkaptidx", line 35, in <module>
    import apt
    ModuleNotFoundError: No module named 'apt'

  • I got the same error after apt-get update & apt-get dist-upgrade


    Traceback (most recent call last):
    File "/usr/sbin/omv-confdbadm", line 23, in <module>
    import openmediavault
    ModuleNotFoundError: No module named 'openmediavault'
    dpkg: error al procesar el paquete openmediavault (--configure):
    el subproceso instalado el script post-installation devolvió el código de salida de error 1


    Se encontraron errores al procesar:
    openmediavault
    Traceback (most recent call last):
    File "/usr/sbin/omv-mkaptidx", line 35, in <module>
    import apt
    ModuleNotFoundError: No module named 'apt'
    E: Sub-process /usr/bin/dpkg returned an error code (1)


    I'dont know how to fix it, could someone help me please??

    • Offizieller Beitrag

    First we need to know your platform, how you installed OMV and so on. I really do not understand that behaviour because all packages are installed via package dependencies. The only reason for this might be that the python3-apt package is broken for your platform.

  • Thank you for your help. I'm newbie so tell me please what do you need.


    My kernel version:

    Bash
    root@micromaiqui:~# cat /proc/version
    Linux version 4.9.0-0.bpo.4-amd64 (debian-kernel@lists.debian.org) (gcc version 4.9.2 (Debian 4.9.2-10) ) #1 SMP Debian 4.9.65-3+deb9u1~bpo8+1 (2017-12-23)


    I'm running OMV in a HP microserver gen7, OMV 3.0.96 (Erasmus). Fresh Installed from ISO.


    I did:

    Bash
    # apt-get install --reinstall python3-apt

    but it doesn't fix nothing

  • hi,


    i had the same error after apt-get update (on OMV 2.2.14):

    Code
    Traceback (most recent call last):
      File "/usr/sbin/omv-mkaptidx", line 35, in <module>
        import apt
    ImportError: No module named 'apt'
    Reading package lists... Done


    i solved the problem after edit the file "/etc/apt/apt.conf.d/99openmediavault-mkaptidx" and changed the line


    APT::Update::Post-Invoke-Success { "which omv-mkaptidx >/dev/null 2>&1 || exit 0; omv-mkaptidx || true"; };"


    to


    APT-GET::Update::Post-Invoke-Success { "which omv-mkaptidx >/dev/null 2>&1 || exit 0; omv-mkaptidx || true"; };



    edit:
    it solved only the problem for apt-get update, but not for reinstall, upgrade, etc

  • Hi All,


    got the same error on one of my Systems too.


    File "/usr/sbin/omv-mkaptidx", line 35, in <module>
    import apt
    ImportError: No module named 'apt'


    Already tried:
    #apt-get install --reinstall python3


    #apt-get install --reinstall python3-apt


    So is there any way to reinstall the missing omv Modules manually ?

  • Hello,



    have the same problem and do not get it solved



    is there already a solution?


    Steffen

  • Hello,



    have the same problem and do not get it solved



    is there already a solution?


    Steffen

  • Did I try but seems to be a mistake, which possibilities would I still have ???

  • Hello,


    Is there any repair cmd to solve the problem?





    I just do not know how to go on...

    Code
    Setting up openmediavault (4.1.8.2-1) ...
    Updating configuration database ...
    Traceback (most recent call last):
      File "/usr/sbin/omv-confdbadm", line 23, in <module>
        import openmediavault
    ImportError: No module named 'openmediavault'
  • python3-apt


    did dpkg-reconfigure --force python3-apt and no error occured.


    dpkg-reconfigure --force openmediavault
    Updating configuration database ...
    Traceback (most recent call last):
    File "/usr/sbin/omv-confdbadm", line 23, in <module>
    import openmediavault
    ImportError: No module named 'openmediavault'



    So how do I reinvoke the python modules again ?


    thx for your suggestion

  • Chances are what has happened is that you guys have either remapped Python executable (like using pyenv) or there's some other kind of Python issue.


    Specifically for me I installed another version of Python using pyenv and set it as the global version which is what caused these issues.


    Check what `python` and `python3` are pointing at:


    `which python`


    For me I had to set this back to the system version to get this error message to go away

  • I also had this error and fixed by ensuring that the usr/bin and usr/local/bin did not both have references to the system installed python and that the order of the two directories was correct in the PATH statement. i.e. if python is in usr/bin then have usr/bin first in the PATH.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!