'Spyder on MacOS. Typing is very laggy

I am using Spyder with Anaconda on macOS. I have already updated Anaconda and Spyder to version 4.2.0 (4.2.1 was not found). The problem is now, that if I am typing in Spyder it takes about one second until the letters appear, which is very annoying. Is there somebody who also has this problem? Or does somebody have a suggestion on what might be the problem?



Solution 1:[1]

Had the same exact issue with Spyder 5.0.0, on Catalina; editor being very laggy (the console was fine).

Solution worked for me: Disable Kite!

From the top menus: Python > Preferences... > Completion and linting,

Deselect any option that calls Kite:

  • Notify me when Kite can provide missing completions (but is unavailable!)
  • Enable Kite provider

PS: Tried pyqt solutions with no success (this now generates warnings in the terminal every time I open Spyder).

Solution 2:[2]

(Spyder maintainer here) There are two main causes of this problem:

  1. We had several memory leakages and other serious inefficiencies that were causing a lot of sluggishness in the editor. Most of them are fixed in our 5.1.5 version, released in September 2021. Other improvements will come in 5.2.0, to be released in November 2021.

  2. If you're still experiencing this problem with those versions, it could be because you're in Big Sur. The only way to get a fix for that is by using our mac OS installer

Solution 3:[3]

I'd like to chime in and say I'm getting this on Catalina (not Big Sur).

Using Spyder 5.0.5 seemed to fix it.

-- Edit

No it didn't. I'm on Catalina and it's still laggy as hell. Using v5.0.5

Solution 4:[4]

read: https://github.com/spyder-ide/spyder/issues/14218 One solution suggests downgrading pyqt and pyqtwebengine.

vancromy commented on 17 Nov 2020 I just pip installed pyqt==5.12 and pyqtwebengine=5.12 in my base conda environment and noticed a substantial decrease in the latency! Still a bit of latency but not as pronounced as before. :)

Note: Please don't use this solution if you're using Anaconda because it could break your environments.

Solution 5:[5]

tools -> reset spyder to factory defaults
and it worked

Solution 6:[6]

Two years later, and this is still an issue. Sypder recommends installing from their DMG, which resolves the issue. What I did was create my virtual environment and instead of installing Spyder there, I installed:

conda install spyder-kernels=2.2

v2.2 is important because otherwise there may be conflicts and it won't install. Then, deactivate your environment and launch Spyder from the conda base environment.

In the bottom right of Spyder is text with the environment name. For example, mine says: conda:base(Python:3.9.12)

Click that and then "Change default environment in Preferences"

In the Preferences frame, under Python Interpreter, select Use the Following Python Interpreter From the drop down menu, select the one with the name of your environment. It should look something like:

/Users/YourComputerName/opt/anaconda3/envs/environmentname/bin/python

Click Apply, then okay.

Solution 7:[7]

Spyder works flawlessly when you install its standalone version and not from the anaconda distribution (not sure why anaconda is still not fixing it).

If you want to make use of conda virtual environment with Spyder standalone IDE, see the solution detailed below. It worked for me very well.

https://medium.com/@apremgeorge/using-conda-python-environments-with-spyder-ide-and-jupyter-notebooks-in-windows-4e0a905aaac5


# install Anaconda and create a new conda environment
conda create -n env_name python=3.7.4

# activate environment
conda activate env_name
conda install package_name

# get path of the environment
python -c “import sys; print(sys.executable)”

# install spyder-kernels (version >= 2.3.0 and <= 2.4.0)
pip install spyder-kernels

# copy the env path in Spyder IDE and restart Spyder IDE
Spyder -> preferences -> python interpreter -> use the following Python interpreter -> choose from the drop-down list or copy the env path

Solution 8:[8]

Experienced this issue on MacOS Mojave via Anaconda. Upgrading both Anaconda (v4.10.3) and Spyder (v5.0.5) didn't help. Ended up following this guide, which suggested upgrading PyQt5 and PyQtWebEngine modules. A warning was produced upon upgrading:

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
spyder 5.0.5 requires pyqtwebengine<5.13, which is not installed.
spyder 5.0.5 requires pyqt5<5.13, but you have pyqt5 5.15.4 which is incompatible.

Despite the incompatibility warning, I no longer experience latency.

Note: Please don't use this solution if you're using Anaconda because it could break your environments.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2
Solution 3
Solution 4 Carlos Cordoba
Solution 5 Kaushik J
Solution 6 ambitiousdonut
Solution 7 Bilal Thonnam Thodi
Solution 8 Carlos Cordoba