Repository: biolab/orange3

Issue:
Running Add-ons produces an Error
**Steps to reproduce:**
- Do `sudo pip install Orange3-DataFusion`
- Do `sudo pip install Orange3-Network`
- Run Orange
- Open **Add-ons** tab

The following message window appears:

```
--------------------------------------------------------------------------------
KeyError                                      Traceback (most recent call last):
  File "/usr/lib/python3.5/site-packages/Orange/canvas/application/addons.py", line 418, in _set_packages
    packages = f.result()
  File "/usr/lib/python3.5/concurrent/futures/_base.py", line 398, in result
    return self.__get_result()
  File "/usr/lib/python3.5/concurrent/futures/_base.py", line 357, in __get_result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/lib/python3.5/site-packages/Orange/canvas/application/addons.py", line 544, in list_pypi_addons
    Installable(release["name"], release["version"],
KeyError: 'name'
```

Seriously, guys, **Orange** is in sort of unusable state.
I have been using the app on a daily basis in my work few years ago.
It was pretty stable.



Discussion:
Ack. Please retry with the latest version of Orange.

Tried with **3.2.dev0** from github.

Cloned into `/home/dev/orange3` and installed from there.
Running the app as usual `python -m Orange.canvas`

Same error but now in the add-ons window it also says:
`You don't have permissions to write into Orange directory`

Thanks for your report. You can easily solve it by installing orange into a virtualenv you have permission to write to, e.g.

``` bash
virtualenv -p python3 orange3venv
source orange3venv/bin/activate
cd orange3
python setup.py develop  # or install if you don't ever intend to submit patches
```

This will install Orange, including add-ons later on, into that virtualenv instead of _/usr/local/lib/python..._ In fact, best have a look at this [shell script](http://biolab.github.io/install-orange/setup-ubuntu.sh).

@biolab Should we install add-ons into _~/.local/share/Orange3/add-ons/_ (or equivalent) with `pip install --target` and insert the same path into `sys.path` on initialization? IIUC, this should solve this issue, any similar issues, and the need to _install_ the dmg on Macs.

Thanks, will do.
You should probably rename the script into some distro agnostic.
It does not have anything ubuntu specific and I didn't use it only because of mentioned "ubuntu" .

Also, last time I checked **ubuntu** symlinked `python2` for `python` call. So, in the script `python setup.py develop` will call `python2`. 
You've obviously tested it on **ubuntu** already though...

> You've obviously tested it on ubuntu already though...

Haha. Good one. :smile: 

> @biolab Should we install add-ons into ~/.local/share/Orange3/add-ons/ (or equivalent)
> with pip install --target and insert the same path into sys.path on initialization?
> IIUC, this should solve this issue, any similar issues, and the need to install the dmg on Macs.

I use `pip install --user` on my system for almost all pip installs and it works as it should. No need for root privileges, uses a sensible location on all platforms and no need to insert locations into `sys.path` (should be there by default).


Resolving patch:
diff --git a/Orange/canvas/application/addons.py b/Orange/canvas/application/addons.py
--- a/Orange/canvas/application/addons.py
+++ b/Orange/canvas/application/addons.py
@@ -597,16 +597,19 @@ def list_pypi_addons():
     packages = []
 
     for release, urls in zip(release_data, release_urls):
-        urls = [ReleaseUrl(url["filename"], url["url"],
-                           url["size"], url["python_version"],
-                           url["packagetype"])
-                for url in urls]
-        packages.append(
-            Installable(release["name"], release["version"],
-                        release["summary"], release["description"],
-                        release["package_url"],
-                        urls)
-        )
+        if release and urls:
+            # ignore releases without actual source/wheel/egg files,
+            # or with empty metadata (deleted from PyPi?).
+            urls = [ReleaseUrl(url["filename"], url["url"],
+                               url["size"], url["python_version"],
+                               url["packagetype"])
+                    for url in urls]
+            packages.append(
+                Installable(release["name"], release["version"],
+                            release["summary"], release["description"],
+                            release["package_url"],
+                            urls)
+            )
 
     return packages
 


Test patch: