Spyder: No xdg-open on VM instance

Created on 10 Aug 2020  路  4Comments  路  Source: spyder-ide/spyder

Description

What steps will reproduce the problem?

On a VM instance (e.g. google cloud) without xdg-open, run spyder using ssh -X, then use "Show in external file explorer".

Traceback

  File "/usr/local/anaconda3/envs/ludwig/lib/python3.7/site-packages/spyder/plugins/editor/widgets/editor.py", line 621, in show_in_external_file_explorer
    show_in_external_file_explorer(fnames)
  File "/usr/local/anaconda3/envs/ludwig/lib/python3.7/site-packages/spyder/plugins/explorer/widgets/explorer.py", line 70, in show_in_external_file_explorer
    open_file_in_external_explorer(fname)
  File "/usr/local/anaconda3/envs/ludwig/lib/python3.7/site-packages/spyder/plugins/explorer/widgets/explorer.py", line 58, in open_file_in_external_explorer
    subprocess.call(["xdg-open", filename])
  File "/usr/local/anaconda3/envs/ludwig/lib/python3.7/subprocess.py", line 339, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/usr/local/anaconda3/envs/ludwig/lib/python3.7/subprocess.py", line 800, in __init__
    restore_signals, start_new_session)
  File "/usr/local/anaconda3/envs/ludwig/lib/python3.7/subprocess.py", line 1551, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'xdg-open': 'xdg-open'

Versions

  • Spyder version: 4.1.3
  • Python version: 3.7.7
  • Qt version: 5.9.6
  • PyQt5 version: 5.9.2
  • Operating System: Linux 5.3.0-1032-gcp

Dependencies


# Mandatory:
atomicwrites >=1.2.0           :  1.3.0 (OK)
chardet >=2.0.0                :  3.0.4 (OK)
cloudpickle >=0.5.0            :  1.3.0 (OK)
diff_match_patch >=20181111    :  20181111 (OK)
intervaltree                   :  None (OK)
IPython >=4.0                  :  7.10.1 (OK)
jedi =0.15.2                   :  0.15.2 (OK)
keyring                        :  None (OK)
nbconvert >=4.0                :  5.6.1 (OK)
numpydoc >=0.6.0               :  0.9.2 (OK)
parso =0.5.2                   :  0.5.2 (OK)
pexpect >=4.4.0                :  4.8.0 (OK)
pickleshare >=0.4              :  0.7.5 (OK)
psutil >=5.3                   :  5.7.0 (OK)
pygments >=2.0                 :  2.6.1 (OK)
pylint >=0.25                  :  2.4.4 (OK)
pyls >=0.31.9;<0.32.0          :  0.31.9 (OK)
qdarkstyle >=2.8               :  2.8 (OK)
qtawesome >=0.5.7              :  0.7.0 (OK)
qtconsole >=4.6.0              :  4.7.2 (OK)
qtpy >=1.5.0                   :  1.9.0 (OK)
rtree >=0.8.3                  :  0.9.3 (OK)
sphinx >=0.6.6                 :  2.4.4 (OK)
spyder_kernels >=1.9.1;<1.10.0 :  1.9.1 (OK)
watchdog                       :  None (OK)
xdg >=0.26                     :  0.26 (OK)
zmq >=17                       :  18.1.1 (OK)

# Optional:
cython >=0.21                  :  None (OK)
matplotlib >=2.0.0             :  3.1.2 (OK)
numpy >=1.7                    :  1.17.3 (OK)
pandas >=0.13.1                :  0.25.3 (OK)
scipy >=0.17.0                 :  1.3.2 (OK)
sympy >=0.7.3                  :  None (OK)
Find in files Bug

All 4 comments

Hi @SimonDeRidder,
We will work in fixing this error in our next release of Spyder! Thanks for reporting :)

@juanis2112 can you please take a look at this one?

The idea is to catch the error with a try/except and detect if xdg-open is present in the error message and create a dialog to inform the user that the functionality depends on that executable which is present in Ubuntu or Debian

Will do!

on that executable which is present in Ubuntu or Debian

To clarify what @steff456 meant here: the xdg-open executable is part of the xdg-utils package on those Linux distros.

Was this page helpful?
0 / 5 - 0 ratings