How Do I Remove an Incorrectly Installed Pip Package With a Leading Dash?

Linda Hamilton
Release: 2024-11-19 16:30:03
Original
343 people have browsed it

How Do I Remove an Incorrectly Installed Pip Package With a Leading Dash?

Removing Incorrectly Installed Pip Package with Leading Dash (-pkgname)

Problem:

Upon executing "pip freeze," you encounter a warning indicating an unparsable requirement (-atplotlib). "pip list" reveals an installed package called "-atplotlib." Attempts to uninstall it via pip uninstall -atplotlib result in an error (No such option: -a).

Solution:

It is safe and sufficient to manually delete the offending folders (in this case, ~atplotlib and ~atplotlib-3.0.3-py3.7.egg-info) from your site-packages directory.

Technical Explanation:

Pip now renames incorrectly installed packages to prevent importation during the uninstallation process. If uninstallation succeeds, it deletes the renamed folders. However, if uninstallation fails (as in this case), the folders remain. Deleting these folders is safe because they are no longer being used.

Pip's change from copying files to renaming them during uninstallation significantly improves performance, especially for packages with numerous files.

The above is the detailed content of How Do I Remove an Incorrectly Installed Pip Package With a Leading Dash?. 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