spyder: Bootstrap.py fails in version 4.x

Problem Description

While trying to install PyLS locally, bootstrap.py is unable to create the required directory spyder-4.x/external-deps/python-language-server/.installation-dir.

What steps reproduce the problem?

I followed the instructions “To start Spyder directly from your clone”: https://github.com/spyder-ide/spyder/blob/master/CONTRIBUTING.md

What is the expected output? What do you see instead?

Expected: Spyder launched. Observed: Traceback.

Paste Traceback/Error Below (if applicable)


python3 bootstrap.py
Executing Spyder from source checkout
WARNING: Ubuntu Apport exception hook is detected
         Use --no-apport option to disable it
*. Patched sys.path with /home/elkins/Downloads/spyder
*. Patched sys.path with /home/elkins/Downloads/spyder/external-deps/python-language-server
*. Patched sys.path with /home/elkins/Downloads/spyder/external-deps/spyder-kernels
*. Installing PyLS locally
error: can't create or remove files in install directory

The following error occurred while trying to add or remove files in the
installation directory:

    [Errno 2] No such file or directory: '/home/elkins/Downloads/spyder/external-deps/python-language-server/.installation-dir/test-easy-install-216349.write-test'

Versions

  • Spyder version: 4.x from github
  • Python version: 3.8.2
  • Qt version: 5.12.8
  • PyQt version: 5.14.1
  • Operating System name/version: Xubuntu 20.04.up-to-date

Fix

Replace line 165:

print("*. Installing PyLS locally")

with

print("*. Installing PyLS locally on {}".format(pyls_installation_dir))
if not osp.exists(pyls_installation_dir):
    Path(pyls_installation_dir).mkdir(parents=True)

Insert the following after line 26:

from pathlib import Path

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 21 (10 by maintainers)

Most upvoted comments

@ccordoba12 @texadactyl I can give both a shot, assuming I can reliably repro it. Your fix looks fine, apart from some semantic improvements. If a later version of setuptools fixes this, it seems it lies between (45.2.0, 49.6.0] since I had an older version than you previously (42.x).