You are not logged in.

#1 2018-06-02 20:36:53

ralph_hellgrind
Member
Registered: 2016-02-03
Posts: 46

How to completely remove Python3

I have an x86_64 system: Linux IceMage 4.16.12-1-ARCH. I want to remove Python3 (Python-3.6) completely and then do a fresh installation. When I issue the command:

pacman -R python

I get the following output-

checking dependencies...
error: failed to prepare transaction (could not satisfy dependencies)
:: accerciser: removing python breaks dependency 'python'
:: ipython: removing python breaks dependency 'python'
:: libixion: removing python breaks dependency 'python'
:: libreoffice-fresh: removing python breaks dependency 'python>=3.6'
:: python-appdirs: removing python breaks dependency 'python'
:: python-cairo: removing python breaks dependency 'python'
:: python-colorama: removing python breaks dependency 'python'
:: python-dbus: removing python breaks dependency 'python'
:: python-decorator: removing python breaks dependency 'python'
:: python-distlib: removing python breaks dependency 'python'
:: python-distro: removing python breaks dependency 'python'
:: python-gobject: removing python breaks dependency 'python'
:: python-html5lib: removing python breaks dependency 'python'
:: python-idna: removing python breaks dependency 'python'
:: python-jedi: removing python breaks dependency 'python'
:: python-lazy-object-proxy: removing python breaks dependency 'python'
:: python-lockfile: removing python breaks dependency 'python'
:: python-lxml: removing python breaks dependency 'python'
:: python-mccabe: removing python breaks dependency 'python'
:: python-msgpack: removing python breaks dependency 'python'
:: python-parso: removing python breaks dependency 'python'
:: python-pexpect: removing python breaks dependency 'python'
:: python-pickleshare: removing python breaks dependency 'python'
:: python-progress: removing python breaks dependency 'python'
:: python-ptyprocess: removing python breaks dependency 'python'
:: python-pyparsing: removing python breaks dependency 'python'
:: python-pytoml: removing python breaks dependency 'python'
:: python-simplejson: removing python breaks dependency 'python'
:: python-six: removing python breaks dependency 'python'
:: python-urllib3: removing python breaks dependency 'python'
:: python-wcwidth: removing python breaks dependency 'python'
:: python-webencodings: removing python breaks dependency 'python'
:: python-wrapt: removing python breaks dependency 'python'
:: python-xdg: removing python breaks dependency 'python'
:: youtube-dl: removing python breaks dependency 'python'

How do I proceed in this scenario? Do I have to manually uninstall each of these dependencies? (That doesn't seem to be such a promising task!)

Or, should I use the following command-

pacman -Rdd python

I know that executing this command will remove "python" with all of it's dependencies and can be potentially harmful for my system-

pacman -Rc python

Thanks!

Last edited by ralph_hellgrind (2018-06-02 22:07:31)

Offline

#2 2018-06-02 20:45:09

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: How to completely remove Python3

man pacman

And read the Code of Conduct and use code tags when pasting to the boards: https://wiki.archlinux.org/index.php/Co … s_and_code


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2018-06-02 20:55:38

loqs
Member
Registered: 2014-03-06
Posts: 17,884

Re: How to completely remove Python3

Could you explain what you believe a fresh installation of python would achieve?

Offline

#4 2018-06-02 22:09:30

ralph_hellgrind
Member
Registered: 2016-02-03
Posts: 46

Re: How to completely remove Python3

loqs wrote:

Could you explain what you believe a fresh installation of python would achieve?

If I am trying to install any package using "pip" -

pip3 install tensorflow

It gives me the error-

ModuleNotFoundError: No module named 'pip._vendor.requests.exceptions'

I tried to troubleshoot this error but to no avail. Hence, I want to remove Python and start with a fresh installation.

Offline

#5 2018-06-02 22:17:35

mrunion
Member
From: Jonesborough, TN
Registered: 2007-01-26
Posts: 1,938
Website

Re: How to completely remove Python3

Word of advice -- don't use pip to install anything. Make a proper pacman package for it, or install things in a virtual environment. (Well, or look for what you want to install to already be packaged in the repos or in AUR.)

Oh, and in Arch it's not "pip3", it's just "pip".

Last edited by mrunion (2018-06-02 22:18:23)


Matt

"It is very difficult to educate the educated."

Offline

#6 2018-06-02 23:43:56

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,965
Website

Re: How to completely remove Python3

If you really want to use pip, install the python-pip package. However, as pointed out by mrunion, it is not the "right way" to install Python packages on your Arch system. Instead, install the pacman package that provides the modules and tools that you need. If one doesn't exist, create it. If you don't know how, read the PKGBUILD and makepkg wiki pages. Most Python package are relatively simple because you usually just need to run the setup script from the PKGBUILD.

Also note that missing files in a package can be recreated by simply re-installing the package. The only time that removing and re-installing a package would do anything different is if the package creates a file using the post_install function, but that is relatively rare. You can also check for missing files with "pacman -Qk <pkgname>".

It's good that you asked about removing Python before proceeding, but when your system tells you that what you are trying to do will break it, it's often better to explain what you are trying to achieve and ask what the right way to do it is.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#7 2018-06-03 04:32:26

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: How to completely remove Python3

Are you using testing? If so, did you force uninstall python-requests? Because the pip package in [testing] relies on the separately packaged requests module, which is a dependency of said new package... so, if you've already messed with pacman's dependency tracking, you might see this error.

EDIT: wait, it's been moved to extra... huh.

mrunion wrote:

Word of advice -- don't use pip to install anything. Make a proper pacman package for it, or install things in a virtual environment. (Well, or look for what you want to install to already be packaged in the repos or in AUR.)

Or use pip install user...

In fact, my ~/.config/pip/pip.conf contains the configuration key

[install]
user = yes

So "pip install foo" will install to ~/.local by default...

Oh, and in Arch it's not "pip3", it's just "pip".

It is both, because we're PEP 394 compliant. Given that Arch Linux is the major reason why the PEP exists, it's only responsible of us to ensure we follow it ourselves, therefore guaranteeing that cross-distro instructions will reliably detect the right python version.

ralph_hellgrind is correct to use pip3, and I strongly encourage other people to follow this example.

Last edited by eschwartz (2018-06-03 04:33:49)


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#8 2018-06-04 16:29:20

mrunion
Member
From: Jonesborough, TN
Registered: 2007-01-26
Posts: 1,938
Website

Re: How to completely remove Python3

Eschwartz wrote:

It is both, because we're PEP 394 compliant. Given that Arch Linux is the major reason why the PEP exists, it's only responsible of us to ensure we follow it ourselves, therefore guaranteeing that cross-distro instructions will reliably detect the right python version.

ralph_hellgrind is correct to use pip3, and I strongly encourage other people to follow this example.

Thanks for the information. Duly noted.

Last edited by mrunion (2018-06-04 16:29:49)


Matt

"It is very difficult to educate the educated."

Offline

Board footer

Powered by FluxBB