takluyver / nbopen

Open a Jupyter notebook in the best available server
BSD 3-Clause "New" or "Revised" License
301 stars 58 forks source link

Can't integrate with file manager #57

Closed romanovzky closed 6 years ago

romanovzky commented 6 years ago

Hi!

Doing this on Linux (arch), when running

python -m nbopen.install_xdg

I get

xdg-mime: file '/usr/lib/python3.6/site-packages/nbopen/application-x-ipynb+json.xml' does not exist
Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/lib/python3.6/site-packages/nbopen/install_xdg.py", line 17, in <module>
    check=True)
  File "/usr/lib/python3.6/subprocess.py", line 418, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['xdg-mime', 'install', '/usr/lib/python3.6/site-packages/nbopen/application-x-ipynb+json.xml']' returned non-zero exit status 2.

The contents of /usr/lib/python3.6/site-packages/nbopen/ are

total 56
drwxr-xr-x   3 root root  4096 Jul  2 20:23 ./
drwxr-xr-x 374 root root 24576 Jul  2 20:23 ../
-rw-r--r--   1 root root   120 Jul  2 20:23 __init__.py
-rw-r--r--   1 root root  1287 Jul  2 20:23 install_win.py
-rw-r--r--   1 root root  1111 Jul  2 20:23 install_xdg.py
-rw-r--r--   1 root root    32 Jul  2 20:23 __main__.py
-rw-r--r--   1 root root  2472 Jul  2 20:23 nbopen.py
drwxr-xr-x   2 root root  4096 Jul  2 20:41 __pycache__/

Cheers!

takluyver commented 6 years ago

How did you install it before that step? The file is there in the wheel on PyPI.

romanovzky commented 6 years ago

Good point, I did it from arch repos. Works fine if sudo pip instead. Can mark as closed.

takluyver commented 6 years ago

Looking at the AUR recipe, it looks like they've done that step for you and then removed the file from the Python package. So installing it from Arch should integrate it with your file manager without needing to run the install_xdg step.