#๐Ÿ”’ How to downgrade a module in anaconda jupyter notebook ?

27 messages ยท Page 1 of 1 (latest)

supple isle
#

Hi,
I have some code that needs to run on astroquery 0.4.3 and some that needs to run on astroquery 0.4.7.

How can i do this on jupyter notebook from anaconda ?

Thanks for your help !

whole thunderBOT
#

@supple isle

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

fierce iris
#

Since both versions of the package share the same name only one can be installed at a time

#

Install the version you use more frequently, the other you can import from the local directory under an alias

supple isle
fierce iris
#

The other version will import the older version under a different name

Eg import some-package as other-package

#

That way you get to use both versions

supple isle
#

the point i dont get is how do i install the older version ?

I-ve always only use pip install to install module but if I use this it will erase the newer one

fierce iris
#

You cannot install another version of the same package

#

At least for the moment

#

Installing another version will overwrite your current installation

supple isle
#

yes that what i understood

#

so how should i go then ?

supple isle
#

You can tell it to install a specific version, but it will override the other one. On the other hand, using two virtualenvs will let you install both versions on the same machine, but not use them at the same time.

Your best bet is to install both versions manually by putting them in your Python path with a different name.

But if your two libs expect them to have the same name (and they should), you will have to modify them so they pick up the version they need with some import alias such as:

import dependencyname_version as dependencyname
There is currently no clean way to do this. The best you can do is hope for this hack to work.

I'd rather ditch one of the two libs and replace it with an equivalent, or patch it to accept the new version of the dependency and give the patch back to the community.


Im trying to do this but i dont understand how to go about this part : "Your best bet is to install both versions manually by putting them in your Python path with a different name."

dark hill
#

Are you sure you can't fix the code to support the latest version?

supple isle
supple isle
dark hill
#

Ah in a bug fix release that's very bad

#

What function did they remove?

dark hill
#

If you need to integrate them then you'll need to call one virtual environment in a subprocess from the other

whole thunderBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.