1
我剛剛升級到3.4.3的Python和而寫一段代碼,我已經收到此錯誤:的Python 3.4+ PendingDeprecationWarning
PendingDeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
這似乎是一個Python版本相關的問題。 謝謝!
編輯:這是整個錯誤是什麼樣子
/usr/lib/python3.4/imp.py:32: PendingDeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
PendingDeprecationWarning)
Traceback (most recent call last):
File "twitter_reddit_bot_2.py", line 139, in <module>
main()
File "twitter_reddit_bot_2.py", line 100, in main
tweeter(post_titles, post_links, post_ids)
File "twitter_reddit_bot_2.py", line 124, in tweeter
api.update_status(tweet_content)
File "/usr/local/lib/python3.4/dist-packages/tweepy/api.py", line 194, in update_status
)(post_data=post_data, *args, **kwargs)
File "/usr/local/lib/python3.4/dist-packages/tweepy/binder.py", line 245, in _call
return method.execute()
File "/usr/local/lib/python3.4/dist-packages/tweepy/binder.py", line 229, in execute
raise TweepError(error_msg, resp, api_code=api_error_code)
tweepy.error.TweepError: [{'message': 'Status is a duplicate.', 'code': 187}]
sys:1: ResourceWarning: unclosed <ssl.SSLSocket fd=5, family=AddressFamily.AF_INET, type=2049, proto=6, laddr=('192.168.1.10', 50066), raddr=('104.244.42.2', 443)>
/usr/lib/python3.4/importlib/_bootstrap.py:2150: ImportWarning: sys.meta_path is empty
以及'imp'模塊已被棄用,以支持'importlib';或者用'importlib'的相應函數替換'imp'的所有用法,或者稍後當它最終被刪除時被強制執行它 –
對不起,我不明白你的意思是'使用它改變模塊現在'。 –
我更新了我的評論以更好地解釋我自己。什麼是你正在執行的是拋出這個警告? –