I am using Fedora 26.

Since I installed Anaconda, if I type in Terminal something like

sudo dnf install gnome[TAB]

I get

Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'dnf'

zsh: do you wish to see all 313 possibilities (317 lines)? 

Any idea what could have happened? It has something to do with python I guess...

UPDATE: When I removed Anaconda from the path, i get following message:

➜  ~ sudo dnf install gnomezsh: sqlite3: command not found...
Install package 'sqlite' to provide command 'sqlite3'? [N/y] 

I should also mention that I am using zsh with oh-my/zsh.

  • What are you trying to install actually? – imvpn22 Nov 17 '17 at 3:47
  • It's not about what I am trying to install... Whatever I would like to install, I get the same, strange, behavior... – Leta Nov 17 '17 at 7:55
  • It seems that you have broken dnf. Did you uninstall python? – imvpn22 Nov 17 '17 at 13:16
  • There is an old question with similar problem. – imvpn22 Nov 17 '17 at 13:22

This is a bug in zsh. Change the instances of python2 and python3 in /usr/share/zsh/5.*your_version*/functions/_dnf to /usr/bin/python2and /usr/bin/python3 respectively.

This solved my problem. Big thanks to https://github.com/ContinuumIO/anaconda-issues/issues/886

  • The problem appears while interacting with zsh's internal auto-complete function for commandline arguments. It calls a command in order to complete/guess what you are trying to write, and it is this auto-completion (which can be configured to be an external command) fails. – Ned64 Apr 7 at 18:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.