Error when using pyautogui module in Mu-Editor - module

I'm trying to write some code and import the pyautogui module, but am getting an error.
import pyautogui
import webbrowser
webbrowser.open('https://roamresearch.com/#/app/test852')
b = pyautogui.locateOnScreen('JournalQuestions.png')
I'm getting the following error:
Traceback (most recent call last):
File "/Users/rika/mu_code/mouse.py", line 2, in
import pyautogui
ModuleNotFoundError: No module named 'pyautogui'

I found the answer in the Mu-Editor community. I just needed to download the Alpha version from here: https://codewith.mu/en/download. Then click on Gears icon and there is a tab for importing packages. Very user friendly!

Related

hello i am new to python. i installed matplotlib in my Visual studio but whenever i try to run the file it displays the error

I wanted to plot a graph. but suddenly i could not because of the import error. yet i have installed matplotlib and numpy.
Traceback (most recent call last):
File "c:\Users\user\Documents\plot.py", line 1, in
from matplotlib import pyplot as plt
File "C:\Users\user\AppData\Roaming\Python\Python311\site-packages\matplotlib_init_.py", line 109, in
from . import _api, _version, cbook, docstring, rcsetup
File "C:\Users\user\AppData\Roaming\Python\Python311\site-packages\matplotlib\rcsetup.py", line 27, in
from matplotlib.colors import Colormap, is_color_like
File "C:\Users\user\AppData\Roaming\Python\Python311\site-packages\matplotlib\colors.py", line 56, in
from matplotlib import _api, cbook, scale
File "C:\Users\user\AppData\Roaming\Python\Python311\site-packages\matplotlib\scale.py", line 23, in
from matplotlib.ticker import (
File "C:\Users\user\AppData\Roaming\Python\Python311\site-packages\matplotlib\ticker.py", line 136, in
from matplotlib import transforms as mtransforms
File "C:\Users\user\AppData\Roaming\Python\Python311\site-packages\matplotlib\transforms.py", line 46, in
from matplotlib._path import (
ImportError: DLL load failed while importing _path: The specified module could not be found.
PS C:\Users\user\Documents>
I figured it out.
If you have already installed matplotlib, but the error still comes about. Then you have to download Microsoft C++ from their website.
https://www.microsoft.com/en-US/Download/confirmation.aspx?id=48145
install Microsoft c++ then you can try again to run your code.
it has worked for me like magic.
I got the solution from a youtube video.
link here.
https://www.youtube.com/watch?v=DpwsvUkNAmg

Cannot import sentinelsat python module

I am a python newbie and am trying to get the sentinelhub module to work but have been receving this error message on my code:
import sentinelhub
Traceback (most recent call last):
File "<pyshell#0>", line 1, in
import sentinelhub
ImportError: No module named sentinelhub
After I've downloaded the module using "pip install sentinelhub" on the windows command. I am currently using Python version 2.7.18. Any suggestions would be helpful. Thanks.
It looks like sentinelhub requires a different version of Python.
From their own website they specify that it "requires Python >=3.7"
https://sentinelhub-py.readthedocs.io/en/latest/install.html

using snakemake.utils in profile without using conda-not-block-search-path-envvars

I just updated from snakemake 5.28 to 5.32, and now from snakemake.utils import read_job_properties throws an import error for my job submission script in my snakemake profile:
Traceback (most recent call last):
File "/ebio/abt3_projects/software/dev/ll_pipelines/llmgqc/bin/ll_pipeline_utils/profiles/sge/sge-submit.py", line 7, in <module>
from snakemake.utils import read_job_properties
ModuleNotFoundError: No module named 'snakemake'
Using --conda-not-block-search-path-envvars prevents this import error, but I'd rather not have to use --conda-not-block-search-path-envvars every time I run snakemake.
I don't see anything special that the SLURM snakemake profile uses to get around this import issue, so I really don't know what to do besides using --conda-not-block-search-path-envvars all of the time.

cannot import name 'nosetester' error while importing pandas

Im getting below error while importing pandas
cannot import name 'nosetester'
Traceback (most recent call last):
File "/usr/bin/anaconda/envs/py35/lib/python3.5/site-packages/pandas/init.py", line 56, in
from pandas.util.nosetester import NoseTester
File "/usr/bin/anaconda/envs/py35/lib/python3.5/site-packages/pandas/util/nosetester.py", line 13, in
from numpy.testing import nosetester
ImportError: cannot import name 'nosetester'
Pandas version ->0.18.1
Numpy version ->1.18.0
Any help to resolve the error?
One approach is to use python 3.6 version like 3.6.5 is a stable version.
Another approach is if you want to continue in python 3.5 version itself then python 3.5.2 it worked correctly.

Lxml import issues when using Scrapy

I am trying to use Scrapy with Anaconda/Miniconda on Windows 10. Installation goes fine, but trying to actually run Scrapy gives the following error:
Traceback (most recent call last):
File "C:\ProgramData\Miniconda3\Scripts\scrapy-script.py", line 6, in <module>
from scrapy.cmdline import execute
File "C:\ProgramData\Miniconda3\lib\site-packages\scrapy\__init__.py", line 34, in <module>
from scrapy.spiders import Spider
File "C:\ProgramData\Miniconda3\lib\site-packages\scrapy\spiders\__init__.py", line 10, in <module>
from scrapy.http import Request
File "C:\ProgramData\Miniconda3\lib\site-packages\scrapy\http\__init__.py", line 11, in <module>
from scrapy.http.request.form import FormRequest
File "C:\ProgramData\Miniconda3\lib\site-packages\scrapy\http\request\form.py", line 11, in <module>
import lxml.html
File "C:\ProgramData\Miniconda3\lib\site-packages\lxml\html\__init__.py", line 53, in <module>
from .. import etree
ImportError: DLL load failed: The specified module could not be found.
I have tried reinstalling Scrapy, lxml, and Anaconda itself (this time, I'm using a clean install of Miniconda), as well as downloading unofficial lxml build from https://www.lfd.uci.edu/~gohlke/pythonlibs/, as suggested in one of the answers on Stack Overflow, but the problem persists. I have also done this on an Amazon AWS EC2 instance started from scratch, but I'm getting the same issue.
It seems to be something relatively common, but I couldn't find an answer that would work for me. What's an appropriate way to address this? Is it just about lxml, or is there something else causing this problem?