简体   繁体   中英

Why an uninstalled module is still importable in Python

I want to get rid of a module in Python and I use the "pip uninstall " command. However, for some reason the module is still importable. I am using VS code on a Mac OS: Here is the screenshot of the code:

在此处输入图像描述

As you can see, the yellow warning says the polars package is not installed (because I already excuted the uninstall command) however in the cell below it, the polars module has been imported succesfully? Can anyone explain what is happening and how can I completely remove the module so it is not importable anymore?

1 -Try to use %pip, maybe you are using virtual machines and %pip is 'magic' command that actually runs commands to uninstall the same package across all machines in the cluster

2- Script wrappers installed by python setup.py develop.

You need to remove all files manually, and also undo any other stuff that installation did manually.

If you don't know the list of all files, you can reinstall it with the --record option, and take a look at the list this produces. To record list of installed files, you can use:

$ python setup.py install --record files.txt

All you have to do is restart your kernel. Use this button to restart the kernel https://i.stack.imgur.com/S9Q6L.png

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM