Python remove from setup

Master the Removal Process: A Comprehensive Guide to Uninstalling Python Setup.py Packages and Apps

¡Hola! Bienvenidos a nuestro blog de uninstall apps. Hoy aprenderemos cómo realizar la desinstalación de aplicaciones en Python utilizando el comando python setup.py uninstall. ¡Sigue leyendo y conviértete en un experto en este tema!

Effortless Uninstallation: Mastering ‘python setup.py uninstall’ in the World of Uninstall Apps

In the realm of uninstall apps, becoming proficient in the use of ‘python setup.py uninstall’ can greatly simplify the process of removing unwanted software. While there are numerous methods available for uninstalling applications, mastering this command offers a quick and painless approach to clearing out unnecessary programs.

To successfully utilize ‘python setup.py uninstall’, it’s important to first understand its components. The command relies on the Python programming language to execute a specific setup script which is typically included with the application you wish to remove. By running this script, you’re essentially instructing the program to delete all files and directories associated with it.

Before executing the command, you’ll need to have Python installed on your system. If you don’t have it already, you can download it from the official Python website. Once installed, you can proceed with the uninstallation process.

To initiate the process, navigate to the directory containing the application’s setup script. This is generally located within the main folder of the software you wish to remove. Once you’ve located the correct folder, open a terminal or command prompt window and enter the following command:

Upon execution, the setup script runs the necessary steps to remove the application and clean up any residual files. It’s worth noting that this method may not work for all applications, particularly those lacking a proper setup script. In such cases, using an alternative uninstall app or method would be necessary.

In conclusion, the ‘python setup.py uninstall’ command provides an efficient way of uninstalling software in the world of uninstall apps. By mastering this technique, you can save time and effort while ensuring that your system remains free of unwanted programs.

Читайте также:  Contains and equals in java

Источник

python setup.py удалить

pip uninstall больше не является правильным ответом. Вот доказательство. [sri @ localhost python] $ pip uninstall foo УСТАРЕВАНИЕ: удаление установленного distutils проекта (foo) устарело и будет удалено в следующей версии. Это связано с тем, что удаление проекта distutils приведет к удалению проекта только частично.

@JCRocamonde В пакете, который я создал, последняя версия pip показывает, что It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall. так что это все еще проблема.

14 ответов

Вам необходимо удалить все файлы вручную, а также отменить любые другие действия, которые установка выполняла вручную.

Если вы не знаете список всех файлов, вы можете переустановить его с —record опции —record и взглянуть на этот список.

Для записи списка установленных файлов вы можете использовать:

python setup.py install --record files.txt 

Если вы хотите удалить, вы можете использовать xargs для удаления:

cat files.txt | xargs rm -rf 

Или, если вы используете Windows, используйте Powershell:

Get-Content files.txt | ForEach-Object

Затем удалите также содержащий каталог, например /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/my_module-0.1.egg/ в macOS . У него нет файлов, но Python все равно импортирует пустой модуль:

>>> import my_module >>> my_module.__file__ None 

После удаления Python показывает:

>>> import my_module Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'my_module' 

Привет, я попробовал ваше предложение, для некоторых файлов, когда я пытаюсь cat files.txt | xargs rm -rf говорит, что разрешение запрещено, даже в режиме sudo, например для / usr / local / bin / pydoc или / usr / local / bin / idle.

Для меня в основном работает следующее:

Проверьте, как ваш установленный пакет называется с точки зрения pip:

В этом списке должны быть указаны имена всех пакетов, которые вы установили (и которые были обнаружены по протоколу). Имя может быть когда-то длинным, а затем используйте только имя пакета, отображаемого в и после #egg= . Вы также можете в большинстве случаев игнорировать часть версии (все, что следует за == или — ).

$ pip uninstall package.name.you.have.found 

Если он запрашивает подтверждение об удалении пакета, то вам повезет, и он будет удален.

pip должен обнаруживать все пакеты, которые были установлены pip. Он также обнаруживает большинство пакетов, установленных с помощью easy_install или setup.py, но это может в некоторых редких случаях терпеть неудачу.

Читайте также:  Css with attribute name

Вот реальный образец из моего локального теста с пакетом с именем ttr.rdstmc в MS Windows.

$ pip freeze |grep ttr ttr.aws.s3==0.1.1dev ttr.aws.utils.s3==0.3.0 ttr.utcutils==0.1.1dev $ python setup.py develop . . Finished processing dependencies for ttr.rdstmc==0.0.1dev $ pip freeze |grep ttr ttr.aws.s3==0.1.1dev ttr.aws.utils.s3==0.3.0 -e hg+https://[email protected]/vlcinsky/[email protected]#egg=ttr.rdstmc-dev ttr.utcutils==0.1.1dev $ pip uninstall ttr.rdstmc Uninstalling ttr.rdstmc: c:\python27\lib\site-packages\ttr.rdstmc.egg-link Proceed (y/n)? y Successfully uninstalled ttr.rdstmc $ pip freeze |grep ttr ttr.aws.s3==0.1.1dev ttr.aws.utils.s3==0.3.0 ttr.utcutils==0.1.1dev 

Редактировать 2015-05-20

Все, что написано выше, все еще применяется, во всяком случае, теперь доступны небольшие модификации.

Установить pip в python 2.7.9 и python 3.4

Последние версии python поставляются с пакетом ensurepip , позволяющим установить pip даже в автономном режиме:

$python -m securitypip —upgrade

В некоторых системах (например, Debian Jessie) это недоступно (чтобы не допустить сбой системы python).

Использование grep или find

Приведенные выше примеры предполагают, что у вас установлен grep . У меня было (в то время, когда у меня была MS Windows на моей машине) был установлен набор утилит linux (включая grep). В качестве альтернативы, используйте собственную MS Windows find или просто проигнорируйте эту фильтрацию и найдите имя в более длинном списке обнаруженных пакетов python.

Источник

How to delete an installed module in Python?

Python’s package manager is called PIP. In other words, it is a tool that enables us to install Python packages and dependencies (the software elements needed by your code to function without throwing any errors) that are not already available to us through the Python Standard Library.

A computer language’s tool that makes it simple to install any external dependencies is known as a package manager. Any package can be installed or uninstalled without issue.

Steps involved for uninstalling using pip

Following are the steps to uninstall a package or module using pip command −

  • Open the command prompt.
  • With the help of «PIP uninstall module_name” command, uninstall the module.
  • The flask package will be deleted.
  • In the Python 2.7 version, flask uninstall through pip.
  • This would be «pip3.6 uninstall —user flask» for Python 3.6.
  • Following a list of the files that need to be deleted, the command will request your approval. Enter the Enter key after typing «y» to confirm this action.

Note − Installed packages that are directly on the system cannot be removed.

Example

Following example shows how to uninstall python module using pip command −

C:\Users\Lenovo>pip uninstall scipy

Output

Following is an output of the above code −

Found existing installation: scipy 1.8.1 Uninstalling scipy-1.8.1: Would remove: c:\users\lenovo\appdata\local\programs\python\python310\lib\site-packages\scipy-1.8.1.dist-info\* c:\users\lenovo\appdata\local\programs\python\python310\lib\site-packages\scipy\* Proceed (Y/n)? y Successfully uninstalled scipy-1.8.1

Note − There are a few exceptions, though. Using pip, it is difficult to delete these packages:

  • Pure distutils packages installed with python setup.py install do not leave any metadata of the files they installed.
  • The script wrappers that Python setup.py develop install.
Читайте также:  Html css to drupal

All files must be manually deleted, and any other activities performed during installation must be undone. If you are unsure about the complete list of files, you can reinstall it using the —record option and examine the results. To make a list of the installed file, you can use −

python setup.py install --record files.txt

Now that you have a list of all the files in the files.txt, you may manually delete them.

Uninstalling a package using conda

The main tool for managing package installations is the conda command. It can −

  • Form new environments for conda.
  • The Anaconda package index and current Anaconda installation can be queried and searched.
  • Installing and updating packages in conda environments that already exist.

Steps involved for uninstalling using conda

Following are the steps to uninstall a package or module using conda command −

  • To view a list of all the Anaconda virtual environments, open the Anaconda Navigator window and select the Environments menu item from the window’s left side.
  • Select the Open Terminal menu option from the popup menu list after clicking the green triangle at the end of one Anaconda virtual environment.
  • It will enter your chosen anaconda virtual environment and start a dos or terminal window.
  • With the help of «conda uninstall module_name” command, uninstall the module.
  • To confirm the uninstall outcome, execute the conda list package-name command one more.

Example

Following example shows how to uninstall python module using conda command −

(base) C:\Users\Lenovo>conda uninstall numpy

Output

Following is an output of the above code

Collecting package metadata (repodata.json): done Solving environment: done ## Package Plan ## environment location: C:\Users\Lenovo\anaconda3 removed specs: - numpy The following packages will be REMOVED: blas-1.0-mkl intel-openmp-2021.4.0-haa95532_3556 mkl-2021.4.0-haa95532_640 mkl-service-2.4.0-py39h2bbff1b_0 mkl_fft-1.3.1-py39h277e83a_0 mkl_random-1.2.2-py39hf11a4ad_0 numpy-1.23.1-py39h7a0a035_0 numpy-base-1.23.1-py39hca35cd5_0 Proceed ([y]/n)? y Preparing transaction: done Verifying transaction: done Executing transaction: done

Источник

Оцените статью