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.
Related
I am using a windows system and I have no idea why after I use the command "pip3 install pyautogui" it installs successfully however when I click the play button in VS code it gives me an error in the terminal -
ERROR
import pyautogui
ModuleNotFoundError: No module named 'pyautogui'
I am a pure beginner to Python so I have no idea what might be causing this issue. My code is below:
CODE
import pyautogui
screenWidth, screenHeight = pyautogui.size()
print(screenWidth)
print(screenHeight)
Any idea what I can do to solve this? I have checked similar questions but the answers were targeted more towards Linux users.
sometimes pip can have problems with certain libraries.
to get around this, you should download the .whl or tar.gz file and install it directly from there.
this is the .tar.gz file for pyautogui: https://files.pythonhosted.org/packages/f0/76/7a0ec1013bc3559b7438f6773cba05ffaec600b8989be2d621a144e39b50/PyAutoGUI-0.9.53.tar.gz
download it and put it in your project directory.
then, just pip install {THE FILE NAME}.
for me that fixed it.
my code is having an issue in which when i run the program it gives the error message :
ImportError: No module named 'mouse'
this happens even though the module is installed???
Code below:
import mouse
print(mouse.get_position())
If you can't use the module globally, please try to install it and use the module using a virtual environment as an example you can use anaconda.
If you are using IDE like PyCharm make sure you download the package on the IDE.
In pycharm go to Setting->Python Interpretor->Click + ->search your package name (in this case mouse) -> install the package
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)
I have recently installed python 2.17.14 to use a package which I installed in the command prompt with:
python -m pip install packageName
However, whenever I try to use it with a script provided by the package authors, I get Import Errors:
ImportError: cannot import X from YX
ImportError: attempted relative import with no known parent package.
I don't know what I'm doing wrong, as I am really new to Python. Does anyone have any ideas?
The package is called neurodesign and I downloaded the try out script from the official website "neuropowertools.org"
Best,
Max
In case anyone (who is also new to python^^) fails ridiculously at this task as well: I had to manually install all the modules used within this package for it to work as they weren't installed automatically.
I am a relative newbie with Python and was trying to install wxPython 2.9 using Python 2.6. I did a build from source and then installed the package both being done in a non-standard (local) path. When I try and import wx (having provided the path to the installation folder in my environment variable), I get the following error message:
"ImportError:
libwx_gtk2u_xrc-2.9.so.1: cannot open
shared object file: No such file or
directory".
Can someone please tell me if I need to build gtk separately? And if yes, how do I go about doing it?
Add the directory containing the library given in the error to your ld search paths. See the ldconfig(8) man page for details.