Home > Backend Development > Python Tutorial > How to Safely Uninstall Incorrectly Installed Packages with Leading Dashes (\'-pkgname\') in Pip?

How to Safely Uninstall Incorrectly Installed Packages with Leading Dashes (\'-pkgname\') in Pip?

Linda Hamilton
Release: 2024-11-30 17:50:11
Original
443 people have browsed it

How to Safely Uninstall Incorrectly Installed Packages with Leading Dashes (

pip: Uninstalling Incorrectly Installed Packages with Leading Dashes ("-pkgname")

You may encounter an odd issue after running pip freeze, receiving a warning about an unrecognized requirement, such as "-atplotlib". Inspecting the installed packages via pip list reveals that this string is indeed recognized as a package.

Attempts to remove the package using the command pip uninstall -atplotlib result in an error message indicating an unrecognized option. To resolve this, identify the offending folders:

C:\Users\name\Anaconda3\Lib\site-packages\~atplotlib

C:\Users\name\Anaconda3\Lib\site-packages\~atplotlib-3.0.3-py3.7.egg-info
Copy after login

Is it safe and sufficient to remove these folders?

According to official documentation, it is safe to manually delete these folders from the site-packages directory. Pip has an updated uninstall mechanism that renames the folders to un-importable names before deleting them. If the deletion fails, the folders are renamed back.

In the current scenario, it appears that the failure occurred for an unknown reason. Removing the folders is safe and should resolve the issue.

The above is the detailed content of How to Safely Uninstall Incorrectly Installed Packages with Leading Dashes (\'-pkgname\') in Pip?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template