Home >Backend Development >Python Tutorial >Why Is `-atplotlib` Listed in `pip list` After a Typo During Installation?

Why Is `-atplotlib` Listed in `pip list` After a Typo During Installation?

Mary-Kate Olsen
Mary-Kate OlsenOriginal
2024-11-20 17:59:25837browse

Why Is `-atplotlib` Listed in `pip list` After a Typo During Installation?

Pip: Removing Incorrectly Installed Packages with Leading Dash (-pkgname)

After executing pip freeze, users may encounter the warning: "WARNING: Could not parse requirement: -atplotlib." Subsequently, running pip list reveals the existence of an odd "package" named "-atplotlib." Attempts to uninstall it using pip uninstall -atplotlib result in the error: "No such option: -a."

Cause of the Issue:

The issue stems from a typo during the installation or upgrade of matplotlib, leading to the incorrect installation of "-atplotlib."

Solution: Manually Deleting Directories

To resolve the issue, it is safe to manually delete the following directories:

  • C:UsersnameAnaconda3Libsite-packages~atplotlib
  • C:UsersnameAnaconda3Libsite-packages~atplotlib-3.0.3-py3.7.egg-info

Explanation:

According to the documentation, Pip now renames previously installed packages to an un-importable name during uninstallation. Only after successful confirmation of all necessary actions, including upgrades and installations, does it delete the renamed directories. The directories remain if the process is interrupted or fails. In this case, the directories should be safe to delete manually.

The above is the detailed content of Why Is `-atplotlib` Listed in `pip list` After a Typo During Installation?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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