FS#70689 - [python-spyder-kernels] spyder crashs at startup.

Attached to Project: Community Packages
Opened by Simon (Giggi) - Monday, 03 May 2021, 07:30 GMT
Last edited by Bruno Pagani (ArchangeGabriel) - Tuesday, 19 October 2021, 11:35 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Jelle van der Waa (jelly)
Muflone (muflone)
Bruno Pagani (ArchangeGabriel)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 13
Private No

Details

Description:

After the start spyder crash with the following error message:

Traceback (most recent call last):
File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 568, in _build_master
ws.require(__requires__)
File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 886, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 777, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (decorator 5.0.7 (/usr/lib/python3.9/site-packages), Requirement.parse('decorator<5'), {'spyder-kernels'})

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/bin/spyder", line 33, in <module>
sys.exit(load_entry_point('spyder==5.0.0', 'gui_scripts', 'spyder')())
File "/usr/bin/spyder", line 25, in importlib_load_entry_point
return next(matches).load()
File "/usr/lib/python3.9/importlib/metadata.py", line 77, in load
module = import_module(match.group('module'))
File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 790, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "/usr/lib/python3.9/site-packages/spyder/app/start.py", line 34, in <module>
from spyder.utils.external import lockfile
File "/usr/lib/python3.9/site-packages/spyder/utils/external/lockfile.py", line 31, in <module>
from spyder.utils.programs import is_spyder_process
File "/usr/lib/python3.9/site-packages/spyder/utils/programs.py", line 29, in <module>
import pkg_resources
File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 3243, in <module>
def _initialize_master_working_set():
File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 3226, in _call_aside
f(*args, **kwargs)
File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 3255, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 570, in _build_master
return cls._build_from_requirements(__requires__)
File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 583, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 772, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'decorator<5' distribution was not found and is required by spyder-kernels




Additional info:
version: spyder 5.0.0-2


Steps to reproduce:
Start spyder in a console
This task depends upon

Closed by  Bruno Pagani (ArchangeGabriel)
Tuesday, 19 October 2021, 11:35 GMT
Reason for closing:  Fixed
Additional comments about closing:  All stack updated, sorry for the long delay.
Comment by Skupin Skupin (stefan.skupin) - Monday, 03 May 2021, 10:02 GMT
Same here. Downgrading python-decorator to version 4.4.2-4 fixes this issue.
Comment by Maxim (mxfm) - Monday, 03 May 2021, 12:36 GMT
I also can cofirm the bug. The spyder package in recent years often had problems caused by spyder upstream depending on old version of some python packages. Sometimes devs explicitly marked new versions of dependencies as not supported like 'xxx<5.0' for no reason (not because 5.0 of xxx is really incompatible with spyder, but because upstreams considers such policy as wise). I have seen discussions at spyder forum about their policy (why limit supported versions of dependecies for no reason) - they consider their current policy right.

P.S Last time such issue was fixed by patching some config file during compilation, this time it seems they pushed 'xxx<5.0' restriction somewhere in the code.
Comment by loqs (loqs) - Monday, 03 May 2021, 16:51 GMT
Upstream bug report [1]. The change that introduced the issue is [2].
Does removing the upper bound on decorator [3] resolve the issue without introducing any other issues?

[1] https://github.com/spyder-ide/spyder-kernels/issues/288
[2] https://github.com/spyder-ide/spyder-kernels/commit/a826376ee090ba22b9efe1d2734573f5429b4797
[3] PKGBUILD.diff
Comment by Simon (Giggi) - Thursday, 06 May 2021, 14:22 GMT
The fix from loqs for me is working.
Comment by Felix Salazar (phollox) - Thursday, 06 May 2021, 15:45 GMT
Upstream needs to be informed that those 2 characters (<5) need to be removed from the setup.py file

Thanks
Comment by Benoit Brummer (trougnouf) - Friday, 07 May 2021, 16:22 GMT
I got it to compile after replacing "_pkg" with "pkgname" in the above diff, but then I get "pkg_resources.DistributionNotFound: The 'pyqtwebengine<5.13' distribution was not found and is required by spyder". I guess it's still https://github.com/spyder-ide/spyder/issues/14697 .

I also removed the version from setup.py on parso, pyqt5, pyqtwebengine, and jedi then building with makepkg --noextract. Somehow I'm back to the decorator issue even though it's not in setup.py. It would be nice if they added a launch flag to ignore all of this planned obsolescence.
Comment by Ville Sinisalo (blaubos) - Friday, 11 June 2021, 18:49 GMT
Version 2.0.4 fixing this is now available upstream: https://github.com/spyder-ide/spyder-kernels/releases/tag/v2.0.4
Comment by edes (LudwigJ) - Tuesday, 06 July 2021, 02:04 GMT
By now, 2.0.5 is already out: https://github.com/spyder-ide/spyder-kernels/releases/tag/v2.0.5
It would be great to have updated packages for Arch, with this bug sorted out.
(An updated Spyder package would also be swell, Arch is already four releases behind)
Comment by st666 (st666) - Sunday, 25 July 2021, 15:37 GMT
With the recent update to python-tomli, spyder crashes again with the following error: "The 'flit-core<4,>=3.2.0' distribution was not found and is required by tomli". This time reverting the update does not help (unlike with python-decorator).
Comment by Felix Salazar (phollox) - Monday, 26 July 2021, 06:58 GMT
Actually st666. You need to install python-flit-core

It should be part of the dependencies of python-tomli
Comment by st666 (st666) - Monday, 26 July 2021, 11:24 GMT
Thanks for the tip Felix. It does work now (after downgrading python-decorator). However, python-flit-core wasn't pulled automatically as it is not required by python-tomli.
Comment by Felix Salazar (phollox) - Monday, 26 July 2021, 12:00 GMT
Yes, sorry, I was not clear enough.

python-flit-core it is not part of the dependencies of python-tomli. Therefore, manual installation is required. However, it should be within the dependency array of python-tomli.

I'm going to report it there, and probably get a faster solution than here in spyder with the decorator problem that started this thread
Comment by Simon (Giggi) - Monday, 09 August 2021, 19:11 GMT
Can somebody fix this package?
Comment by st666 (st666) - Thursday, 12 August 2021, 17:14 GMT
I hope it gets fixed soon :). Spyder has been borked in Arch since late April. Almost been 4 months and also multiple releases from upstream
Comment by Simon (Giggi) - Monday, 16 August 2021, 09:15 GMT
I also hope.

At the moment I've recompiled spyder for myself and everything is working.

To make it working you must install from AUR the following packages ...
python-lsp-black 1.0.0-1
python-lsp-jsonrpc 1.0.0-1
python-lsp-server 1.2.1-1
Comment by Felix Salazar (phollox) - Tuesday, 24 August 2021, 20:25 GMT
In its current state, Spyder is almost unusable, at least for me.
There are a few visual glitches with shadows and mouseover. All transitions are defective. The help is broken. The plots are stretched. I'm sure all this is related to one or two dependencies that are not updated. Probably the decorator that originated this thread.

I didn't wanted to install from AUR. I might switch to another IDE, maybe temporarily but who knows
Comment by Jiri Kolar (jiri) - Monday, 27 September 2021, 09:16 GMT
This should fix the error decorator<5. Updated PKGBUILD for python-spyder-kernels according to https://www.reddit.com/r/archlinux/comments/ohjj1g/spyder_easy_fix/.

   PKGBUILD (1.6 KiB)
Comment by st666 (st666) - Wednesday, 06 October 2021, 11:17 GMT
Is there any technical reason why this still hasn't been patched? Been half a year now :(
Comment by Bruno Pagani (ArchangeGabriel) - Sunday, 17 October 2021, 19:28 GMT
Please try the new versions of both spyder and python-spyder-kernels in [community-testing].
Comment by Felix Salazar (phollox) - Monday, 18 October 2021, 04:11 GMT
Hi Bruno, Thanks for uploading the update. I enabled the [community-testing] repo, requested for an update of python-{decorator,spyder-kernels} and spyder, and pacman asked to install:
python-lsp-black-1.0.0-2 python-lsp-jsonrpc-1.0.0-1 python-lsp-server-1.2.4-2 python-rtree-0.9.7-2 spatialindex-1.9.3-1 python-decorator-5.1.0-1 python-spyder-kernels-2.1.3-1 spyder-5.1.5-2

Decorator was on hold due to the problem of this thread. Starting spyder



Traceback (most recent call last):
File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 568, in _build_master
ws.require(__requires__)
File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 886, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 777, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (pyls-spyder 0.3.2 (/usr/lib/python3.9/site-packages), Requirement.parse('pyls-spyder>=0.4.0'), {'spyder'})

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/bin/spyder", line 33, in <module>
sys.exit(load_entry_point('spyder==5.1.5', 'gui_scripts', 'spyder')())
File "/usr/bin/spyder", line 25, in importlib_load_entry_point
return next(matches).load()
File "/usr/lib/python3.9/importlib/metadata.py", line 77, in load
module = import_module(match.group('module'))
File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 850, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "/usr/lib/python3.9/site-packages/spyder/app/start.py", line 47, in <module>
from spyder.utils.external import lockfile
File "/usr/lib/python3.9/site-packages/spyder/utils/external/lockfile.py", line 31, in <module>
from spyder.utils.programs import is_spyder_process
File "/usr/lib/python3.9/site-packages/spyder/utils/programs.py", line 28, in <module>
import pkg_resources
File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 3243, in <module>
def _initialize_master_working_set():
File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 3226, in _call_aside
f(*args, **kwargs)
File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 3255, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 570, in _build_master
return cls._build_from_requirements(__requires__)
File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 583, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 772, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pyls-spyder>=0.4.0' distribution was not found and is required by spyder

Installing python-pyls-spyder also from [commuity-testing] solved the issue



EDIT: tried to add some formatting in the error output, but not sure on markdown here
Comment by Bruno Pagani (ArchangeGabriel) - Monday, 18 October 2021, 09:22 GMT
Yes sorry, you should indeed also install python-pyls-spyder from [community-testing]. Does it work OK for you now?
Comment by Sibren Vasse (SibrenVasse) - Monday, 18 October 2021, 11:40 GMT
With a current up to date system with testing enabled, I get the below traceback. Seems like community-testing/flake8 1:4.0.1-1 is the issue.

~ spyder
Traceback (most recent call last):
File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 568, in _build_master
ws.require(__requires__)
File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 886, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 777, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (flake8 4.0.1 (/usr/lib/python3.9/site-packages), Requirement.parse('flake8<4.0.0,>=3.8.0'), {'python-lsp-server'})

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/bin/spyder", line 33, in <module>
sys.exit(load_entry_point('spyder==5.1.5', 'gui_scripts', 'spyder')())
File "/usr/bin/spyder", line 25, in importlib_load_entry_point
return next(matches).load()
File "/usr/lib/python3.9/importlib/metadata.py", line 77, in load
module = import_module(match.group('module'))
File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 850, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "/usr/lib/python3.9/site-packages/spyder/app/start.py", line 47, in <module>
from spyder.utils.external import lockfile
File "/usr/lib/python3.9/site-packages/spyder/utils/external/lockfile.py", line 31, in <module>
from spyder.utils.programs import is_spyder_process
File "/usr/lib/python3.9/site-packages/spyder/utils/programs.py", line 28, in <module>
import pkg_resources
File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 3243, in <module>
def _initialize_master_working_set():
File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 3226, in _call_aside
f(*args, **kwargs)
File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 3255, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 570, in _build_master
return cls._build_from_requirements(__requires__)
File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 583, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 772, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'flake8<4.0.0,>=3.8.0' distribution was not found and is required by python-lsp-server
Comment by Bruno Pagani (ArchangeGabriel) - Monday, 18 October 2021, 13:32 GMT
This is not an issue with spyder but python-lsp-server. I’ve patched it, please retry.
Comment by Sibren Vasse (SibrenVasse) - Monday, 18 October 2021, 17:35 GMT
Traceback (most recent call last):
File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 568, in _build_master
ws.require(__requires__)
File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 886, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 777, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (pyflakes 2.3.1 (/usr/lib/python3.9/site-packages), Requirement.parse('pyflakes<2.5.0,>=2.4.0'), {'flake8'})

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/bin/spyder", line 33, in <module>
sys.exit(load_entry_point('spyder==5.1.5', 'gui_scripts', 'spyder')())
File "/usr/bin/spyder", line 25, in importlib_load_entry_point
return next(matches).load()
File "/usr/lib/python3.9/importlib/metadata.py", line 77, in load
module = import_module(match.group('module'))
File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 850, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "/usr/lib/python3.9/site-packages/spyder/app/start.py", line 47, in <module>
from spyder.utils.external import lockfile
File "/usr/lib/python3.9/site-packages/spyder/utils/external/lockfile.py", line 31, in <module>
from spyder.utils.programs import is_spyder_process
File "/usr/lib/python3.9/site-packages/spyder/utils/programs.py", line 28, in <module>
import pkg_resources
File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 3243, in <module>
def _initialize_master_working_set():
File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 3226, in _call_aside
f(*args, **kwargs)
File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 3255, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 570, in _build_master
return cls._build_from_requirements(__requires__)
File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 583, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/usr/lib/python3.9/site-packages/pkg_resources/__init__.py", line 777, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (pyflakes 2.3.1 (/usr/lib/python3.9/site-packages), Requirement.parse('pyflakes<2.5.0,>=2.4.0'), {'flake8'})
Comment by Bruno Pagani (ArchangeGabriel) - Monday, 18 October 2021, 17:39 GMT
Well this one is in flake8/python-pyflakes not being updated. Bailing to Foxboron/jelle. ;p
Comment by Bruno Pagani (ArchangeGabriel) - Monday, 18 October 2021, 21:00 GMT
In the meantime can you confirm that downgrading flake8 to the community version makes spyder work?
Comment by Sibren Vasse (SibrenVasse) - Tuesday, 19 October 2021, 09:10 GMT
Yes, pinning flake8 to 1:3.9.2-2 works.
Comment by Bruno Pagani (ArchangeGabriel) - Tuesday, 19 October 2021, 11:30 GMT
OK, I’m moving from [testing] then, opened https://bugs.archlinux.org/task/72473 to track the flake8 issue.

Loading...