ChinaUnix.net
相关文章推荐:

in gc has no object

请教大家个问题,昨天网上找了个抓取网页天气的程序,为什么在 win32 cmd 终端执行老是报错呢,在linux就没事 win32:Python 3.3.2 linux:Python 2.4.3 win32 报错如下: Traceback (most recent call last): File "gw.py", line 14, in weatherList=getWeather(getHtml('http://gd.weather.com.cn/index.shtml')) File "gw.py", line 5, in getHtml page=urllib.urlopen(url) AttributeError: 'module' o...

by asdf2110 - Python - 2014-08-20 14:00:31 阅读(9271) 回复(7)

相关讨论

大家好,[code] >>> import httplib >>> conn = httplib.HTTPConnection("192.168.0.1") >>> >>> conn = httplib.HTTPSConnection('192.168.0.1') Traceback (most recent call last): File "", line 1, in AttributeError: 'module' object has no attribute 'HTTPSConnection'[/code]请问这个是什么问题呢? 谢谢!

by bryanw - Python - 2011-11-30 13:43:42 阅读(5189) 回复(2)

这一个测试用例,判断有没有登录成功, self.assertEqual(sel.getValue("xpath=//*[@id='settings-email-address']"), self.verificationErrors),提示错误 selenium' object has no attribute 'getValue 求解答 # coding=gbk from selenium import selenium import unittest, time, re class NewTest(unittest.TestCase): def setUp(self): self.verificationErrors = ["xxxxx@163.com"] self.sel...

by wsywfw3 - Python - 2011-08-31 19:38:55 阅读(3996) 回复(4)

windows 环境下报错:[code]import sys reload(sys) sys.setdefaultencoding( 'utf8') #--*- coding:gbk --*-- import pickle as p #import pickle as p shoplistfile = 'shoplist.data' # the name of the file where we will store the object shoplist = ['apple', 'mango', 'carrot'] # Write to the file f = open(shoplistfile, 'wb') p.dump(shoplist, f) # dump the object to a file f.close() del shoplist # remov...

by 杨奇龙 - Python - 2011-07-25 14:09:13 阅读(14267) 回复(5)

如题:小弟装了个 pygame ,在vi中输入代码,然后运行出现如下错误: AttributeError: 'module' object has no attribute 'init' 我输入的代码的前两行就是: import pygame pygame.init() 但是 我在python 的命令行界面中 运行: import pygame pygame.init() 没有出错,能得到返回值。 我的系统是ubuntu,pygame使用apt-get装的. 百思不得其解,望各位帮助。

求助

by 116407711 - Python - 2010-02-08 18:17:02 阅读(5412) 回复(2)

>>> sys.setdefaultencoding('utf8') Traceback (most recent call last): File "", line 1, in ? AttributeError: 'module' object has no attribute 'setdefaultencoding' 看手册上写着有呀。。。。在linux下怎么就没了呢。

by wudicc - Python - 2006-05-23 18:25:50 阅读(3832) 回复(1)

body = response.body_as_unicode().strip().encode('utf8') or '' exceptions.AttributeError: 'Response' object has no attribute 'body_as_unicode' scrapy抓取时报这个错

by yakczh_cu - Python - 2013-04-18 10:46:01 阅读(2287) 回复(3)

How do you check to see if an object has a particular method? Choice 1 By calling the method with a null value Choice 2 By using the can() method on the object Choice 3 By calling the method with a true value Choice 4 By using the available() method on the object Choice 5 By calling the method with a scalar value of "available"

by 317550564 - Perl - 2012-04-25 00:58:17 阅读(821) 回复(0)

本帖最后由 ubuntu_mark 于 2011-08-02 12:20 编辑 Caught AttributeError while rendering: 'str' object has no attribute '_meta' Request Method: GET Request URL: http://127.0.0.1:8000/ Django Version: 1.3 Exception Type: TemplateSyntaxError Exception Value: Caught AttributeError while rendering: 'str' object has no attribute '_meta' Exception Location: /usr/local/lib/python2.6/dist-packag...

by ubuntu_mark - Python - 2012-05-03 17:45:14 阅读(7140) 回复(3)

模組zipfile明明有屬性ZipFile的旦為甚麼會說沒有 我在interactive裡也試有的 Exception in thread Thread-39: Traceback (most recent call last): File "C:\Python32\lib\threading.py", line 740, in _bootstrap_inner self.run() File "C:\Users\jack\Desktop\zip-test3.py", line 12, in run f = zipfile.ZipFile(self.outfile, state, zipfile.ZIP_DEFLATED) AttributeError: 'module' object has no attribu...

by dreamlearn - Python - 2012-07-23 17:37:33 阅读(2145) 回复(0)

新手提问。 在winxp下python2.5+mod_python+apache2.0环境下一切正常。 把程序复制到 rhel5.4+python2.4+mod_python+apache2.0下出错。 程序如下: 从表单中获取数据: psp语句中写入 <% ... act=req.form['act'] ... %> 这样在语句,立即出错: AttributeError: 'mp_request' object has no attribute 'form' 请教各位朋友,谢谢。

by crykun - Python - 2012-04-14 18:22:30 阅读(1347) 回复(1)