使用Anaconda的Spyder时缩进是否存在问题 [英] Is there something issue in indentation, while using Anaconda's Spyder
本文介绍了使用Anaconda的Spyder时缩进是否存在问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
from selenium import webdriver
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
此代码段在Anaconda的Spyder中运行时弹出缩进错误.这是下面的错误:
This code snippet pops an error of indentation while running in Anaconda's Spyder. This the below error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\Panch\AppData\Local\Continuum\anaconda3\lib\site-packages\selenium\webdriver\__init__.py", line 18, in <module>
from .firefox.webdriver import WebDriver as Firefox # noqa
File "C:\Users\Panch\AppData\Local\Continuum\anaconda3\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 29, in <module>
from selenium.webdriver.remote.webdriver import WebDriver as RemoteWebDriver
File "C:\Users\Panch\AppData\Local\Continuum\anaconda3\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 27, in <module>
from .remote_connection import RemoteConnection
File "C:\Users\Panch\AppData\Local\Continuum\anaconda3\lib\site-packages\selenium\webdriver\remote\remote_connection.py", line 34, in <module>
from .errorhandler import ErrorCode
File "C:\Users\Panch\AppData\Local\Continuum\anaconda3\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242
raise exception_class(message, screen, stacktrace)
^
IndentationError :unindent与任何外部缩进级别都不匹配
IndentationError: unindent does not match any outer indentation level
请让我知道我是否缺少任何东西.
Please let me know if anything I am missing out.
推荐答案
这是奇怪的行为,但也许 selenium \ webdriver \ remote \ errorhandler.py
文件已损坏.
It is strange behavior but maybe somehow file selenium\webdriver\remote\errorhandler.py
was broken.
您可以在具有功能将制表符转换为空格"
的文本编辑器中打开此文件,使用此功能并将其保存回同一文件.
You can open this file in text editor which has function "convert tabs to spaces"
, use this function and save it back to the same file.
这篇关于使用Anaconda的Spyder时缩进是否存在问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文