PyAutoGUI Python 3.5 Shell - pyautogui

I installed Pyautogui correctly and a I can import it from Python 3.5 but not from a script in IDLE Python 3.5.2
On the Shell the module pyautogui could not be found

I can't answer why an error is coming, but I may be able to solve your issue
Run this code on your Shell:
from subprocess import *
from sys import *
call([executable, "-m", "pip", "install", "pyautogui"])
Hope it helps :|

Related

Unable to import BERT model with all packages

I am trying to learn NLP using BERT. While trying to import bert model and tokenizer in colab. I am facing the below error.
ImportError: cannot import name '_LazyModule' from 'transformers.file_utils' (/usr/local/lib/python3.7/dist-packages/transformers/file_utils.py)
Here is my code
!pip install transformers==4.11.3
from transformers import BertModel, BertTokenizer
import torch
In order to fix the error.
I tried to upgrade both transformers and torch.
I have tried the solution from the below link:This
Still i am unable to go forward.
Please assist.
Based on these links 1, 2
This should help -
pip install 'lightning-flash[text]' --upgrade
Since the code provided by you is not the cause of the error as it runs on Colab when I tried it hence this might be the culprit in your environment

Unable to use LocateOnScreen function on Pyautogui (Python 3.9)

Here is my code:
import pyautogui
cord = pyautogui.locateOnScreen('chrome.png')
pyautogui.doubleClick(cord)'
However, I got this error:
I installed Pillow and imported PIL
I also installed opencv and numpy.
Through some research I realised it could be some site-package issues/ environment issues. I uninstalled and reinstalled python and updated the PATH.
please help I am at my wits end.
Known problem - i had it too. Maybe downgrade to 3.8 OR even 3.7.
I had to downgrade to 3.7 because a module in pyautoGUI made my script crash.

Failing to import SQLAlchemy and Pymysql into AWS Glue Python Shell script

I have a Python script which imported 3 libraries:
import pymysql
import pandas as pd
from sqlalchemy import create_engine
I'm planning to run Python Shell on AWS Glue. Following this and this doc pages, I created a setup.py:
from setuptools import setup
setup(name="pylibmodule",
version="0.1",
packages=[],
install_requires=['sqlalchemy==1.3.9','pandas==0.25.3','pymysql==0.9.3']
)
I ran python setup.py bdist_wheel, put the resulting pylibmodule-0.1-py3-none-any.whl file into an S3 bucket, and then specified the bucket location in the Glue Job setting. When I ran the job script, it produced an error.
After an investigation, I found that I have sucessfully imported the pandas module, but failed to import sqlalchemy and pymysql.
ModuleNotFoundError: No module named 'sqlalchemy'
ModuleNotFoundError: No module named 'pymysql'
What am I doing wrong?
I ran the job again this morning without changing anything in the setting and the script. It suddenly works. I think the error I received last night was due to some cache residue on Glue's end.

PyMySQL ModuleNotFound Error Python 3.6.4

I'm on a Windows 10 machine trying to use PyMySQL from PyCharm with Python 3.6.4.
I've installed PyMySQL with pip install PyMySQL, and it was successful.
However, the line import pymysql gives me a ModuleNotFoundError (exit code 1)
This answer recommends uninstalling and then reinstalling with pip3, but that hasn't made a difference for me.
What else could I try?

Import module "ipython" in Jupyter notebook

Can somebody please help me loading the ipython module into jupyter notebooks?
ipython is a dependency for Jupyter, so it's already installed.
It looks like you're trying to import ipython widgets (ipywidgets) for use in Jupyter. To do this, in your shell (outside of Jupyter) install ipywidgets:
pip install ipywidgets
jupyter nbextension enable --py widgetsnbextension
Then import widgets:
import ipywidgets as widgets
Read the docs to learn more about installing and using ipython widgets.
I believe that part of the problem is the capitalisation of the IPython package in your import statement:
try: import IPython.html.widgets
I don't know if that will get you everything you want, but that's probably the issue regarding your import.