简体   繁体   中英

Pylint error in Visual Studio Code Python

I'm getting this Unable to import 'dataImport' pylint(import-error).

How do I resolve this?

Attached is my codes:

import saveFile
import dataImport

dataImport.read_csv('income.csv')
saveFile.educationGraph()
saveFile.ageGraph()
saveFile.YrsInCompanyGraph()
saveFile.yrsCurrRoleGraph()
saveFile.workYrsGraph()

enter image description here

When I installed the module " dataImport " using pip in VSCode,( pip install dataImport ) I still couldn't use it, so I found it in the package installation directory and found that it was installed by default with the name " dataimport ", so VSCode could not find the package " dataImport ".

在此处输入图像描述

solve:

We can rename the package name to " dataImport ", or use " import dataimport ":

在此处输入图像描述

In addition, please confirm that the module " dataimport " is successfully installed in the currently selected VSCode environment. ( pip list )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM