简体   繁体   中英

Do I need to uninstall Python package before upgrading to newer version?

I'm running Python on Windows and usually install packages using pre-built binaries. When I upgrade packages (ex. from matplotlib-1.0.0 to matplotlib-1.1.1) do I need to uninstall the earlier version first?

I did a test upgrading matplotlib without uninstalling the previous version and everything seems to be okay. matplotlib.__version__ shows '1.1.1'. So did distutils just overwrite files, potentially leaving old files cluttering my site-packages folder? Or did the installer look for previous installations, remove those first, and then install the new version?

如果你正在使用pip ,你可以做pip install package --upgrade ,但你会发现它基本上与uninstall相同,然后是全新安装。

you have to uninstall it:

pip uninstall matplotlib

This will clutter your site package or worse

Yes, you need a clean install. I've shot my leg when upgrading from matplotlib 1.2.1 to 1.3.1 w/o removing first the old package.

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