Python:NameError:未定义名称"StandardError" [英] Python : NameError: name 'StandardError' is not defined

查看:115
本文介绍了Python:NameError:未定义名称"StandardError"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用SST开发一个网站-Web测试框架(我是初学者),但是python有问题

I'm currently developing a website with the SST - Web Test Framework (i'm very beginner) but I have a problem with python

我使用了此链接: https://pypi.python.org/pypi/sst/0.2.2

我正在使用-Python 3.6.4和SST-Web测试框架-最新版本:0.2.4

I m using - Python 3.6.4 and SST - Web Test Framework- Latest Version: 0.2.4

我的代码是:

from sst.actions import *
go_to('http://www.google.com/')

错误是:

C:\Python\scrapy-master\Projects>python proxyhar.py
Traceback (most recent call last):
File "proxyhar.py", line 1, in <module>
from sst.actions import *
File "C:\Python\lib\site-packages\sst\actions.py", line 104, in <module>
class EndTest(StandardError):
NameError: name 'StandardError' is not defined

任何人都建议我如何解决这个问题.

Anyone suggest me how to resolve this.

谢谢

推荐答案

sst仅支持Python 2,即使pip允许您为Python 3安装它.错误NameError: name 'StandardError' is not defined来自sst尝试使用内置异常StandardError在Python 3中已将其删除.要解决此问题,您可以使用其他模块(建议使用),也可以降级到Python 2.7.

sst only supports Python 2 even though pip will let you install it for Python 3. The error NameError: name 'StandardError' is not defined is from sst trying to use the built in exception StandardError which was removed in Python 3. To resolve this, you can either use a different module (which I would recommend) or downgrade to Python 2.7.

这篇关于Python:NameError:未定义名称"StandardError"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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