I am using Python3.8.0, my PC is x64 bit and my code starts as :
import pyHook
When I run the program,
it shows :
Traceback (most recent call last):
File "abc.py", line 1, in
import pyHook
ModuleNotFoundError: No module named 'pyHook'
I have already installed Pyhook and I have verified it in cmd by writing the following code
python -m pip install pyWinhook-1.6.1-cp38-cp38-win_amd64.whl
Output :
Requirement already satisfied
I visited these links, but it did not helped:
Getting "ModuleNotFoundError: No module named 'pyHook'" even with module installed
This link
PyHook on python 3.5
says that I should Install pyhook32 even if I have 64bit. I tried that and cmd does'nt allow system to install that.
Anyone have any other idea ? Please help me if I am doing anything wrong :-(
Write pip3 install pynput in cmd
Now in your python code, remove import pyHook and write import pynput
Both works same
Related
When I try to run a program that has import keyboard it gives me this error even though I installed it:
Traceback (most recent call last):
File "C:\Users\Diana\Desktop\test file.py", line 1, in
import keyboard
ModuleNotFoundError: No module named 'keyboard'
Does anyone know why?
It looks like you simply don't have the module named keyboard installed for the version of python that you're running the script with. Try running python -m pip install keyboard in a terminal outside of python to install the module, and try running the script again.
Assuming this is the module that's being referenced
You might have both Python 2 and Python 3 installed on your OS, which you can easily check by running this from your terminal:
pip --version
If the output ends with Python 2.X then you probably have two concurrent versions.
This implies that pip install keyboard would have installed the package for the respective Python version (2), i.e. you must explicitly point to pip3 implementation to get the package in the expected location:
pip3 install keyboard
Pls check if you installed the module 'keyboard', If done, make sure you call the function.
I am trying to run my code using Win+R.
I am able to run a python script without using third-party modules. But when I use some third-party module in my code it shows this error:
Traceback (most recent call last):
File "C:\Users\pkgar\Desktop\Newfolder\pw.py", line 6, in <module>
import sys,pyperclip
ModuleNotFoundError: No module named 'pyperclip'
Edit: I am able to run the code in VS code, but I am just curious how to run the code using Win+R command.It is running perfectly using Win+R command when I don't use pyperclip module at all.
you haven't installed pyperclip yet.
you can install it using pip install pyperclip on your cmd.
check this out
https://pypi.org/project/pyperclip/
and olso if pip itself hasn't installed yet use
https://pip.pypa.io/en/stable/installing/
these are the Error messages I am geeting on running any of my project modules.
Traceback (most recent call last):
File "C:\Users\hsnl\BlockchainCodesTutor\Wallet.py", line 3, in <module>
import Transactions
File "C:\Users\hsnl\BlockchainCodesTutor\Transactions.py", line 2, in <module>
import Signatures
File "C:\Users\hsnl\BlockchainCodesTutor\Signatures.py", line 2, in <module>
import cryptography
ModuleNotFoundError: No module named 'cryptography'
I have already installed the cryptography module and was working perfectly until today I start getting this message that " No module named 'cryptography'".
I have again installed the cryptography as well as pip package but still showing the same error.
There might be loose versions running on your system. Please try the following:
python -m pip uninstall cryptography
python -m pip install cryptography
You can also check out this with python -m to make sure you are not using a loose pip.
You might not have cryptogtaphy installed correctly. I see you are using windows. Open commandline as an administrator and run pip install cryptography again. Enshure that the installation finishes without any errors and consider to restart your python interpreter after installation.
For further help you should post more details like the output of pip and your code leading to the error, so a more detailed answer for your problem can be given.
Try download cryptography whl from here.
Then use pip install cryptography-XXX.whl
For example:
pip install cryptography-3.3.1-cp36-abi3-win_amd64.whl
And now just supports python2.7 and python3.6.
I'm using Windows 10, Python 3.6.4. I'm trying to use the module Pyperclip and have installed it with pip:
c:\Users\Bertie>pip install pyperclip
Requirement already satisfired: pyperclip in c:\python36\lib\site-packages (1.8.0)
But when I try to run a program which uses this module, I get this error:
c:\Users\Bertie\scraping.py test
Traceback (most recent call last):
File "C:\Users\Bertie\scraping.py", line 3, in <module>
import webbrowser, sys, pyperclip
ModuleNotFoundError: No module named 'pyperclip'
How can I fix this? Thank you.
The reinstall trace shows you install the packge successflly for python36.
Check if there is more than one python in your system. Type "python" in your windows cmd console, and check the python version to see if python36 is the default one. Then explicitly use the python interpreter to start the script "python your_python_script.py".
Where is the py file? Maybe try cd-ing into the folder and run python (python3) scraping.py?
Also check that you have installed the correct interpreter and are using the correct version of python.
Maybe You Installed pyperclip in conda env or a virtualenv and you forgot to activate it ?
Because This Has Happened To Me Many Times.
Or Maybe You Have 2 Instances Of Python installed on your computer and you accidentally installed pyperclip in the other instance of python ?
I have installed the openpyxl Python module in my machine, or at least I thought I've done that. I entered these commands on the command prompt (on Windows):
C:\Users\gluti>cd C:\Users\gluti\PycharmProjects\Data Structures\venv\Scripts
C:\Users\gluti\PycharmProjects\Data Structures\venv\Scripts>pip install openpyxl==2.1.4
And then, it shows a message, saying that the module openpyxl was successfully installed. However, when I try to import this module on Python IDLE, it shows the following error message:
import openpyxl
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import openpyxl
ModuleNotFoundError: No module named 'openpyxl'
Did I miss something or am I installing the module in the wrong directory?
It is possible you have installed python 2 and python 3 so there are two different versions of pip on your machine.
You need to ensure you are installing openpyxl in the same type of python that you are using to run the script.