LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 06-21-2017, 11:37 PM   #1
inukaze
Member
 
Registered: Feb 2011
Location: Venezuela - Caracas
Distribution: Slackware64 14.2, Slackware 14.2, Gentoo, Devuan, gNewSense, GoboLinux, Leeenux, Porteus
Posts: 268

Rep: Reputation: 25
Question How can purge python at 100% ???


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
Well i try to purge it
Code:
slpkg -r --deps dbus-python kdev-python notify-python python-pillow python-setuptools python-slacklog python-distutils-extra pip python2-pythondialog
Well i really don't like python, ever gave me some problem or its python, or modules, or support of some function.

But some apps i use need this thing like
menulibre
dockbarx
catfish
slpkg

<applications>
<videogames>
<etc>

Someone have a tutorial how i can purge at 100% python on Slackware64 14.2 ??? and manually delete every file used by python ???

Last edited by inukaze; 06-22-2017 at 05:35 PM.
 
Old 06-22-2017, 01:01 AM   #2
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,056

Rep: Reputation: Disabled
[duplicate post]

Last edited by Didier Spaier; 06-22-2017 at 01:07 AM.
 
Old 06-22-2017, 01:07 AM   #3
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,056

Rep: Reputation: Disabled
Quote:
Originally Posted by inukaze View Post
Someone have a tutorial how i can purge at 100% python on Slackware64 14.2 ??? and manually delete every file used by python ???
I don't, but if you succeed that will make your system unusable.

Next, to repair it, make a backup of all the files you want to keep, then reinstall Slackware64-14.2 and restore your back up

You will have to do that every time you break your system, voluntarily or not, so make sure you always have an installation media at hand.

Last edited by Didier Spaier; 06-22-2017 at 01:10 AM.
 
Old 06-22-2017, 01:50 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,804

Rep: Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306
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.
 
Old 06-22-2017, 03:26 AM   #5
Noryungi
Member
 
Registered: Jul 2003
Location: --> X <-- You are here.
Distribution: Slackware, OpenBSD
Posts: 305

Rep: Reputation: 53
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.
 
Old 06-22-2017, 03:28 AM   #6
audriusk
Member
 
Registered: Mar 2011
Location: Klaipėda, Lithuania
Distribution: Slackware
Posts: 360

Rep: Reputation: 199Reputation: 199
Quote:
Originally Posted by pan64 View Post
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 View Post
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 View Post
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 dialog documentation 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 View Post
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:
Code:
rm -rf /usr/lib64/python2.7
slackpkg reinstall python python-setuptools
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.
 
Old 06-22-2017, 03:39 AM   #7
audriusk
Member
 
Registered: Mar 2011
Location: Klaipėda, Lithuania
Distribution: Slackware
Posts: 360

Rep: Reputation: 199Reputation: 199
Quote:
Originally Posted by Noryungi View Post
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.
According to su man page, the format is as follows:
Code:
su [options] [username]
So
Code:
su -c <command> root
is correct. su - is equivalent to su -l or su --login
 
Old 06-22-2017, 11:54 AM   #8
Paulo2
Member
 
Registered: Aug 2012
Distribution: Slackware64 15.0 (started with 13.37). Testing -current in a spare partition.
Posts: 928

Rep: Reputation: 515Reputation: 515Reputation: 515Reputation: 515Reputation: 515Reputation: 515
I think a dash is missing.
Code:
paulo@paulobash~$ su -c 'echo $PATH' root
Senha : 
/usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:/bin:/usr/bin

paulo@paulobash~$ su - -c 'echo $PATH'
Senha : 
/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib64/kde4/libexec:/usr/lib64/java/bin:/usr/lib64/java/jre/bin:/scripts:/usr/lib64/qt/bin:/usr/share/texmf/bin

paulo@paulobash~$ su - root -c 'echo $PATH'
Senha : 
/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib64/kde4/libexec:/usr/lib64/java/bin:/usr/lib64/java/jre/bin:/scripts:/usr/lib64/qt/bin:/usr/share/texmf/bin

paulo@paulobash~$ su -l root -c 'echo $PATH'
Senha : 
/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib64/kde4/libexec:/usr/lib64/java/bin:/usr/lib64/java/jre/bin:/scripts:/usr/lib64/qt/bin:/usr/share/texmf/bin
 
Old 06-22-2017, 01:34 PM   #9
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,219

Rep: Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309
You just want to purge Python 100%?

Code:
rm -rf /usr/*/python* # as root
rm -rf ~/.local/*/python* # as user
rm -rf /usr/local/*/python* # as root
Obviously, this would solve none of your problems and just make your system even more broken.

Last edited by dugan; 06-22-2017 at 02:45 PM.
 
Old 06-22-2017, 05:21 PM   #10
mralk3
Slackware Contributor
 
Registered: May 2015
Distribution: Slackware
Posts: 1,900

Rep: Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050
If you are trying to use slpkg to uninstall python, you will run into problems, since it requires python.
 
Old 06-22-2017, 05:31 PM   #11
inukaze
Member
 
Registered: Feb 2011
Location: Venezuela - Caracas
Distribution: Slackware64 14.2, Slackware 14.2, Gentoo, Devuan, gNewSense, GoboLinux, Leeenux, Porteus
Posts: 268

Original Poster
Rep: Reputation: 25
Thumbs up

[QUOTE=dugan;5725794]You just want to purge Python 100%?

Yes, i just need purge python at 100%

Code:
rm -rf /usr/*/python* # as root
rm -rf ~/.local/*/python* # as user
rm -rf /usr/local/*/python* # as root
Thanks i use with root user on terminal :
Code:
slpkg -r --deps pip python gst-python dbus-python gst0-python python-gnupg gnome-python notify-python python-distro python-slacklog python-setuptools gnome-python2-gconf python2-pythondialog gnome-python-desktop python-distutils-extra python-stsci.distutils python3-Cython python3

rm -rf /usr/*/python*
rm -rf ~/.local/*/python*
rm -rf /usr/local/*/python*
Thank you very much.

Now i had the system like i need, well if another day, if i try again i am secure that time works everything fine

Last edited by inukaze; 06-22-2017 at 05:32 PM.
 
Old 06-22-2017, 05:59 PM   #12
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,219

Rep: Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309
Hey Inukaze:

Code:
rm -rf ~/.local/*/python*
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.
 
Old 06-22-2017, 10:37 PM   #13
inukaze
Member
 
Registered: Feb 2011
Location: Venezuela - Caracas
Distribution: Slackware64 14.2, Slackware 14.2, Gentoo, Devuan, gNewSense, GoboLinux, Leeenux, Porteus
Posts: 268

Original Poster
Rep: Reputation: 25
Quote:
Originally Posted by dugan View Post
Hey Inukaze:

Code:
rm -rf ~/.local/*/python*
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.
i do it like normal use too xD
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
I got error while installing python-tk python-psycopg2 python-twisted saili kadam Linux - Newbie 1 09-05-2015 03:03 AM
apt-get purge or --purge is false advertising... jmgibson1981 Linux - Newbie 12 07-01-2015 08:04 AM
[SOLVED] Purge corrupted python module despo Linux - Software 2 06-04-2013 09:16 AM
OpenOffice/LibreOffice writer uses 100% CPU time, 100% memory, workaround someone? jlinkels Linux - Software 11 08-30-2012 01:50 PM
Help with python application to add number until 100 or more, new user. Michael_aust Programming 6 09-24-2006 01:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration