Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spyder does not recognise rtree dependency as installed #17165

Closed
6 of 10 tasks
Richardk2n opened this issue Jan 9, 2022 · 9 comments
Closed
6 of 10 tasks

Spyder does not recognise rtree dependency as installed #17165

Richardk2n opened this issue Jan 9, 2022 · 9 comments

Comments

@Richardk2n
Copy link
Contributor

Issue Report Checklist

  • Searched the issues page for similar reports
  • Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
  • Reproduced the issue after updating with conda update spyder (or pip, if not using Anaconda)
  • Could not reproduce inside jupyter qtconsole (if console-related)
  • Tried basic troubleshooting (if a bug/error)
    • Restarted Spyder
    • Reset preferences with spyder --reset
    • Reinstalled the latest version of Anaconda
    • Tried the other applicable steps from the Troubleshooting Guide
  • Completed the Problem Description, Steps to Reproduce and Version sections below

Problem Description

A dependency missing popup appears when starting spyder:
grafik

The dependency is installed:

> pip list
Package                       Version
----------------------------- ---------
alabaster                     0.7.12
arrow                         1.2.1
astroid                       2.9.2
atomicwrites                  1.4.0
attrs                         21.4.0
autopep8                      1.6.0
Babel                         2.9.1
backcall                      0.2.0
binaryornot                   0.4.4
black                         21.12b0
bleach                        4.1.0
certifi                       2021.10.8
cffi                          1.15.0
chardet                       4.0.0
charset-normalizer            2.0.10
click                         8.0.3
cloudpickle                   2.0.0
cookiecutter                  1.7.3
cryptography                  36.0.1
debugpy                       1.5.1
decorator                     5.1.1
defusedxml                    0.7.1
diff-match-patch              20200713
docutils                      0.17.1
entrypoints                   0.3
flake8                        4.0.1
idna                          3.3
imagesize                     1.3.0
importlib-metadata            4.10.0
inflection                    0.5.1
intervaltree                  3.1.0
ipykernel                     6.6.1
ipython                       7.31.0
ipython-genutils              0.2.0
isort                         5.10.1
jedi                          0.18.1
jeepney                       0.7.1
jellyfish                     0.9.0
Jinja2                        3.0.3
jinja2-time                   0.2.0
jsonschema                    4.3.3
jupyter-client                7.1.0
jupyter-core                  4.9.1
jupyterlab-pygments           0.1.2
keyring                       23.5.0
lazy-object-proxy             1.7.1
MarkupSafe                    2.0.1
matplotlib-inline             0.1.3
mccabe                        0.6.1
mistune                       0.8.4
mypy                          0.931
mypy-extensions               0.4.3
nbclient                      0.5.9
nbconvert                     6.4.0
nbformat                      5.1.3
nest-asyncio                  1.5.4
numpydoc                      1.1.0
packaging                     21.3
pandocfilters                 1.5.0
parso                         0.8.3
pathspec                      0.9.0
pexpect                       4.8.0
pickleshare                   0.7.5
pip                           21.3.1
platformdirs                  2.4.1
pluggy                        1.0.0
poyo                          0.5.0
prompt-toolkit                3.0.24
psutil                        5.9.0
ptyprocess                    0.7.0
pycodestyle                   2.8.0
pycparser                     2.21
pydocstyle                    6.1.1
pyflakes                      2.4.0
Pygments                      2.11.2
pylint                        2.12.2
pyls-spyder                   0.4.0
pylsp-mypy                    0.5.7
pyparsing                     3.0.6
PyQt5                         5.12.3
PyQt5-sip                     12.9.0
PyQtWebEngine                 5.12.1
pyrsistent                    0.18.0
python-dateutil               2.8.2
python-lsp-black              1.0.1
python-lsp-jsonrpc            1.0.0
python-lsp-server             1.3.3
python-slugify                5.0.2
pytz                          2021.3
pyxdg                         0.27
pyzmq                         22.3.0
QDarkStyle                    3.0.2
qstylizer                     0.2.1
QtAwesome                     1.1.1
qtconsole                     5.2.2
QtPy                          2.0.0
requests                      2.27.1
rope                          0.22.0
Rtree                         0.9.7
SecretStorage                 3.3.1
setuptools                    58.1.0
six                           1.16.0
snowballstemmer               2.2.0
sortedcontainers              2.4.0
Sphinx                        4.3.2
sphinxcontrib-applehelp       1.0.2
sphinxcontrib-devhelp         1.0.2
sphinxcontrib-htmlhelp        2.0.0
sphinxcontrib-jsmath          1.0.1
sphinxcontrib-qthelp          1.0.3
sphinxcontrib-serializinghtml 1.1.5
spyder                        5.2.1
spyder-kernels                2.2.0
testpath                      0.5.0
text-unidecode                1.3
textdistance                  4.2.2
three-merge                   0.1.1
tinycss2                      1.1.1
toml                          0.10.2
tomli                         1.2.3
tornado                       6.1
traitlets                     5.1.1
typing_extensions             4.0.1
ujson                         5.1.0
urllib3                       1.26.8
watchdog                      2.1.6
wcwidth                       0.2.5
webencodings                  0.5.1
wrapt                         1.13.3
wurlitzer                     3.0.2
yapf                          0.32.0
zipp                          3.7.0

After upgrading my venv to 3.10 and installing spyder in it this first happened. I assumed that maybe the venv did not like being upgraded, deleted it, created a new one and installed only spyder and pylsp-mypy. The issue persisted. The popup occurs shortly but not immediately after spyders interface has fully loaded (single digit second delay).

Versions

  • Spyder version: 5.2.1 None
  • Python version: 3.10.1 64-bit
  • Qt version: 5.12.10
  • PyQt5 version: 5.12.3
  • Operating System: Linux 5.15.12-1-MANJARO

Dependencies

# Mandatory:
atomicwrites >=1.2.0          :  1.4.0 (OK)
chardet >=2.0.0               :  4.0.0 (OK)
cloudpickle >=0.5.0           :  2.0.0 (OK)
cookiecutter >=1.6.0          :  1.7.3 (OK)
diff_match_patch >=20181111   :  20200713 (OK)
intervaltree >=3.0.2          :  3.1.0 (OK)
IPython >=7.6.0               :  7.31.0 (OK)
jedi >=0.17.2;<0.19.0         :  0.18.1 (OK)
jellyfish >=0.7               :  0.9.0 (OK)
jsonschema >=3.2.0            :  4.3.3 (OK)
keyring >=17.0.0              :  23.5.0 (OK)
nbconvert >=4.0               :  6.4.0 (OK)
numpydoc >=0.6.0              :  1.1.0 (OK)
parso >=0.7.0;<0.9.0          :  0.8.3 (OK)
pexpect >=4.4.0               :  4.8.0 (OK)
pickleshare >=0.4             :  0.7.5 (OK)
psutil >=5.3                  :  5.9.0 (OK)
pygments >=2.0                :  2.11.2 (OK)
pylint >=2.5.0                :  2.12.2 (OK)
pyls_spyder >=0.4.0           :  0.4.0 (OK)
pylsp >=1.3.2;<1.4.0          :  1.3.3 (OK)
pylsp_black >=1.0.0           :  1.0.1 (OK)
qdarkstyle =3.0.2             :  3.0.2 (OK)
qstylizer >=0.1.10            :  0.2.1 (OK)
qtawesome >=1.0.2             :  1.1.1 (OK)
qtconsole >=5.2.1;<5.3.0      :  5.2.2 (OK)
qtpy >=1.5.0                  :  2.0.0 (OK)
rtree >=0.9.7                 :  None (NOK)
setuptools >=49.6.0           :  58.1.0 (OK)
sphinx >=0.6.6                :  4.3.2 (OK)
spyder_kernels >=2.2.0;<2.3.0 :  2.2.0 (OK)
textdistance >=4.2.0          :  4.2.2 (OK)
three_merge >=0.1.1           :  0.1.1 (OK)
watchdog >=0.10.3             :  2.1.6 (OK)
xdg >=0.26                    :  0.27 (OK)
zmq >=17                      :  22.3.0 (OK)

# Optional:
cython >=0.21                 :  None (NOK)
matplotlib >=2.0.0            :  None (NOK)
numpy >=1.7                   :  None (NOK)
pandas >=1.1.1                :  None (NOK)
scipy >=0.17.0                :  None (NOK)
sympy >=0.7.3                 :  None (NOK)
@RolBurgHxgn
Copy link

I have exactly the same issue.
On Fedora Linux, based on Python3.10, I installed spyder and spyder-kernels with pip in a venv. I noticed that rtree is installed but fails on import, thus Spyder gives this error after startup.
So the issue really is on the side of rtree.
But is rtree needed anyways? Maybe it can be removed as a dependency?

@steff456
Copy link
Member

Hi guys, can you please use the installation via conda to use the packages from the conda-forge channel? We know there's an issue in the distributed wheels of rtree in pip, so maybe that's what is causing the error message to pop up.

@RolBurgHxgn
Copy link

Hi Steff, thanks for the proposal, for sure that would fix the issue (although I did not try yet). For the future, I propose to evaluate, if rtree is really needed. I did a quick search in the spyder sources, to me it seems it is not really needed. Having less dependencies is always a nice thing...

@Richardk2n
Copy link
Contributor Author

Seemingly there are also people having issues with conda (however on Windows):
Toblerity/rtree#196

Looks to be a different issue, but that also seems to be caused by rtree.

On that repo it is stated to install rtree via pip and honestly i just prefer pip. Not sure if it work with conda though as rtree seems to have several issues at the moment. All spyder could probably do is see if it is really required because it seems to run fine without it, however I have not looked yet where it is used.

In terms of workaround:
On my linux i noticed, that the libs, that rtree tries to load is not being installed at all so i copied site-packages/Rtree.libs and site-packages/rtree/lib from an old venv and it works.

@ccordoba12
Copy link
Member

ccordoba12 commented Jan 15, 2022

For the future, I propose to evaluate, if rtree is really needed. I did a quick search in the spyder sources, to me it seems it is not really needed. Having less dependencies is always a nice thing...

It is really needed, we know what we're doing. Please refrain from these sort of passive-aggressive comments in the future to get your problems fixed. It doesn't help your case at all.

On my linux i noticed, that the libs, that rtree tries to load is not being installed at all so i copied site-packages/Rtree.libs and site-packages/rtree/lib from an old venv and it works.

That means this is a problem with the way Rtree is trying to detect and load the compiled libraries it depends on, not with Spyder. So please report it on their repo (linked in the previous @Richardk2n comment).

Another solution that works for most people on Linux is to install libspatialindex with your distro package manager.

@ccordoba12
Copy link
Member

Closing because this is definitely not our problem and, as @steff456 said, there's already a simple solution for it: use Anaconda or Miniconda, along with conda-forge, for a much stable and robust Spyder experience.

@hobu
Copy link

hobu commented Feb 4, 2022

We know there's an issue in the distributed wheels of rtree in pip,

Toblerity/rtree#206 is an attempt to fix that. If you could please download the wheel artifacts from the final ✅ GitHub Action for your platform and test, it would be very helpful.

@ccordoba12
Copy link
Member

@hobu, thanks a lot for your help with this problem! I tested the Linux wheel on a Python 3.10 environment and it's working as expected (whereas the current one on PyPI is triggering the error mentioned here).

@simaoafonso-pwt
Copy link

I can confirm this bug. I'm using 32-bits Python 3.10, and there's no wheels published for this OS, so the package is installed, but cannot be imported. I can't use 64 bits version because I'm interacting with some 32-bits drivers.

Is there a way to waive this warning on Sphinx itself? Is this such a critical package that it's not possible to disable some feature and live with it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants