国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

AttributeError: ‘OptionEngine‘ object has no attribute ‘execute‘

這篇具有很好參考價(jià)值的文章主要介紹了AttributeError: ‘OptionEngine‘ object has no attribute ‘execute‘。希望對大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問。

背景

pandas:1.5.2
sqlalchemy:2.0.4


import pandas as pd
from sqlalchemy 
import create_engine # SQLAlchemy v. 2.0!

sql_engine = create_engine('postgresql://user:pass@host:5432/database')

df = pd.read_sql(f'''    SELECT * FROM table LIMIT 100''',
    sql_engine)

報(bào)錯(cuò)


Traceback (most recent call last):
   File "/app/test.py", line 31, in <module>
     df = pd.read_sql(f'''
  File "/usr/local/lib/python3.10/site-packages/pandas/io/sql.py", line 590, in read_sql
     return pandas_sql.read_query(
   File "/usr/local/lib/python3.10/site-packages/pandas/io/sql.py", line 1560, in read_query
     result = self.execute(*args)
   File "/usr/local/lib/python3.10/site-packages/pandas/io/sql.py", line 1405, in execute
     return self.connectable.execution_options().execute(*args, **kwargs)
 AttributeError: 'OptionEngine' object has no attribute 'execute'

解決

https://github.com/pandas-dev/pandas/issues/40686

在這篇文章中看到,sqlalchemy的1.4和2.0兩種不同的語法,pandas暫時(shí)還不支持2.0,所以將sqlalchemy回退到1.4.45即可。文章來源地址http://www.zghlxwxcb.cn/news/detail-559778.html

到了這里,關(guān)于AttributeError: ‘OptionEngine‘ object has no attribute ‘execute‘的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • Python報(bào)錯(cuò):AttributeError: ‘ImageDraw‘ object has no attribute ‘textbbox‘

    報(bào)錯(cuò)原因是pillow的版本過低,導(dǎo)致不能使用 解決方法: 打開Anaconda prompt查看下載列表 刪除原有的pillow: ?從新下載pillow: 如果上面的命令報(bào)錯(cuò)下載不成功嘗試下面的代碼:(從清華鏡像下載pillow) 其他下載鏡像: 清華:https://pypi.tuna.tsinghua.edu.cn/simple 阿里云:http://mirror

    2024年02月06日
    瀏覽(30)
  • Python 中出現(xiàn)AttributeError: ‘Event‘ object has no attribute ‘key‘

    《python編程從入門到實(shí)踐》中在學(xué)習(xí)外星人入侵項(xiàng)目中運(yùn)行程序時(shí)出現(xiàn)報(bào)錯(cuò) AttributeError: \\\'Event\\\' object has no attribute \\\'key\\\' 錯(cuò)誤代碼如下: 運(yùn)行錯(cuò)誤提示 導(dǎo)致錯(cuò)誤的原因?yàn)椤?#按Q鍵退出游戲”這部分程序中“elif event.key == pygame.K_q:”這句語句寫在了與 事件類型 “event.type == pygame

    2024年02月11日
    瀏覽(32)
  • 【Python】成功解決AttributeError: ‘list‘ object has no attribute ‘replace‘

    【Python】成功解決AttributeError: ‘list‘ object has no attribute ‘replace‘

    【Python】成功解決AttributeError: ‘list’ object has no attribute ‘replace’ ?? 個(gè)人主頁:高斯小哥 ?? 高質(zhì)量專欄:Matplotlib之旅:零基礎(chǔ)精通數(shù)據(jù)可視化、Python基礎(chǔ)【高質(zhì)量合集】、PyTorch零基礎(chǔ)入門教程?? 希望得到您的訂閱和支持~ ?? 創(chuàng)作高質(zhì)量博文(平均質(zhì)量分92+),分享更多

    2024年03月25日
    瀏覽(25)
  • 【python|OpenCV】AttributeError: ‘NoneType‘ object has no attribute ‘shape‘

    當(dāng)使用OpenCV出現(xiàn)這個(gè)錯(cuò)誤時(shí),但是又沒有中文路徑或者路徑的錯(cuò)誤時(shí),可能是版本沒有對上,或者是其他的問題,我也用過很多博主的辦法,但是都沒辦法解決的時(shí)候,真的可以試一下 直接刪除,再重新下載。 目錄 情況描述 我的做法 感想 留言 本來我使用的是版本是4.7.0,

    2024年02月03日
    瀏覽(25)
  • 【Python】成功解決AttributeError: ‘list‘ object has no attribute ‘split‘

    【Python】成功解決AttributeError: ‘list‘ object has no attribute ‘split‘

    【Python】成功解決AttributeError: ‘list‘ object has no attribute ‘split‘ ?? 個(gè)人主頁:高斯小哥 ?? 高質(zhì)量專欄:Matplotlib之旅:零基礎(chǔ)精通數(shù)據(jù)可視化、Python基礎(chǔ)【高質(zhì)量合集】、PyTorch零基礎(chǔ)入門教程?? 希望得到您的訂閱和支持~ ?? 創(chuàng)作高質(zhì)量博文(平均質(zhì)量分92+),分享更多關(guān)

    2024年04月14日
    瀏覽(25)
  • Python 中 AttributeError: ‘NoneType‘ object has no attribute ‘X‘ 錯(cuò)誤

    Python 中 AttributeError: ‘NoneType‘ object has no attribute ‘X‘ 錯(cuò)誤

    Python “ AttributeError: ‘NoneType’ object has no attribute ” 發(fā)生在我們嘗試訪問 None 值的屬性時(shí),例如 來自不返回任何內(nèi)容的函數(shù)的賦值。 要解決該錯(cuò)誤,請?jiān)谠L問屬性之前更正分配。 這是一個(gè)非常簡單的示例,說明錯(cuò)誤是如何發(fā)生的。 嘗試訪問或設(shè)置 None 值的屬性會導(dǎo)致錯(cuò)誤

    2024年02月06日
    瀏覽(25)
  • 編寫Python 代碼出現(xiàn) AttributeError: ‘DataFrame‘ object has no attribute ‘ix‘ 報(bào)錯(cuò)

    編寫Python 代碼出現(xiàn) AttributeError: ‘DataFrame‘ object has no attribute ‘ix‘ 報(bào)錯(cuò)

    在編寫如下 python 代碼過程中出現(xiàn): AttributeError: ‘DataFrame’ object has no attribute ‘ix’ 錯(cuò)誤截圖: 中文意思: “DataFrame”對象沒有屬性“ix” 原因是,pandas 的 ‘ix’ 屬性已經(jīng)在最新版本中被棄用了。 pandas的新版本已經(jīng)對該函數(shù)進(jìn)行了升級和重構(gòu),可以使用( ‘loc’–可以

    2024年02月15日
    瀏覽(33)
  • AttributeError: ‘DataFrame‘ object has no attribute ‘iteritems‘解決方案【Bug已解決-Python】

    AttributeError: ‘DataFrame‘ object has no attribute ‘iteritems‘解決方案【Bug已解決-Python】

    本文主要介紹了AttributeError: ‘DataFrame‘ object has no attribute ‘iteritems‘解決方案,希望能對大家有所幫助。 今天在運(yùn)行項(xiàng)目時(shí),卻出現(xiàn)AttributeError: ‘DataFrame‘ object has no attribute ‘iteritems‘的錯(cuò)誤提示,具體報(bào)錯(cuò)信息如下所示: AttributeError: ‘DataFrame‘ object has no attribute ‘i

    2024年03月23日
    瀏覽(29)
  • Python產(chǎn)生關(guān)鍵詞云報(bào)錯(cuò):AttributeError: ‘ImageDraw‘ object has no attribute ‘textbbox‘

    Python產(chǎn)生關(guān)鍵詞云報(bào)錯(cuò):AttributeError: ‘ImageDraw‘ object has no attribute ‘textbbox‘

    利用jieba snownlp分別分詞,產(chǎn)生云。代碼報(bào)錯(cuò),檢查了以下代碼沒錯(cuò)。 最后在csdn找到了解決方法。 這原來是pillow的版本過低的原因。 辦法如下: 打開Anaconda prompt查看下載列表: pip? list ? 刪除現(xiàn)有的pillow: ?pip uninstall pillow ?下載新版本的pillow: pip install pillow 推薦用

    2024年02月12日
    瀏覽(20)
  • 【Python】成功解決AttributeError: ‘numpy.ndarray’ object has no attribute ‘value_counts’

    【Python】成功解決AttributeError: ‘numpy.ndarray’ object has no attribute ‘value_counts’

    【Python】成功解決AttributeError: ‘numpy.ndarray’ object has no attribute ‘value_counts’ ?? 個(gè)人主頁:高斯小哥 ?? 高質(zhì)量專欄:Matplotlib之旅:零基礎(chǔ)精通數(shù)據(jù)可視化、Python基礎(chǔ)【高質(zhì)量合集】、PyTorch零基礎(chǔ)入門教程?? 希望得到您的訂閱和支持~ ?? 創(chuàng)作高質(zhì)量博文(平均質(zhì)量分92+

    2024年04月11日
    瀏覽(100)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包