Spyder IDE无法在Windows 10上使用Python 3.8启动

先生先生

注意:此问题已在Spyder 4.1.3中修复!


(原始问题)在Windows 10上检查Python 3.8(x64),尝试设置时遇到麻烦Spyder注意:在干净的Windows-10系统上全新安装Python可以重现此问题。但是,在Linux上没有这样的问题(已在debian / Mint19.x上测试)。

最初,通过安装过程一切顺利pip install spyder


错误#1: pywin32

启动后Spyder,它在IPython控制台窗口中说:

Traceback (most recent call last):
File "c:\users\USERNAME\appdata\local\programs\python\python38\lib\site‑packages\spyder\plugins\ipythonconsole.py", line 1572, in create_kernel_manager_and_kernel_client
kernel_manager.start_kernel(stderr=stderr_handle)
File "c:\users\USERNAME\appdata\local\programs\python\python38\lib\site‑packages\jupyter_client\manager.py", line 240, in start_kernel
self.write_connection_file()
File "c:\users\USERNAME\appdata\local\programs\python\python38\lib\site‑packages\jupyter_client\connect.py", line 470, in write_connection_file
self.connection_file, cfg = write_connection_file(self.connection_file,
File "c:\users\USERNAME\appdata\local\programs\python\python38\lib\site‑packages\jupyter_client\connect.py", line 141, in write_connection_file
with secure_write(fname) as f:
File "c:\users\USERNAME\appdata\local\programs\python\python38\lib\contextlib.py", line 113, in __enter__
return next(self.gen)
File "c:\users\USERNAME\appdata\local\programs\python\python38\lib\site‑packages\jupyter_core\paths.py", line 424, in secure_write
win32_restrict_file_to_user(fname)
File "c:\users\USERNAME\appdata\local\programs\python\python38\lib\site‑packages\jupyter_core\paths.py", line 359, in win32_restrict_file_to_user
import win32api
ImportError: DLL load failed while importing win32api: Das angegebene Modul wurde nicht gefunden.

我可以通过pywin32_postinstall.py -install从scripts文件夹运行cmd具有提升权限提示符)来修复导入错误该复制pythoncom38.dllpywintypes38.dll\Lib\site-packages\pywin32_system32\windows\system32,另请参见此处-但是,我建议不要修改系统文件夹,并使用我在下面的答案输入的选项


错误#2: tornado

但是,现在Spyder仅冻结在加载屏幕上(显示徽标,并说“初始化主窗口”之类的内容)!

https://github.com/spyder-ide/spyder.git克隆Spyder的开发版本并通过运行它python bootstrap.py --debug揭示了冻结的原因:

2019-11-03 17:39:53,261 [ERROR] [tornado.application] -> Exception in callback functools.partial(<function ThreadedZMQSocketChannel.__init__.<locals>.setup_stream at 0x0000015E00B758B0>)
Traceback (most recent call last):
  File "C:\Users\USERNAME\AppData\Local\Programs\Python\Python38\lib\site-packages\tornado\ioloop.py", line 743, in _run_callback
    ret = callback()
  File "C:\Users\USERNAME\AppData\Local\Programs\Python\Python38\lib\site-packages\jupyter_client\threaded.py", line 48, in setup_stream
    self.stream = zmqstream.ZMQStream(self.socket, self.ioloop)
  File "C:\Users\USERNAME\AppData\Local\Programs\Python\Python38\lib\site-packages\zmq\eventloop\zmqstream.py", line 127, in __init__
    self._init_io_state()
  File "C:\Users\USERNAME\AppData\Local\Programs\Python\Python38\lib\site-packages\zmq\eventloop\zmqstream.py", line 546, in _init_io_state
    self.io_loop.add_handler(self.socket, self._handle_events, self.io_loop.READ)
  File "C:\Users\USERNAME\AppData\Local\Programs\Python\Python38\lib\site-packages\tornado\platform\asyncio.py", line 99, in add_handler
    self.asyncio_loop.add_reader(fd, self._handle_events, fd, IOLoop.READ)
  File "C:\Users\USERNAME\AppData\Local\Programs\Python\Python38\lib\asyncio\events.py", line 501, in add_reader
    raise NotImplementedError
NotImplementedError

...因此看来,由Python 3.8版本引起的导入错误pywin32只是一个问题。还有一个与tornadoIO(Web服务器)有关的问题,请参阅here / here

最后使用Python 3.8.2(AMD64),Spyder 4.1.1检查。请注意,我没有使用Anaconda。使用conda 或之一 pip,不要同时使用。

先生先生

Spyder 4.1.3更新:问题已修复!

(在Python 3.8.3rc1,龙卷风6.0.4上测试)

如果您来到这里仍然遇到Spyder的类似启动问题:尝试的第一件事,我建议升级到Spyder版本> = 4.1.3


此答案的旧版本

解决方法,龙卷风问题:

修改文件...\Python38...\Lib\site-packages\tornado\platform\asyncio.py

import sys
if sys.platform == 'win32':
    asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())

在其他import语句之后。来源:在SO上也可以在此处链接如果我回购权获得职位tornado,这可能是一个永久的解决方法。


如果还需要-解决方法,pywin32问题:

修改文件...\Python38\Lib\site-packages\jupyter_core\path.py加一行

import pywintypes

import win32api在359行之前。此修改基于文章。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

Windows 10 上的 Anaconda:iPython 和 Spyder 在 Python3 环境中无法启动

Windows 10上的Pip Install Spyder(无法启动)

Spyder无法启动

如何使Spyder IDE在Ubuntu 12.04 LTS中使用Python 3?

Spyder无法启动:spyder:找不到命令

spyder IDE的ipython启动配置

在Spyder IDE(或Anaconda3 Prompt)上运行Pyinstaller

在Windows下,直到重新启动内核后,在spyder中才能看到python3库的更改

PYTHON SPYDER在LUBUNTU上的启动问题

在Raspberry Pi上使用python 3安装Spyder

Conda更新后无法启动Spyder

由于绝地问题,Anaconda Spyder 无法启动

将Python 3 Spyder控制台中的Windows 8代码页从cp1252更改为utf-8

python 文件在 Spyder 上无法正常运行

Windows 10的Anaconda(Python 2.7)的内核错误。Spyder IDE控制台错误

使用17.10进行spyder 3颜色校准

Spyder无法在Windows 10的Anaconda虚拟环境中运行

在不重新启动Spyder的情况下无法两次运行Python脚本

使用Spyder IDE,如何从“ goto definition”返回?

如何在Spyder IDE中使用Javascript?

如何在Spyder 3中使用Python 3?

刚刚安装了 Anaconda 我如何启动 spyder ide 或 pycharm?

无法使用Spyder IDE在浏览器中运行python脚本

Windows 8/10上的NetBeans IDE缩放

在Mac上安装适用于python3的spyder

无法在Windows 10,Visual Studio 2015上启动Windows 8 Universal App的模拟器

安装后,Ubuntu无法启动(在Windows 8上)

在Windows 10上使用python 3运行cassandra cqlsh

在Linux上将Spyder与Python 2.7和Python 3结合使用