草庐IT

attributeError

全部标签

Python SQLAlchemy : AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema'

我尝试在我的项目中创建一个新的数据库,但是当我运行脚本时出现了这个错误,我有另一个使用类似定义的项目,它以前工作过,但现在出现了同样的错误。我使用的是Python2.7.8,SQLAlchemy模块的版本是0.9.8。顺便说一句,一个项目使用了Flask-SQLAlchemy,效果很好。我很困惑。回溯信息如下:Traceback(mostrecentcalllast):File"D:/Projects/OO-IM/db_create.py",line4,infrommodelsimportBaseFile"D:\Projects\OO-IM\models.py",line15,inCo

python - 导入igraph时如何解决AttributeError?

当我在我的项目中导入igraph包时,我得到一个AttributeError。这只发生在项目目录中:[12:34][~]$python2Python2.7.1(r271:86832,Apr152011,12:09:10)[GCC4.5.220110127(prerelease)]onlinux2Type"help","copyright","credits"or"license"formoreinformation.>>>importigraph>>>[12:34][~]$cdprojectdir/[12:34][projectdir]$python2Python2.7.1(r271:

python - 导入 Pandas 会出现错误 AttributeError : module 'pandas' has no attribute 'core' in iPython Notebook

我正在通过AnacondaNavigator应用程序(版本1.1.0)运行iPython笔记本。当我想导入Pandas时,它给了我一个奇怪的错误。我以为Anaconda应用包含pandas包?---------------------------------------------------------------------------AttributeErrorTraceback(mostrecentcalllast)in()---->1importpandasaspd/Users/bertcarremans/anaconda/lib/python3.5/site-package

python - BeautifulSoup: AttributeError: 'NavigableString' 对象没有属性 'name'

你知道为什么BeautifulSoup教程中的第一个例子http://www.crummy.com/software/BeautifulSoup/documentation.html#QuickStart给出AttributeError:'NavigableString'objecthasnoattribute'name'?根据thisanswerHTML中的空格字符会导致问题。我尝试使用几页的来源,并且1工作其他人给出了同样的错误(我删除了空格)。你能解释一下“name”指的是什么以及为什么会发生这个错误吗?谢谢。 最佳答案 na

python - api = twitter.Api() AttributeError : 'module' object has no attribute 'Api

我一直在尝试编写一个简单的提及抓取器来开始使用twitterApi。不管怎样,我在初始化Api时遇到了一些困难。在archlinux上运行python2我通过easy_install安装了twitter,从源代码构建它并通过pip安装它。这些似乎都不起作用。zergling::~/dev/kritter»python2Python2.7.2(default,Jan312012,13:26:35)[GCC4.6.220120120(prerelease)]onlinux2Type"help","copyright","credits"or"license"formoreinformati

python - sqlalchemy flask : AttributeError: 'Session' object has no attribute '_model_changes' on session. 提交()

我见过很多SessionMaker的问题,但这个问题略有不同。不知道为什么,但sqlalchemy不会让我的session对象提交。在我的应用程序中,我有一些代码可以:View.pyrec=session.query(Records).filter(Records.id==r).first()n=rec.checkoutRecord(current_user.id)session.add(n)session.commit()模型.py:classRecords(UserMixin,CRUDMixin,Base):__table__=Table('main_records',Base.m

python - 使用简单的 sqlite 查询在 python 中令人困惑的 AttributeError

当我在python中调用一个函数来执行查询时,我遇到了一个错误,这让我感到困惑和沮丧。我已经检查以确保我没有制表符而不是间隔缩进(检查模糊)。我遵循了此处使用的约定:http://zetcode.com/db/sqlitepythontutorial/在这里:HowtochecktheexistenceofarowinSQLitewithPython?谁能看出为什么这段看似不错的代码会抛出错误?我现在是代码盲。谢谢!错误:File"paddle-csv-import.py",line23,ingetscorecur1.execute("SELECTptsFROMmatchpointsW

python - 当我运行 Celery worker 时出现 AttributeError

我正在尝试在我的Django应用程序中使用celery作为后台进程。Django版本为1.4.8,最新适用的celery版本为3.1.25。我使用Redis(3.1.0)作为代理和后端,json作为序列化器。当我启动worker时celery-Acelery_appworker-linfo我收到属性错误'unicode'objecthasnoattribute'iteritems'我的settings.py文件:BROKER_URL='redis://localhost'CELERY_RESULT_BACKEND='redis://localhost/'CELERY_ACCEPT_CO

由PY2EXE创建的EXE返回:“ attributeError:'模块'对象没有属性'cuiautomation'”

它是一个简单的GUI脚本,编写了Python的Tinkter模块。调用油灰工具来建立一些SSH连接。问题似乎是兼容。Python版本:3.4Pywinauto版本:0.6.2PY2EXE版本:0.9.2.2创建的EXE文件在某些Windows7PC中打开,并在其他Windows7PC中打开一些错误。所有PC都是Windows7。来自CMD的追溯;C:\tools\easy_Login\easy_Login>easy_login.exeTraceback(mostrecentcalllast):File"easy_login.py",line1,inFile"",line2237,in_find

linux - 修复 AttributeError : 'file' object has no attribute 'buffer' (Python3)

Ubuntu上的Python2.7。我尝试为Python3运行小型python脚本(文件转换器),出现错误:$pythonuboot_mdb_to_image.pyoutput.binTraceback(mostrecentcalllast):File"uboot_mdb_to_image.py",line29,inascii_stdin=io.TextIOWrapper(sys.stdin.buffer,encoding='ascii',errors='strict')AttributeError:'file'objecthasnoattribute'buffer'我怀疑这是由pyt