0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Module 'cv2' has no '****' memberとpylintちゃんに叱られる!

Last updated at Posted at 2024-10-15

AIちゃんとのお話

俺「AIちゃん、なんかVSCodeで警告が出てるんだけど」
image.png
AI「パッケージインストールしてないだけなんじゃねーの?」
俺「いや流石に頭の悪い僕でもそれはないと思うんだけど」
AI「一人称が安定しない奴は信用できないvenvに入れ」
俺「あるっぽいよpylintちゃんだけが情緒不安定で激おこぷんぷん丸だけっぽい、ぽい、ぽい」
AI「そしたらこんな感じで書けばいいんじゃね?」

asset = cv2.imread(asset_path)  # noqa

俺「いやーこんな感じでめっちゃ怒られてるんだよ、一々そんなの書くのめんどくさくない?」
image.png

.pylintrcファイルを作って遊ぼ

AI「venvに入っているな」
俺「はいっちょる」
AI「じゃあこのコマンドをコピペして実行しろ」

pylint --generate-rcfile | out-file -encoding utf8 .pylintrc

俺「実行したら何もしてないのに".pylintrc"とかいう変なファイルができたんだけど」
AI「開け」
俺「ゴマ」
AI「extension-pkg-whitelistで検索かけろ」
俺「丘の下」

# A comma-separated list of package or module names from where C extensions may
# be loaded. Extensions are loading into the active Python interpreter and may
# run arbitrary code.
extension-pkg-whitelist=

俺「トイック100点満点の俺には理解不能だよ( ;∀;)、翻訳さんに頼んでみたけど意味不明だよ」
AI「...」
AI「それをこうしろ」

# A comma-separated list of package or module names from where C extensions may
# be loaded. Extensions are loading into the active Python interpreter and may
# run arbitrary code.
- extension-pkg-whitelist=
+ extension-pkg-whitelist=cv2

俺「したよー」
AI「んじゃ、generated-membersで検索かけろ」

# List of members which are set dynamically and missed by pylint inference
# system, and so shouldn't trigger E1101 when accessed. Python regular
# expressions are accepted.
generated-members=

俺「したよー」
AI「それをこうしろ」

# List of members which are set dynamically and missed by pylint inference
# system, and so shouldn't trigger E1101 when accessed. Python regular
# expressions are accepted.
- generated-members=
+ generated-members=cv2.*

俺「したよー」
AI「保存しろ。そしてCtrl+Pを押して次のコマンドをコピペして実行しろ」

>Pylint:Restart Server

俺「したよー」
AI「どないや?」
image.png
俺「すごいよAIちゃん!なんかできてるっぽい!」
AI「にしてもお前のコードには問題が多いな」
山田奈緒子「反省!」
AI「お前は誰だよ」

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?