Does Python have a versioned dependency management

2019-02-20 11:23发布

Does Python have anything similar to apt or Maven where a single repository can house different versions of a library as opposed to just the current version?

For example: My site-packages folder does not group libraries by version. So instead of:

/Library/Python/2.7/site-packages/tox/1_2_3

We have:

/Library/Python/2.7/site-packages/tox

...which presumably contains the latest version of tox which may or may not be compatible with every piece of software on my system that wants to use tox. Is there a versioned approach to this? If not, is it possible to create one?

1条回答
狗以群分
2楼-- · 2019-02-20 11:41

No, there is no way to install multiple versions of a package in the same environment, nor import multiple versions in the same process. The commonly accepted way to handle specific versions for separate projects is to set up a virtualenv for that project and install the specific requirements.

查看更多
登录 后发表回答