Long Doan
Long Doan

Reputation: 313

How to import 2 versions of a package in Python?

I am currently having the library IPython version 5.5 for interface. I am planning to use one function, but unfortunately it has been removed from the library since version 2. As I cannot relegate my current IPython back to version 1 (since it would cause conflict with other library), is there anyway I could install 2 versions of IPython (by renaming one, like IPython_old)?

Upvotes: 0

Views: 88

Answers (1)

Eladtopaz
Eladtopaz

Reputation: 1054

You could achieve this by using a virtual environment with venv module. Using venv you could have different directories with different versions of every library you want. Here are the docs:

https://docs.python.org/3/library/venv.html

And here is a good tutorial of how to really use this:

https://www.youtube.com/watch?v=N5vscPTWKOk

Upvotes: 1

Related Questions