Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError: No module named … #113

Open
michel-thomas opened this issue Mar 10, 2023 · 2 comments
Open

ModuleNotFoundError: No module named … #113

michel-thomas opened this issue Mar 10, 2023 · 2 comments

Comments

@michel-thomas
Copy link

Hello,
I am facing the same problem than #98 since I upgrade from Debian 10 to Debian 11.

  • python3-pip is installed
  • pip is also installed by geerlingguy.pip (2.2.0) ansible role

I notice that this role uses /opt/borgmatic/bin/pip3 and /opt/borgmatic/bin/pip. Removing them and creating a symlink (ln -s /usr/local/bin/pip3 /opt/borgmatic/bin/pip3 and ln -s /usr/local/bin/pip /opt/borgmatic/bin/pip) solve this problem.

Now I have a new problem when using borgmatic command, probably linked to previous one: "ModuleNotFoundError: No module named 'borgmatic'".

But

root:~# pip3 list | grep borg
borgbackup          1.2.3
borgmatic           1.7.8
root:~# which borgmatic
/usr/local/bin/borgmatic

root:~# whereis borgmatic
borgmatic: /etc/borgmatic /usr/local/bin/borgmatic /opt/borgmatic/bin/borgmatic

root:~# borgmatic --version
Traceback (most recent call last):
  File "/opt/borgmatic/bin/borgmatic", line 5, in <module>
    from borgmatic.commands.borgmatic import main
ModuleNotFoundError: No module named 'borgmatic'

root:~# /usr/local/bin/borgmatic --version
Traceback (most recent call last):
  File "/opt/borgmatic/bin/borgmatic", line 5, in <module>
    from borgmatic.commands.borgmatic import main
ModuleNotFoundError: No module named 'borgmatic'

root:~# /opt/borgmatic/bin/borgmatic --version
Traceback (most recent call last):
  File "/opt/borgmatic/bin/borgmatic", line 5, in <module>
    from borgmatic.commands.borgmatic import main
ModuleNotFoundError: No module named 'borgmatic'

I don't understand what is the problem now.

@michel-thomas
Copy link
Author

Temporary solution:

  • uninstall all (apt purge borgmatic borgbackup + pip uninstall borgmatic borgbackup)
  • install (debian-way) manually borgbackup: apt install borgbackup
  • install (pip-way) manually borgmatic: pip install borgmatic

@caplod
Copy link

caplod commented Sep 3, 2024

had the same problem.
in my case removing /opt/borgmatic and reinstalling borgbackup and borgmatic solved the problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants