在IPython控制台中运行内核的问题 [英] Problem with running Kernel in IPython console

查看:73
本文介绍了在IPython控制台中运行内核的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于IPython控制台中正在运行的内核,我的Python Spyder软件(版本4.0.1)有问题.因此,我尝试了多种方法来解决该问题,例如在Anaconda提示符下运行某些命令或将设置设置为默认模式.我什至更新了Anaconda和spyder的版本.但是,什么都没有改变,问题仍然存在.

I have a problem with the Spyder software of Python(version 4.0.1) regarding the running kernels in the IPython Console. Accordingly, I have tried many ways to resolve the issue like running some commands in Anaconda prompt or set the settings to the default mode. I even updated the version of my anaconda and the spyder. Nevertheless, nothing has been changed and the issue still exists.

这是我收到的错误:

回溯(最近通话最近):文件 "C:\ ProgramData \ Anaconda3 \ lib \ runpy.py",第193行,在 _run_module_as_main"主要",mod_spec)文件"C:\ ProgramData \ Anaconda3 \ lib \ runpy.py",第85行,在_run_code中 exec(代码,run_globals)文件 "C:\ ProgramData \ Anaconda3 \ lib \ site-packages \ spyder_kernels \ console__main __.py", start.main()文件中的第11行 "C:\ ProgramData \ Anaconda3 \ lib \ site-packages \ spyder_kernels \ console \ start.py", 在import_spydercustomize()主文件中的第287行 "C:\ ProgramData \ Anaconda3 \ lib \ site-packages \ spyder_kernels \ console \ start.py", 第39行,在import_spydercustomize导入spydercustomize文件中 "C:\ ProgramData \ Anaconda3 \ lib \ site-packages \ spyder_kernels \ customize \ spydercustomize.py", 第24行,从IPython.core.getipython导入get_ipython文件 "C:\ ProgramData \ Anaconda3 \ lib \ site-packages \ IPython__init __.py",行 56,在从.terminal.embed中导入嵌入文件 "C:\ ProgramData \ Anaconda3 \ lib \ site-packages \ IPython \ terminal \ embed.py", 从IPython.core.magic中导入第14行,导入Magics,magics_class, line_magic文件 "C:\ ProgramData \ Anaconda3 \ lib \ site-packages \ IPython \ core \ magic.py", 第20行,来自.导入oinspect文件 "C:\ ProgramData \ Anaconda3 \ lib \ site-packages \ IPython \ core \ oinspect.py", 第30行,从IPython.lib.pretty中导入pretty File "C:\ ProgramData \ Anaconda3 \ lib \ site-packages \ IPython \ lib \ pretty.py", 导入日期时间文件"C:\ Users \ mahkam \ datetime.py"中的第82行 4 ^ SyntaxError:扫描三元引号的字符串文字时EOF

Traceback (most recent call last): File "C:\ProgramData\Anaconda3\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "C:\ProgramData\Anaconda3\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\ProgramData\Anaconda3\lib\site‑packages\spyder_kernels\console__main__.py", line 11, in start.main() File "C:\ProgramData\Anaconda3\lib\site‑packages\spyder_kernels\console\start.py", line 287, in main import_spydercustomize() File "C:\ProgramData\Anaconda3\lib\site‑packages\spyder_kernels\console\start.py", line 39, in import_spydercustomize import spydercustomize File "C:\ProgramData\Anaconda3\lib\site‑packages\spyder_kernels\customize\spydercustomize.py", line 24, in from IPython.core.getipython import get_ipython File "C:\ProgramData\Anaconda3\lib\site‑packages\IPython__init__.py", line 56, in from .terminal.embed import embed File "C:\ProgramData\Anaconda3\lib\site‑packages\IPython\terminal\embed.py", line 14, in from IPython.core.magic import Magics, magics_class, line_magic File "C:\ProgramData\Anaconda3\lib\site‑packages\IPython\core\magic.py", line 20, in from . import oinspect File "C:\ProgramData\Anaconda3\lib\site‑packages\IPython\core\oinspect.py", line 30, in from IPython.lib.pretty import pretty File "C:\ProgramData\Anaconda3\lib\site‑packages\IPython\lib\pretty.py", line 82, in import datetime File "C:\Users\mahkam\datetime.py", line 4 ^ SyntaxError: EOF while scanning triple‑quoted string literal

推荐答案

(此处为 Spyder维护程序),您需要重命名或删除此文件

(Spyder maintainer here) You need to rename or remove this file

C:\Users\mahkam\datetime.py

这是因为该文件使用的是Python内部模块的相同名称,并且使依赖于该模块的其他模块感到困惑.

That's because that file is using the same name of Python internal module and that confuses other modules that depend on it.

这篇关于在IPython控制台中运行内核的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆