Can't install and use pyautogui - pyautogui

When I import pyautogui, I get the following error:
ModuleNotFoundError
No module named 'pyautogui'
File "C:\Users\장현우\Desktop\연수 자동화\worker.py", line 3, in <module>
import pyautogui*
So I pip again from cmd.
python -m pip install pyautogui
Then this error occurred.
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: pyautogui in c:\users\장현우\appdata\roaming\python\python38\site-packages (0.9.53)
Requirement already satisfied: pymsgbox in c:\users\장현우\appdata\roaming\python\python38\site-packages (from pyautogui) (1.0.9)
Requirement already satisfied: PyTweening>=1.0.1 in c:\users\장현우\appdata\roaming\python\python38\site-packages (from pyautogui) (1.0.4)
Requirement already satisfied: pyscreeze>=0.1.21 in c:\users\장현우\appdata\roaming\python\python38\site-packages (from pyautogui) (0.1.28)
Requirement already satisfied: pygetwindow>=0.0.5 in c:\users\장현우\appdata\roaming\python\python38\site-packages (from pyautogui) (0.0.9)
Requirement already satisfied: mouseinfo in c:\users\장현우\appdata\roaming\python\python38\site-packages (from pyautogui) (0.1.3)
Requirement already satisfied: pyrect in c:\users\장현우\appdata\roaming\python\python38\site-packages (from pygetwindow>=0.0.5->pyautogui) (0.2.0)
Requirement already satisfied: Pillow>=6.2.1 in c:\users\장현우\appdata\roaming\python\python38\site-packages (from pyscreeze>=0.1.21->pyautogui) (9.1.1)
Requirement already satisfied: pyperclip in c:\users\장현우\appdata\roaming\python\python38\site-packages (from mouseinfo->pyautogui) (1.8.2)
I Nothing can be done. Help!
Below is the code I used.
from selenium import webdriver
import time
import pyautogui

Related

Versions/3.11/Resources/Python.app/Contents/MacOS/Python: can't open file '/Users/ayoubnaoui/install': [Errno 2] No such file or directory [duplicate]

This question already has answers here:
Unable to install Pygame using pip
(27 answers)
pygame installation issue in mac os
(5 answers)
Closed last month.
I have being using pygame module for some time, but after downloading some packages like homebrew and octave visual studio no longer recognizes pygame even though it has already been installed
below is the error -
/opt/homebrew/bin/pytho
n3.11 /Users/ayoubnaoui/Desktop/game5/main.py
Traceback (most recent call last):
File "/Users/ayoubnaoui/Desktop/game5/main.py", line 1, in
import pygame
ModuleNotFoundError: No module named 'pygame'
For the pygame module to be recognized and for the game to run

im having trouble installing python [duplicate]

This question already has answers here:
pygame installation issue in mac os
(5 answers)
Pygame already installed; however, python terminal says "No module named 'pygame' " (Ubuntu 20.04.1)
(1 answer)
Closed 2 years ago.
when i try to download pygame with python version 3.8.5 this message shows up "terminal Requirement already satisfied: pygame in ./Library/Python/2.7/lib/python/site-packages (1.9.6)"

Pygame is not running with vscode in Ubuntu 18.04 [duplicate]

I'm using Ubuntu 20.04.1 LTS. I have installed pygame with sudo apt-get install python-pygame. However, when I run my code using VS code, the python terminal gives the output below:
Traceback (most recent call last):
File "path", line 1, in <module>
import pygame
ModuleNotFoundError: No module named 'pygame'
I tried to reinstall Pygame using the same command. Here is the output:
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-pygame is already the newest version (1.9.6+dfsg-2build1).
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
Basically, I already have pygame installed. So what do you think might be the reason? My Python version is 3.8.2.
Thanks in advance!
There isn't a release build of pygame 1.9.6 for Python 3.8.2. Install a development version:
python3 -m pip install pygame==2.0.0.dev10

Access to a MySQL database via Jupyter Notebook w/ Python3

I needed access a MySQL database via Jupyter Notebook, on which I run Python 3.6 (Anaconda install). It's a linear workflow, extracting data from the DB and manipulating it in Python/Pandas. No need for an ORM, a simple connector should do. However, the widely referenced MySQLdb package doesn't work with Python 3.x.
What are the alternatives?
The recommended installation modality for Jupyter on Ubuntu is Anaconda, so the appropriate package manager is conda. Installation via pip/pip3 or apt won't be accessible to the Notebook. conda makes it simple to get at least two good connectors:
pymysql works well and is easy to install:
sudo conda install pymysql
The 'official' connector:
sudo conda install mysql-connector-python
I tried pymysql first and it was fine but then switched to the second option due to the availability of extensive documentation.
If your objective is to import the data into a Pandas dataframe then use of the built-in pd.sql_read_table or pd.sql_read_query is convenient, as it labels the columns etc. It still requires installation of a connector, as discussed above.
An example with MySQL-connector-python, where you need to enter the database DETAILS:
import pandas as pd
import sqlalchemy
engine = sqlalchemy.create_engine('mysql+mysqlconnector://USER:PASSWORD#HOST/DB_NAME')
example_df = pd.read_sql_table("YOUR_TABLE_NAME", engine)

Installation of pyautogui Module fails (I am using python 3.5 32 bit)

Please help. I type pip install pyautogui at the command prompt.
The process begins then stalls. Here is what happens:
C:\Users\alexS\AppData\Local\Programs\Python\Python35-32\Scripts>pip 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 "<string>", line 1, in <module>
File "C:\Users\alexS\AppData\Local\Temp\pip-build-1kn1qve4\pyscreeze\se
tup.py", line 6, in <module>
version=__import__('pyscreeze').__version__,
File "C:\Users\alexS\AppData\Local\Temp\pip-build-1kn1qve4\pyscreeze\py
screeze\__init__.py", line 21, in <module>
from PIL import Image
ImportError: No module named 'PIL'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\alexS
\AppData\Local\Temp\pip-build-1kn1qve4\pyscreeze\
C:\Users\alexS\AppData\Local\Programs\Python\Python35-32\Scripts>
Install the Image module first by doing:
$ pip install Image
Then retry installing pyautogui again
This answer is based on experience.
This has been fixed as of 0.9.34, so you should be able to just install it now. Just run pip install -U pyautogui