Python ModuleNotFoundError: No module named 'win32event' - python-3.x

in my Python Script there is an ERROR with the line
import win32events
I still installed the package pypiwin32 (with pip install pypiwin32) but it seems that this is nor the right package.
Does someone know what I need to install to use win32events in Python?

You should install pywin32 package (not pypiwin32)!!!

Related

Getting an error message while trying to install pandas packages using pip3 in jupyter notebook

My code starts with installing these packages -
pip3 install ipython
pip3 install selenium
pip3 install time
pip3 install parsel
pip3 install csv
but I get -
File "<ipython-input-7-cae965d78112>", line 1
conda install ipython
^
SyntaxError: invalid syntax
I have tried replacing pip3 with pip and conda, it still gives the same error.Please help me to install these packages.
thanks!!!
pip3 and conda are utilities separate to the Python programming language. pip3 and conda make it easier for users to install python packages to their machine/virtual environment which is why you get SyntaxError: invalid syntax because what you've written is not valid Python.
If you want to use pip3 or conda these commands should be used at into a terminal. These tools search online for modules you want to install, download them and install them into the appropriate location (for your user or into your virtual enviroment). If you try to install something that can't be found online in the pypi you'll get an error.
You've tried to install the module csv using pip3 install csv. The csv module is part of Python's standard library so pip3 will not find this package on pypi. Being part of the standard library means that every installation of Python has this library. To use the csv module you can do import csv in your notebook/.py file. The same goes for the module time.

Python ModuleNotFindError even though module installed

I'm reading the book "Python Crash Course" and I'm following along with the project alien invasion. I installed Python and the package Pygame as the book shows it.
When I run my code I get a ModuleNotFoundError:
ModuleNotFoundError: No module named 'pygame'
[Finished in 0.0s with exit code 1]
[cmd: ['python3', '-u', '/Users/antonio_spatuzzi/Documents/python_work/alien_invasion/alien_invasion.py']]
[dir: /Users/antonio_spatuzzi/Documents/python_work/alien_invasion]
[path: /Library/Frameworks/Python.framework/Versions/3.9/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin]
even though the package has been successfully installed:
``Requirement already satisfied: pygame in ./.local/lib/python3.8/site-packages (2.0.1)```
How can I solve this problem?
It seems that you installed the module for python 3.8 and you try to run it with python 3.9. Try installing the package with
python -m pip install
We can see from the output you posted that python3 is being used to run your programs:
[cmd: ['python3', '-u', '/Users/antonio_spatuzzi/Documents/python_work/alien_invasion/alien_invasion.py']]
So as was mentioned in an earlier comment, running python3 -m pip install pygame should install Pygame to the version of Python that you're currently using.
For beginners it's not a good practice to have two different versions of python installed. If you are on windows try to uninstall all versions of python. (maybe this helps: How to completely remove Python from a Windows machine?)
Then try installing the newest version of python and pygame.
In general, it's good practice to make a virtual environment with different instances of python and the respective packages used for a special project.
Maybe have a look into Anaconda

Problems importing the oct2py python package

I have installed the oct2py package using the pip command pip install oct2py, set the environement path of python, pip and octave as in the following picture:
However, whenever I try to import it in my python script, I get the following error:
I checked whether the package is installed, it says: Requirement satisfied.
Any ideas of what I could possibly be doing wrong?

ModuleNotFoundError: No module named 'cv2.ximgproc

When I am running the command from cv2.ximgproc import guidedFilter, I am getting an error: ModuleNotFoundError: No module named 'cv2.ximgproc'
I searched the Internet for possible reasons, and I found out that I should run a command pip install opencv--contrib-python on the terminal, which I did. Even after doing that, I am getting the same error.
Please note that I am not very good at programming and technical stuff, so please explain in simple terms. I have a mac, and I am using Anaconda for writing my codes.
You need to uninstall the regular opencv package first.
First uninstall both regular opencv as well as contrib package:
pip uninstall opencv-python
pip uninstall opencv-contrib-python
Then install the contrib package:
pip install opencv-contrib-python
You can refer to this post for more information:
Module 'cv2.cv2' has no attribute 'ximgproc'
I have written a python script as follows:
from cv2.ximgproc import guidedFilter
print("hello")
Initially it was giving me the same error : 'ModuleNotFoundError: No module named 'cv2.ximgproc'. But then i ran the command "pip install opencv--contrib-python" and after that it prints "hello" i.e it is detecting the ximgproc module.
please check the below screenshot.
Check once the installation of opencv--contrib module. There is some problem at that stage.

Having trouble importing nltk into Python3

When I run the command:
pip3 install nltk
My terminal outputs:
Requirement already satisfied: nltk in ./Library/Python/2.7/lib/python/site-packages (3.4.5)
But when I load up python3, I get:
ModuleNotFoundError: No module named 'nltk'
This is driving me crazy, and I'm sure I'm missing something very basic, I just don't understand what!
Figured this out last week, but it requires moving the nltk package from the Python 2.7 library to the Python 3 library. If that's too difficult, another option is to delete the package in whatever location shows up and reinstall with
pip3 install nltk

Resources