Updating add-on requires Orange3 re-install

Viewed 271

I created an add-on on PyPI.org and can successfully import it in Orange 3.17 for Mac OSX. However, when I make a small change to the code I cannot get Orange3 to pick up the changes. It keeps referring to some cached version of the add-on.

Even when you select "Reset Widget settings" in the "Options" menu or even physically delete the ~/Library/Caches/Orange3 files, the old version keeps popping up. I uninstalled the previous add-on, then re-installed the latest version, all the while restarting Orange3. I tried many different combinations to get Orange3 to see the changes. But to no avail.

The only thing that seems to work is to completely remove Orange3 from my PC and re-install it completely. If I load the add-on then, I get the latest version with the updated code.

Is there an explanation for this behaviour? If I'm testing my add-on it's bit cumbersome to have to re-install Orange3 all the time.

Any help would be very much appreciated!

Cheers

1 Answers

When you install your add-on with pip it normally copies the source code somewhere else in the environment that Orange is using. If you want to develop add-on and see the changes directly in Orange you can register your addon with the following command:

pip install -e .

while standing in the root directory of the addon. You must have the Orange's virtual environment activated. -e option will tell pip not to copy the source but to use the code from the directory where you are developing the add-on.

When changes are pushed to PyPI you can update the add-on from the Orange's Add-ons dialog (Options>Add-ons) with checking the add-on which is updated or you can use the pip command:

pip install --upgrade <add-on name>

You must have Orange's virtual environment activated.

For development, I am suggesting to use the version of Orange from GitHub. You can install it following to instructions.

Related