MichaIng / DietPi

Lightweight justice for your single-board computer!
https://dietpi.com/
GNU General Public License v2.0
4.8k stars 494 forks source link

error installing sabnzbd via dietpi-software #5134

Closed clarky0000 closed 2 years ago

clarky0000 commented 2 years ago

Trying to install sabnzbd via dietpi-software. I perviously had an old version installed - it may have been installed using a different method as listed here: https://sabnzbd.org/wiki/installation/install-debian. I really can't remember. I removed all files located at /etc/sabnzbd and /usr/lib/sabnzbd before trying to install via dietpi-software


Getting the following error:

Details:

Additional logs:

/usr/local/lib/python3.7/dist-packages/_distutils_hack/__init__.py:25: UserWarning: Distutils was imported before Setuptools, but importing Setuptools also replaces the `distutils` module in `sys.modules`. This may lead to undesirable behaviors or errors. To avoid these issues, avoid using distutils directly, ensure that setuptools is installed in the traditional way (e.g. not an editable install), and/or make sure that setuptools is always imported before distutils.
  "Distutils was imported before Setuptools, but importing Setuptools "
/usr/local/lib/python3.7/dist-packages/_distutils_hack/__init__.py:36: UserWarning: Setuptools is replacing distutils.
  warnings.warn("Setuptools is replacing distutils.")
Traceback (most recent call last):
  File "./get-pip.py", line 27081, in <module>
    main()
  File "./get-pip.py", line 139, in main
    bootstrap(tmpdir=tmpdir)
  File "./get-pip.py", line 120, in bootstrap
    args = determine_pip_install_arguments()
  File "./get-pip.py", line 65, in determine_pip_install_arguments
    import setuptools  # noqa
  File "/usr/local/lib/python3.7/dist-packages/setuptools/__init__.py", line 8, in <module>
    import _distutils_hack.override  # noqa: F401
  File "/usr/local/lib/python3.7/dist-packages/_distutils_hack/override.py", line 1, in <module>
    __import__('_distutils_hack').do_override()
  File "/usr/local/lib/python3.7/dist-packages/_distutils_hack/__init__.py", line 73, in do_override
    ensure_local_distutils()
  File "/usr/local/lib/python3.7/dist-packages/_distutils_hack/__init__.py", line 61, in ensure_local_distutils
    assert '_distutils' in core.__file__, core.__file__
AssertionError: /usr/lib/python3.7/distutils/core.py

Required Information

Joulinar commented 2 years ago

This is a known issue with latest Setuptools version https://github.com/MichaIng/DietPi/issues/5117

A permanent fix will become available in next version DietPi v8

A workaround could be following before trying to install/reinstall Python

pip3 uninstall setuptools -y


Side note

clarky0000 commented 2 years ago

Im getting a command not found.

root@DietPi:~# pip3 uninstall setuptools -y
-bash: pip3: command not found

FWIW:

root@DietPi:~# dietpi-software list | grep "ID 130"
ID 130 | =2 | Python 3: Runtime system, pip package installer and development headers | | https://dietpi.com/docs/software/programming/#python-3
root@DietPi:~#  dietpi-software list | grep "=2 "
ID 5 | =2 | ALSA: Advanced Linux Sound Architecture |
ID 6 | =2 | X.Org X Server: aka X11 - X Window System implementation |
ID 16 | =2 | Build-Essential: GNU C/C++ compiler, development libraries and headers |
ID 31 | =2 | Kodi: the media centre for linux | +ALSA +Avahi-Daemon | https://dietpi.com/docs/software/media/#kodi
ID 87 | =2 | SQLite: Persistent single-file database system | | https://dietpi.com/docs/software/databases/#sqlite
ID 103 | =2 | DietPi-RAMlog: Makes /var/log a RAM disk, preserves file structure on reboot | | https://dietpi.com/docs/software/log_system/#dietpi-ramlog
ID 104 | =2 | Dropbear: Lightweight SSH server | | https://dietpi.com/docs/software/ssh/#dropbear
ID 130 | =2 | Python 3: Runtime system, pip package installer and development headers | | https://dietpi.com/docs/software/programming/#python-3
ID 144 | =2 | Sonarr: automatically download TV shows | +SQLite +Mono | https://dietpi.com/docs/software/bittorrent/#sonarr
ID 145 | =2 | Radarr: automatically download movies | +SQLite | https://dietpi.com/docs/software/bittorrent/#radarr
ID 150 | =2 | Mono: Runtime libraries and repository |
ID 152 | =2 | Avahi-Daemon: hostname broadcast (mac, pc bonjour) |
ID 170 | =2 | UnRAR: unarchiver for .rar files |

What am I missing?

Joulinar commented 2 years ago

strange, Python 3 is installed and it should work. Can you try

pip uninstall setuptools -y

MichaIng commented 2 years ago

The issue has been fixed with next setuptools release btw: https://github.com/pypa/setuptools/commit/41fa663 Watch out for v60.3.0 here: https://pypi.org/project/setuptools/#history

Not sure how now setuptools is installed while the pip3 command is not available. Hammer solution would be:

rm -R /usr/local/lib/python3.7/dist-packages/setuptools
dietpi-software install 139
Joulinar commented 2 years ago

we have a similar issue (as well Buster) on our forum. https://dietpi.com/phpbb/viewtopic.php?t=9877

Next issue might be cryptography Looks like pre-compiled wheel cryptography 36.0.0 did not satisfy sabnzbd. Something to test if it really require 36.0.1 which is not available for Python 3.7 https://www.piwheels.org/project/cryptography/

MichaIng commented 2 years ago

The build on piwheels failed indeed, reported already: https://github.com/piwheels/packages/issues/267

MichaIng commented 2 years ago

Issue solved, the wheel is available now.

clarky0000 commented 2 years ago

The issue has been fixed with next setuptools release btw: pypa/setuptools@41fa663 Watch out for v60.3.0 here: https://pypi.org/project/setuptools/#history

Not sure how now setuptools is installed while the pip3 command is not available. Hammer solution would be:

rm -R /usr/local/lib/python3.7/dist-packages/setuptools
dietpi-software install 139

That appears to have done the trick - thanks guys. I ran:

pip uninstall setuptools -y then rm -R /usr/local/lib/python3.7/dist-packages/setuptools dietpi-software install 139

thanks guys!

MichaIng commented 2 years ago

Great. I accidentally closed the issue as the cryptography issue was solved, and forgot that yours was actually the other one with setuptools, sorry for that πŸ˜…. However, upstream fix for that one should go live soon as well + we have the workaround applied πŸ™‚.

clarky0000 commented 2 years ago

Great. So to apply that update when it does what do I do?

On Wed, 5 Jan 2022, 10:41 am MichaIng, @.***> wrote:

Great. I accidentally closed the issue as the cryptography issue was solved, and forgot that yours was actually the other one with setuptools, sorry for that πŸ˜…. However, upstream fix for that one should go live soon as well + we have the workaround applied πŸ™‚.

β€” Reply to this email directly, view it on GitHub https://github.com/MichaIng/DietPi/issues/5134#issuecomment-1005255837, or unsubscribe https://github.com/notifications/unsubscribe-auth/AI7HIMUFTD26KLVH5YBJPBLUUOAT7ANCNFSM5LG2TQ5Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

MichaIng commented 2 years ago

Since the workaround did it for you now, there is no need or benefit to apply any further step. DietPi v8.0 will be released at Saturday, after which a Python 3 reinstall will succeed thanks to the workaround, and as fast as setuptools v60.3.0 has been released that workaround won't be required either. I hope this happens until Saturday so that we can remove our workaround again πŸ˜‰.