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)
Related
after PySerial library is installed: enter image description here
I try to Run a simple program, and it says that No module named 'serial' is found.
enter image description here
Thanks in advance.
This may be happening because the location where this package is getting installed is not included in the PATH.
You can try:
Hover on the package name and click on install package pyserial.
OR
Go to settings->Project XYZ->Python Interpreter-> Click on + sign->search and install package from there.
OR
Include the location of installed package in the PATH variable.
I don't know about virtual environments and what they do, but all I wanted was to start learning this tutorial on python: https://www.youtube.com/watch?v=Xjv1sY630Uc&list=PLzMcBGfZo4-n40rB1XaJ0ak1bemvlqumQ
I did everything possible:
pip install selenium
pip3 install selenium
installed and uninstalled it
Added it in my environmental variables in the path. Like this:
Now what am I supposed to do? In Visual Studio Code I'm still getting this error no matter what I do and how many times I install, uninstall and add it to my environmental variables:
You can try importing the path to the file at the beginning of the file.
for example
import sys
sys.path.append(r'c:\workspace\pythontest\.venv\lib\site-packages')
Hope it helps you.
Hi i'm recently working on a module in python (package named pykiwoom)
I installed a module in conda 32-bit environment pip install pykiwoom and tried to import this
from pykiwoom.kiwoom import Kiwoom
This works perfectly fine when I execute this in python console in pycharm
However, when I try this in terminal error occurs
ModuleNotFoundError: No module named 'pykiwoom.kiwoom'; 'pykiwoom' is not a package
internal structure of package pykiwoom looks like this
pykiwoom
init.py
kiwoom.py
parser.py
Can somebody tell me why this error occurs?
I think where you install your package is important in your case. You can check the packages installed using pip list in terminal, and check if you find it there.
This solution provides overview of how to setup your files as packages and modules.
Nevertheless, I think if you install your package in the terminal using pip, you could possibly access it.
I am a bit lost. I've just recently started working with python and have been able to use other libraries, that I've imported without any issues.
Install via pip command
Restart Visual Studio Community 2019
I can use the library
Now I wanted to import the docx2pdf library. But using the same 3 steps is not working and I don't know what to do.
from docx2pdf import convert <-- gets the error "unresolved import"
Also:
after installing it via pip I get the following message in addition to the installation being a success:
WARNING: The script docx2pdf.exe is installed in 'C:\Users\user\AppData\Roaming\Python\Python37\Scripts' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
I didn't get this message from other libraries.
I am using windows 10.
Thanks for the help!
In VS Code, when we use the global python environment to install the module, we can use the command "pip show docx2pdf" to check its storage location is: "\users\username\appdata\local\programs\python\python38\lib\ site-packages"
It is recommended that you reinstall the module "docx2pdf" or try to delete the previously installed "docx2pdf" folder and reinstall it.
Run:
I'm trying to write a script in python that will modify files and folders in a sharepoint site. Based off what I've read online about working with sharepoint using python, I tried to install and import the "sharepoint" and "sharepy" modules.
I used "pip install sharepoint" and "pip install sharepy" in the command prompt to install the packages, and then in my script used these lines to import the packages:
import sharepoint
import sharepy
Multiple IDE's don't recognize the packages (in Visual Studio, the error says "No module named 'sharepoint'") and I can't use their libraries to complete my code. The modules in question are present in the same subfolder as other modules that do successfully import, so I'm not really understanding the problem here. What could be causing these libraries to not import?
in visual studio code change python path to where you installed python
You don't need a module named "sharepoint"
Instead of that, you have to install : office365-rest-python-client
(with pip)