Ask Your Question

Revision history [back]

Removed global pip dependencies broke dnf

Hi,

I was cleaning up some things on my Fedora Workstation 27 and I executed sudo pip3 freeze | sudo pip3 uninstall -y (and the same thing with pip for Python2) which removed all dependencies.

I was not aware that dnf depends on it and I thought that all this packages was recently installed by me.

Now, while running dnf I get the following output:

Traceback (most recent call last):
  File "/bin/dnf", line 57, in <module>
    from dnf.cli import main
  File "/usr/lib/python3.6/site-packages/dnf/__init__.py", line 31, in <module>
    import dnf.base
  File "/usr/lib/python3.6/site-packages/dnf/base.py", line 37, in <module>
    import dnf.conf
  File "/usr/lib/python3.6/site-packages/dnf/conf/__init__.py", line 40, in <module>
    from dnf.conf.config import PRIO_DEFAULT, PRIO_MAINCONFIG, PRIO_AUTOMATICCONFIG
  File "/usr/lib/python3.6/site-packages/dnf/conf/config.py", line 26, in <module>
    from iniparse.compat import ParsingError, RawConfigParser as ConfigParser
  File "/usr/local/lib/python3.6/site-packages/iniparse/__init__.py", line 6, in <module>
    from ini import INIConfig, change_comment_syntax
ModuleNotFoundError: No module named 'ini'

I tried pip3 install ini but it looks like it is not this package, as this is trying to install something written for python2 I guess.

rpm -Va also contains a lot of missing packages, but when I tried to reinstall them via rpm, and it's a lot so installing them manually is a horror due to growing dependency tree. Also some of them seems to not be available on the Internet.

Is there some way to fix dnf or restore it to previous stage?

I found a solution involving yum-deprecated, but it's not available anymore on Fedora 27 and installing it with rpm takes a lot of effort due to dependency tree.

If any information is needed please let me know, I will deliver it right away.

Removed global pip dependencies broke dnf

Hi,

I was cleaning up some things on my Fedora Workstation 27 and I executed sudo pip3 freeze | sudo pip3 uninstall -y (and the same thing with pip for Python2) which removed all dependencies.

I was not aware that dnf depends on it and I thought that all this packages was recently installed by me.

Now, while running dnf I get the following output:

Traceback (most recent call last):
  File "/bin/dnf", line 57, in <module>
    from dnf.cli import main
  File "/usr/lib/python3.6/site-packages/dnf/__init__.py", line 31, in <module>
    import dnf.base
  File "/usr/lib/python3.6/site-packages/dnf/base.py", line 37, in <module>
    import dnf.conf
  File "/usr/lib/python3.6/site-packages/dnf/conf/__init__.py", line 40, in <module>
    from dnf.conf.config import PRIO_DEFAULT, PRIO_MAINCONFIG, PRIO_AUTOMATICCONFIG
  File "/usr/lib/python3.6/site-packages/dnf/conf/config.py", line 26, in <module>
    from iniparse.compat import ParsingError, RawConfigParser as ConfigParser
  File "/usr/local/lib/python3.6/site-packages/iniparse/__init__.py", line 6, in <module>
    from ini import INIConfig, change_comment_syntax
ModuleNotFoundError: No module named 'ini'

I tried pip3 install ini but it looks like it is not this package, as this is trying to install something written for python2 I guess.

rpm -Va also contains a lot of missing packages, but when I tried to reinstall them via rpm, and it's a lot so installing them manually is a horror due to growing dependency tree. Also some of them seems to not be available on the Internet.

Is there some way to fix dnf or restore it to previous stage?

I found a solution involving yum-deprecated, but it's not available anymore on Fedora 27 and installing it with rpm takes a lot of effort due to dependency tree.

If any information is needed please let me know, I will deliver it right away.

--- EDIT --- Information added ---

I put this downlaoded packages in proper directories manually. Anyway the problem still exist.

Looks like the iniparse mdoule has troubles with ini.py file.

iniparse directory (pwd: /usr/lib/python3.6/site-packages/iniparse has the following files in it:

compat.py        config.py  __init__.py  utils.py   configparser.py  ini.py     __pycache__

and in __pycache__:

compat.cpython-36.opt-1.pyc        ini.cpython-36.opt-1.pyc
compat.cpython-36.pyc              ini.cpython-36.pyc
config.cpython-36.opt-1.pyc        __init__.cpython-36.opt-1.pyc
config.cpython-36.pyc              __init__.cpython-36.pyc
configparser.cpython-36.opt-1.pyc  utils.cpython-36.opt-1.pyc
configparser.cpython-36.pyc        utils.cpython-36.pyc

The sixth line in iniparse's __init__.py contains:

from .ini import INIConfig, change_comment_syntax

so it should be resolved, but it yields that the ini module doesn't exist. What can be the problem here? Maybe something with pyc files?