I have been installing PyautoGui on my WIN10 PC. But I am getting the following error, i have been getting a lot of errors jut to get this far.
i have been reinstalling python so its destination folder is in C:\Python instead of C:\Users\Home\AppData\Local\Programs\Python\Python35-32 mabye thats why ? How do i fix this ?
C:\Python\Scripts>pip.exe install pyautogui Collecting pyautogui
Using cached PyAutoGUI-0.9.33.zip Collecting pymsgbox (from pyautogui)
Using cached PyMsgBox-1.0.3.zip Collecting PyTweening>=1.0.1 (from
pyautogui) Using cached PyTweening-1.0.3.zip Collecting Pillow (from
pyautogui) Using cached Pillow-3.3.1-cp35-cp35m-win32.whl Collecting
pyscreeze (from pyautogui) Using cached PyScreeze-0.1.8.zip
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\Home\AppData\Local\Temp\pip-build-kxm3249e\pyscreeze\setup.py",
line 6, in
version=import('pyscreeze').version,
File "c:\users\home\appdata\local\temp\pip-build-kxm3249e\pyscreeze\pyscreeze__init__.py",
line 21, in
from PIL import Image
ImportError: No module named 'PIL'
Command "python setup.py egg_info" failed with error code 1 in
C:\Users\Home\AppData\Local\Temp\pip-build-kxm3249e\pyscreeze\
I encountered the same error message as you did. This workaround worked for me. Try these steps in order...
Install PyScreeze 0.1.7.
Update PyScreeze to 0.1.8.
Install PyAutoGui.
I hope this helps.
I also encountered the same error (albeit on Ubuntu 14.04). The missing module PIL is named Pillow (As said in this answer). So what I tried was (same in MacOS I think):
sudo pip3 install pillow
That translated to Windows would be:
pip.exe install pillow
Hope this helps you further.
Instead of letting PyautoGUI get all the packages for you.
Install all of them individually. Then, run the pip install --upgrade _packageName_
Then run pip install pyautogui.
Hope this helps.
I'm happy to report that this installation error has been fixed as of version 0.9.34. All you have to do is install or update PyAutoGUI from PyPI.
try
pip uninstall pyautogui
then
pip install pyautogui
There is a possibility that on windows it is not rightly configured on windows path and therefore it cant find the module, to fix this try:
Control Panel \ System and Security \ System
then click: Environment Variables, and double click on path and append the directory you want to use.
full explanation on: https://helpdeskgeek.com/windows-10/add-windows-path-environment-variable/
you can also try:
Cmd:
python -m pip install < module >
git clone https://github.com/USERNAME/REPOSITORY
or
To append to PYTHONPATH:
IDE:
import sys
sys.path.append('< path >')
Related
My pyautogui program gives me the following error when I do:
position = pyautogui.locateCenterOnScreen(image, confidence=.7)
Error message:
File "C:\Users\ashis\AppData\Local\Programs\Python\Python39\lib\site-packages\pyscreeze\__init__.py", line 144, in wrapper
raise PyScreezeException('The Pillow package is required to use this function.')
pyscreeze.PyScreezeException: The Pillow package is required to use this function.
Other pyautogui functions are working properly only when I do pyautogui.locateCenterOnScreen() gives and error.
I already have pillow properly installed:
Requirement already satisfied: pillow in c:\users\ashis\appdata\local\programs\python\python310\lib\site-packages (9.0.0)
Can anyone help please? I am following a tutorial.
That's a small problem, just update your Pillow package.
pip install Pillow --upgrade
Pillow-4.2.1 was on my system, it upgraded to Pillow-5.1.0 and now everything works just fine.
pip install pyautogui --upgrade
Here, is what worked for me
pip install pyscreeze
then,
import pyscreeze
position = pyscreeze.locateCenterOnScreen(image, confidence=.7)
Thanks,
This issue has been bugging me for a while. So, I am using Python 3.9.10 on my Windows 10 computer. To install mysql.connector, I used this command in the command prompt:
pip install mysql-connector-python
And, it returns this:
Requirement already satisfied: mysql-connector-python in c:\users\aksha\appdata\local\packages\pythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0\localcache\local-packages\python39\site-packages (8.0.24)
Requirement already satisfied: protobuf>=3.0.0 in c:\users\aksha\appdata\local\packages\pythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0\localcache\local-packages\python39\site-packages (from mysql-connector-python) (3.15.6)
Requirement already satisfied: six>=1.9 in c:\users\aksha\appdata\local\packages\pythonsoftwarefoundation.python.3.9_qbz5n2kfra8p0\localcache\local-packages\python39\site-packages (from protobuf>=3.0.0->mysql-connector-python) (1.15.0)
Next, I went to the python shell and entered this code:
import mysql.connector
And, got this error:
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import mysql.connector
ModuleNotFoundError: No module named 'mysql'
I then went back to the command prompt and entered this command:
pip3 install mysql-connector
This is what I get:
Using cached mysql-connector-2.2.9.tar.gz (11.9 MB)
Preparing metadata (setup.py) ... done
Using legacy 'setup.py install' for mysql-connector, since package 'wheel' is not installed.
Installing collected packages: mysql-connector
Running setup.py install for mysql-connector ... done
Successfully installed mysql-connector-2.2.9
I go back to the python shell and enter the the same code, and it gives back the same error.
I have no idea what I am doing wrong and why this error keeps coming. I have already gone through posts like "ImportError: No module named 'MySQL'", but I am still facing the same issue. I have also checked if I have any python scripts named mysql.py since I have heard they can cause some problems, but there aren't any.
Any help is greatly appreciated!
Edit 1:
Just did pip freeze in the command prompt. This is the result:
mysql-connector==2.2.9
mysql-connector-python==8.0.24
protobuf==3.15.6
six==1.15.0
Not sure what to do now.
This worked for me:
First run this command in the IDLE shell.
import sys; sys.executable
From this you'll get a python path like: C:\\Users\\prat\\AppData\\Local\\Programs\\Python\\Python39\\pythonw.exe
Then use this path with the pip install like:
entire_path -m pip install package-name
$ python -m pip install pyaudio
Requirement already satisfied: pyaudio in c:\users\user\appdata\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages (0.2.11)
$ py sound.py
Traceback (most recent call last):
File "sound.py", line 1, in <module>
import pyaudio
ModuleNotFoundError: No module named 'pyaudio'
pyaudio was installed via a .whl file. This is on Windows 10, python version 3.8.5
this mostly happens if you have installed two python versions.
here you are using "python". $ python -m pip install pyaudio
and to execute you are using "py". $ py sound.py
run it using python sound.py
Visit this link https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio and download the corresponding wheel to your python version, then type "pip install {the wheel you installed}", if this doesn't work then make sure you moved the wheel from Downloads to your terminal path
I could resolved PyAudio error after a long search
Hope this can help someone doing speech text recognition and trying to install PyAudio :
First you find the python version using : python --version (check both Pycharm and JupyterLab as I had 3.7.6 and 3.10.4 different version and move to correct directory - I pasted the same version whl file in same directory "may be there is another way of doing it - suggestions welcome" )
Once this file is placed in the same directory - "PyAudio-0.2.11-cp37-cp37m-win_amd64.whl" you can use pip install PyAudio-0.2.11-cp37-cp37m-win_amd64.whl directly
Other findings :
In case the version and file not matching you will get this error
ERROR: PyAudio-0.2.11-cp310-cp310-win32.whl is not a supported wheel
on this platform.
simple pip install pyaudio will not work (As read on internet its not working beyond 3.6)
Go to 'file' tab> then 'settings' option> then in the search bar look for 'Python Interpreter', Open that.
There u will have an option of adding a package, one somewhat like this '+' sign. Click over it and then many packages will show up. There either type or search for 'PyAudio' and then click the 'Install Package' button.
You are done then.
Good to go!!
To solve it:
open "Command Prompt" and type cls.
click on this Link (https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio)
install a package based on your version of python and choose either 32 or 64 bit.
after the download type cd download in "Command Prompt"
press "Enter"
then type pip install py
finally click on "tab", then "Enter".
Your pyaudio is installed!
I tried to install ifxpy package in windows machine but getting error
Collecting IfxPy
Could not find a version that satisfies the requirement IfxPy (from versions: )
No matching distribution found for IfxPy
I tried the following commands:
$ pip3 install IfxPy
$ pip3 install ifxPy
$ pip3 install IfxPy==3.0.3
I have downloaded wheel file and tried this command:
$ pip install IfxPy-3.0.3-cp37-cp37m-win_amd64.whl
error :- ERROR: IfxPy-3.0.3-cp37-cp37m-win_amd64.whl is not a supported wheel on this platform.
Please find the error which i got after import
import IfxPyDbi
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\AmanAgrawal\AppData\Local\Programs\Python\Python37\lib\site-packages\IfxPyDbi.py", line 85, in
import IfxPy
ImportError: DLL load failed: The specified module could not be found.
Thanks in advance!!
Can you please try a manual install of IfxPy-3.0.1-cp36-cp36m-win_amd64.whl
It can be downloaded from IfxPy version 3.0.1 for windows x64
We will help you fix the real problem; meanwhile for you to proceed with the operation you are trying, as a workaround please download the IfxPy.zip from
https://github.com/OpenInformix/IfxPy/blob/master/prebuilt/3x/Win64/IfxPy.zip
and unzip it the same directory as your sample application you are trying. This should allow the sample application to work. Then to pinpoint the problem we would like to have bit more information, can you please provide output of the following from the same command window that you got error.
python -V
pip –V
pip3 –V
set PATH
Also the full error log also will help.
This morning I set out to install the TextBlob module found at https://textblob.readthedocs.org/en/latest/index.html
Per the installation documentation I first ran:
pip install -U textblob
Now if I run that command I get the following:
Requirement already up-to-date: textblob in /Library/Python/2.7/site-packages/textblob-0.5.0-py2.7.egg
Requirement already up-to-date: PyYAML in /Library/Python/2.7/site-packages (from textblob)
Cleaning up...
While it would appear to be installed, when I try to run a one line file (wherein the only line is from text.blob import TextBlob I am told ImportError: No module named blob
So then I tried to install from git, first I cloned the repository and then I ran both of the following snippets
sudo python setup.py install
and
sudo python2.7 setup.py install
Unfortunately neither one of those commands solved my issue. So now im stuck. I suppose the best course of action is to start over but im pretty much lost.
As Blender pointed out in his comments above, my problem was with a text.py file in the same directory that I was trying to run TextBlob. The deletion of this file led to the fixture of my issue.
Thank you Blender.
For anyone else, who may have this issue, I had another virtual environment open in my VS Code terminal (conda) that was not the same virtual environment I installed the textblob package in. Switched over and all was good.