Pyinput is showing warning in code but showing error while running the code - python-3.x

Traceback (most recent call last):
File "C:\Users\encur\Python\os.py", line 5, in
from pynput.keyboard import Key, Controller
ModuleNotFoundError: No module named 'pynput'

The error states that you do not have pynput package installed.
To install pyinput, use the following command on your terminal/shell:
pip install pynput
Or refer to the pypi package page: https://pypi.org/project/pynput/

Related

ModuleNotFoundError: No module named 'gpxpy'

I'm running a Jupyter notebook with the lines:
import gpxpy
import gpxpy.gpx
and I'm getting:
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
/var/folders/kc/5p61t70n0llbn05934gj4r_w0000gn/T/ipykernel_37440/3640958118.py in <module>
----> 1 import gpxpy
2 import gpxpy.gpx
ModuleNotFoundError: No module named 'gpxpy'
FWIW, doing the following on the terminal command line (macOS 16.6.4)
$ pip3 search gpxpy
ERROR: XMLRPC request failed [code: -32500]
RuntimeError: PyPI's XMLRPC API is currently disabled due to unmanageable load and will be deprecated in the near future. See https://status.python.org/ for more information.
$
Don't know whether it's a conda environment problem or a problem with the gpxpy package itself.
I logged into anaconda.org, searched for module gpxpy and then did one of the recommended installs:
conda install -c conda-forge gpxpy
At least I got around the module load error.

Why NO ModuleNotFoundError with conda?

Normally when I've done pip uninstall <module> if I then try to import the module I get a ModuleNotFoundError, for example:
dino#DINO:~$ python -c 'import mplfinance as mpf;print(mpf.__file__)'
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'mplfinance'
However, after activating a conda environment, the import works fine even when the package is unstalled both with pip uninstall and with conda remove, either way, I get:
dino#DINO:~$ python -c 'import mplfinance as mpf;print(mpf.__file__)'
None
Can anyone tell me why the import is NOT raising an exception, even though there is no module there to import??
This behavior (lack of import exception) appears to be related somehow to having activated a conda environment.

64bit MacOs After succesfully installing Pygame: ModuleNotFoundError: No module named 'pygame'

Python noob here. I've been trying to install pygame and pandas for a few hours now. Even with Conda I did not succeed. I have Python 3.8.5 installed.
I eventually tried through the terminal with these commands:
python -m pip install pygame==2.0.0.dev6
and
python -m pip install pandas
(this was a total guess by the way, but apparently it did something)
Results were succesfull:
Requirement already satisfied: pygame==2.0.0.dev6 in /opt/miniconda3/lib/python3.8/site-packages (2.0.0.dev6)
and
Successfully installed numpy-1.19.2 pandas-1.1.2 python-dateutil-2.8.1 pytz-2020.1
But, when I try to import either modules, I still get errors. Any ideas?
import pygame
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
import pygame
ModuleNotFoundError: No module named 'pygame'
import pandas
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
import pandas
ModuleNotFoundError: No module named 'pandas'
Do I need to move the modules to the script folder or something? Or what do I even move? Thanks!
Ok.. Got it thanks to #matt.. after succesfully installing pygame, find the environment in which pygame is installed by entering 'which python'.
In my case it returned:
/opt/miniconda3/bin/python
Now I needed to make sure the VS console was pointing at the same environment, by checking which python interpreter it was using and selecting the correct one. More info:
how to check and change environment in VS Code

How to deal with "ModuleNotFoundError: No module named 'setup' "

I installed the module "pyunicorn" in Ubuntu 16.04 LTS and all the dependencies but when I import the module in python 3.7.3 i get this error :
>>> import pyunicorn
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/user/anaconda3/lib/python3.7/site-packages/pyunicorn/__init__.py", line 43, in <module>
from setup import __version__
ModuleNotFoundError: No module named 'setup'
What should i do to make it run properly???
I had this problem. I wanted to install it on Google Colab. I tried installing pyunicorn directly from Github and it worked for me. Try using following instruction:
pip install git+https://github.com/pik-copan/pyunicorn.git#egg=pyunicorn

installed tesserocr(python) can't see leptonica

I have installed leptonica and tesseract in $HOME/local and tesseract is working properly, then tesserocr python package with:
CPPFLAGS="-I/home/user/local/include /home/user/local/lib" pip install tesserocr
and when I want to invoke it I get this:
$ python3 extract.py
Traceback (most recent call last):
File "extract.py", line 4, in <module>
from tesserocr import PyTessBaseAPI, RIL, PyLTRResultIterator, iterate_level
ImportError: liblept.so.5: cannot open shared object file: No such file or directory
please help
As mentioned in my comment on the original post, the proper installation command should be:
CPPFLAGS="-I/home/user/local/include -L/home/user/local/lib" pip install tesserocr

Resources