日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

vscode中PyLint报错Unable to import解决方案

發(fā)布時間:2024/9/21 编程问答 27 豆豆
生活随笔 收集整理的這篇文章主要介紹了 vscode中PyLint报错Unable to import解决方案 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

在導(dǎo)入其它文件夾中py文件的時候,即使在代碼中添加了指定路徑,由于Pylint 無法檢測到該文件,會給出Unable to import 'xxx'的錯誤提示

需要在項目目錄下添加.pylintrc文件指定要引用文件所在的目錄

# .pylintrc 文件用于為pllint進(jìn)行自定義配置[MASTER] # XXX 應(yīng)被替換為你指定的文件夾如(./custom_lib) init-hook='base_dir="XXX"; import sys,os,re; _re=re.search(r".+\/" + base_dir, os.getcwd()); project_dir = _re.group() if _re else os.path.join(os.getcwd(), base_dir); sys.path.append(project_dir)'[MESSAGES CONTROL] # Find available symbolic names in: # https://docs.pylint.org/features.html disable=locally-disabled,trailing-whitespace,fixme,missing-docstring,protected-access,invalid-name,super-init-not-called,star-args,no-self-argument,inherit-non-class,no-method-argument,no-self-use,unused-argument,too-many-return-statements,too-many-branches,too-many-function-args,too-many-instance-attributes,too-many-locals,bad-continuation,unnecessary-lambda,redefined-variable-type,global-statement,line-too-long,mixed-indentation,bad-whitespace,missing-final-newline

?

轉(zhuǎn)載于:https://www.cnblogs.com/wangyunjie/p/8855943.html

總結(jié)

以上是生活随笔為你收集整理的vscode中PyLint报错Unable to import解决方案的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。