SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi there again xD. yesterday i upgrade my Slackware64 14.2 but no errors reported but python right now is not working. i notice that because i try :
Code:
su -c "slpkg repo-enable" root
Traceback (most recent call last):
File "/usr/local/bin/slpkg", line 41, in <module>
main()
File "/usr/local/lib/python2.7/site-packages/slpkg/main.py", line 809, in main
arguments[args[0]]()
File "/usr/local/lib/python2.7/site-packages/slpkg/main.py", line 146, in command_repo_enable
RepoEnable().choose()
File "/usr/local/lib/python2.7/site-packages/slpkg/repoenable.py", line 68, in choose
status).buildlist(self.enabled)
File "/usr/local/lib/python2.7/site-packages/slpkg/dialog_box.py", line 75, in buildlist
title=self.title)
File "/usr/local/lib/python2.7/site-packages/dialog.py", line 1964, in buildlist
code, output = self._perform(cmd, **kwargs)
File "/usr/local/lib/python2.7/site-packages/dialog.py", line 1543, in _perform
args_file)
File "/usr/local/lib/python2.7/site-packages/dialog.py", line 1504, in _handle_program_exit
child_output_rfd)
File "/usr/local/lib/python2.7/site-packages/dialog.py", line 1456, in _wait_for_program_termination
child_output.strip()))
dialog.DialogError
i try to reinstall packages but dont work, more later i try to install something try various things to fix it
Code:
su -c "python setup.py install"
Traceback (most recent call last):
File "setup.py", line 3, in <module>
from setuptools import setup
ImportError: No module named setuptools
su -c "pip install -U pip setuptools" root
Contraseņa:
Requirement already up-to-date: pip in /usr/lib64/python2.7/site-packages
Requirement already up-to-date: setuptools in /usr/lib64/python2.7/site-packages
su -c "pip uninstall setuptools" root
su -c "pip install --upgrade setuptools"
Traceback (most recent call last):
File "/usr/bin/pip", line 5, in <module>
from pkg_resources import load_entry_point
ImportError: No module named pkg_resources
su -c "slpkg -s slonly --reinstall python-distutils-extra" root
su -c "pip install --upgrade setuptools"
Traceback (most recent call last):
File "/usr/bin/pip", line 5, in <module>
from pkg_resources import load_entry_point
ImportError: No module named pkg_resources
su -c "wget https://bootstrap.pypa.io/ez_setup.py -O - | python" root
su -c "easy_install pip python-distutils-extra" root
format c:\ will do that.
Actually you will kill your system, python cannot be removed.
For me it looks like your python installation is corrupted, or inconsistent. Probably only the variable PYTHONPATH was not set properly, but you have removed some packages which made it only worse.
The error messages you are posting do not make any sense.
You are removing certain things as root, and then attempting to update them as a normal user.
First a little piece of advice: try to use
Code:
"su - root -c <command>"
and not
Code:
"su -c <command> root"
which is completely off-kilter (as far as I am concerned.
First things first:
You can remove Python completely from a Slackware installation, for this, (as root) use one of these:
Code:
# this will always work:
su - root -c /sbin/removepkg python-*
# this will work if you have configured slackpkg:
su - root -c /usr/sbin/slackpkg remove python
Then, since you are trying to run Python-based application, try the following:
Code:
# this will always work:
su - root -c /sbin/installpkg /path/to/python-*.txz
# this will work if you have configured slackpkg:
su - root -c /usr/sbin/slackpkg install python
Once your Python has been re-installed, you can actually install 'pip' and other Python-related tools as root.
Probably only the variable PYTHONPATH was not set properly
Setting PYTHONPATH shouldn't be needed, it's more likely that inukaze broke Python by doing various things without understanding the consequences.
Quote:
Originally Posted by inukaze
yesterday i upgrade my Slackware64 14.2 but no errors reported but python right now is not working.
There were no Python-related updates for Slackware 14.2 for awhile, it must be something else that broke Python.
Quote:
Originally Posted by inukaze
i try to reinstall packages but dont work, more later i try to install something try various things to fix it
Code:
su -c "python setup.py install"
Traceback (most recent call last):
File "setup.py", line 3, in <module>
from setuptools import setup
ImportError: No module named setuptools
su -c "pip install -U pip setuptools" root
Contraseņa:
Requirement already up-to-date: pip in /usr/lib64/python2.7/site-packages
Requirement already up-to-date: setuptools in /usr/lib64/python2.7/site-packages
su -c "pip uninstall setuptools" root
su -c "pip install --upgrade setuptools"
Traceback (most recent call last):
File "/usr/bin/pip", line 5, in <module>
from pkg_resources import load_entry_point
ImportError: No module named pkg_resources
su -c "slpkg -s slonly --reinstall python-distutils-extra" root
su -c "pip install --upgrade setuptools"
Traceback (most recent call last):
File "/usr/bin/pip", line 5, in <module>
from pkg_resources import load_entry_point
ImportError: No module named pkg_resources
wget https://bootstrap.pypa.io/ez_setup.py -O - | python
easy_install pip python-distutils-extra
I have no experience with slpkg, so this is just a guess, but could it be that you tried to invoke slpkg command which for whatever reason (could be because you tried to run it using su -c) exited with an error, as explained in dialogdocumentation for DialogError exception:
Quote:
Exception raised when the dialog-like program exits with the code indicating an error.
You got that dialog.DialogError exception and mistakenly thought that Python is broken, and by doing all the things above (especially removing setuptools, which is a dependency for many Python packages) now you broke your Python installation with certainty.
In other words, you shot yourself in both feet and now you complain that the shotgun is broken...
Quote:
Originally Posted by inukaze
Someone have a tutorial how i can purge at 100% python on Slackware64 14.2 ??? and manually delete every file used by python ???
Don't know if this will help, but you could try this:
After that you should reinstall the rest of Python-related packages that you removed, especially the ones that come from Slackware and not from SlackBuilds.org. No guarantees that it will work, but since your Python installation is broken anyway, this won't hurt either.
Also some advice:
Do NOT run commands using su -c, first switch to root using su -, then run the commands you wanted, alternatively configure sudo and use that.
Do NOT use easy_install or pip to install Python packages system-wide. Use slpkg, sbopkg or any other tool that lets you install Python stuff from SlackBuilds.org as Slackware packages, so that Slackware's package management tools could track them and allow you to upgrade/remove them easily.
You need to do this as your normal user. The reason is that if you ran "pip install" using your normal user account, the packages would have been installed there.
You need to do this as your normal user. The reason is that if you ran "pip install" using your normal user account, the packages would have been installed there.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.