简体   繁体   English

MacOS 上的 Spyder。 打字很慢

[英]Spyder on MacOS. Typing is very laggy

I am using Spyder with Anaconda on macOS.我在 macOS 上使用带有 Anaconda 的 Spyder。 I have already updated Anaconda and Spyder to version 4.2.0 (4.2.1 was not found).我已经将 Anaconda 和 Spyder 更新到版本 4.2.0(未找到 4.2.1)。 The problem is now, that if I am typing in Spyder it takes about one second until the letters appear, which is very annoying.现在的问题是,如果我在 Spyder 中输入,大约需要一秒钟才能出现字母,这非常烦人。 Is there somebody who also has this problem?有没有人也有这个问题? Or does somebody have a suggestion on what might be the problem?或者有人对可能是什么问题提出建议?

Had the same exact issue with Spyder 5.0.0, on Catalina; Catalina 上的 Spyder 5.0.0 也有同样的问题; editor being very laggy (the console was fine).编辑器非常滞后(控制台很好)。

Solution worked for me : Disable Kite!解决方案对我有用:禁用风筝!

From the top menus: Python > Preferences... > Completion and linting ,从顶部菜单: Python > Preferences... > Completion and linting

Deselect any option that calls Kite:取消选择任何调用 Kite 的选项:

  • Notify me when Kite can provide missing completions (but is unavailable!)当 Kite 可以提供缺失的补全时通知我(但不可用!)
  • Enable Kite provider启用风筝提供者

PS: Tried pyqt solutions with no success (this now generates warnings in the terminal every time I open Spyder). PS:尝试了 pyqt 解决方案但没有成功(现在每次我打开 Spyder 时都会在终端中生成警告)。

( Spyder maintainer here ) There are two main causes of this problem: 这里是 Spyder 维护者)这个问题有两个主要原因:

  1. We had several memory leakages and other serious inefficiencies that were causing a lot of sluggishness in the editor.我们有几个 memory 泄漏和其他严重的低效问题,导致编辑器非常缓慢。 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.其中大部分已在我们于 2021 年 9 月发布的5.1.5版本中得到修复。其他改进将在5.2.0中进行,将于 2021 年 11 月发布。

  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解决这个问题的唯一方法是使用我们的mac OS 安装程序

I'd like to chime in and say I'm getting this on Catalina (not Big Sur).我想插话说我在 Catalina(不是 Big Sur)上得到了这个。

Using Spyder 5.0.5 seemed to fix it.使用 Spyder 5.0.5 似乎可以修复它。

-- Edit - 编辑

No it didn't.不,它没有。 I'm on Catalina and it's still laggy as hell.我在 Catalina 上,但它仍然滞后。 Using v5.0.5使用 v5.0.5

read: https://github.com/spyder-ide/spyder/issues/14218 One solution suggests downgrading pyqt and pyqtwebengine.阅读: https://github.com/spyder-ide/spyder/issues/14218一种解决方案建议降级 pyqt 和 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. vancromy在 2020 年 11 月 17 日发表评论,我刚刚在我的基本 conda 环境中安装了 pip pyqt==5.12 和 pyqtwebengine=5.12,并注意到延迟显着降低。 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.注意:如果您使用的是 Anaconda,请不要使用此解决方案,因为它可能会破坏您的环境。

tools -> reset spyder to factory defaults工具 -> 将 spyder 重置为出厂默认设置
and it worked它奏效了

Two years later, and this is still an issue.两年后,这仍然是一个问题。 Sypder recommends installing from their DMG, which resolves the issue. Sypder 建议从他们的 DMG 安装,这样可以解决问题。 What I did was create my virtual environment and instead of installing Spyder there, I installed:我所做的是创建我的虚拟环境,而不是在那里安装 Spyder,我安装了:

conda install spyder-kernels=2.2

v2.2 is important because otherwise there may be conflicts and it won't install. v2.2 很重要,否则可能会出现冲突并且无法安装。 Then, deactivate your environment and launch Spyder from the conda base environment.然后,停用您的环境并从conda base环境启动 Spyder。

In the bottom right of Spyder is text with the environment name. Spyder 的右下角是带有环境名称的文本。 For example, mine says: conda:base(Python:3.9.12)例如,我说: 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. 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.单击应用,然后确定。

Spyder works flawlessly when you install its standalone version and not from the anaconda distribution (not sure why anaconda is still not fixing it).当您安装它的独立版本而不是从 anaconda 发行版安装时,Spyder 可以完美运行(不知道为什么 anaconda 仍然没有修复它)。

If you want to make use of conda virtual environment with Spyder standalone IDE, see the solution detailed below.如果您想在 Spyder 独立 IDE 中使用 conda 虚拟环境,请参阅下面详细说明的解决方案。 It worked for me very well.它对我很有效。

https://medium.com/@apremgeorge/using-conda-python-environments-with-spyder-ide-and-jupyter-notebooks-in-windows-4e0a905aaac5 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

Experienced this issue on MacOS Mojave via Anaconda.通过 Anaconda 在 MacOS Mojave 上遇到此问题。 Upgrading both Anaconda (v4.10.3) and Spyder (v5.0.5) didn't help.升级 Anaconda (v4.10.3) 和 Spyder (v5.0.5) 都没有帮助。 Ended up following this guide , which suggested upgrading PyQt5 and PyQtWebEngine modules.结束了本指南,建议升级PyQt5PyQtWebEngine模块。 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.注意:如果您使用的是 Anaconda,请不要使用此解决方案,因为它可能会破坏您的环境。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM