What is the difference between Python's 'Extras' and 'site-packages' directories?

╄→гoц情女王★ 提交于 2019-12-01 11:25:14

OSX (and Linux) does not seem to like to install extra python packages in the default installation directory of python distribution.

pip can search (like python itself does) for installed modules, and if you do an upgrade will de-install the old version and install the new version in the place you asked for, defaulting to site-packages. If you closely look at the output of pip it will tell you what it removed and what it installed.

So only if you tell pip to install to the Extras directory, or would have a pip patched to do so for OSX by default, that would work.

It is actually a good thing the older versions are removed, as otherwise the version of a module you import would be depending on your search path (sys.path) and that is kind of error prone.

Whether it is supposed to dwindle can be argued, but it is a normal result of the way you do your upgrades with pip.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!