Python3.4 - Install pyautogui - Raspberry Pi 3 - python-3.x

I've been trying to install pyautogui for Python 3.4 on my Raspberry Pi 3 for the last 2 hours... I need it because I wrote a touch keyboard application that needs to run on it. On my main machine (elementary OS 0.4 with Python 3.5) I was able to install it without any problems. First I tried sudo pip install pyautogui but that only installed the Python 2.7 version of pyautogui. Of course next I tried sudo pip3 install pyautogui but that gave me this error:
Running setup.py (path:/tmp/pip-build-hf289jja/pyautogui/setup.py) egg_info for package pyautogui
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip-build-hf289jja/pyautogui/setup.py", line 6, in <module>
version=__import__('pyautogui').__version__,
File "/tmp/pip-build-hf289jja/pyautogui/pyautogui/__init__.py", line 114, in <module>
from . import _pyautogui_x11 as platformModule
File "/tmp/pip-build-hf289jja/pyautogui/pyautogui/_pyautogui_x11.py", line 6, in <module>
from Xlib.display import Display
File "/usr/local/lib/python3.4/dist-packages/Xlib/display.py", line 20, in <module>
import new
ImportError: No module named 'new'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 17, in
File "/tmp/pip-build-hf289jja/pyautogui/setup.py", line 6, in
version=__import__('pyautogui').__version__,
File "/tmp/pip-build-hf289jja/pyautogui/pyautogui/init.py", line 114, in
from . import _pyautogui_x11 as platformModule
File "/tmp/pip-build-hf289jja/pyautogui/pyautogui/_pyautogui_x11.py", line 6, in
from Xlib.display import Display
File "/usr/local/lib/python3.4/dist-packages/Xlib/display.py", line 20, in
import new
ImportError: No module named 'new'
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-hf289jja/pyautogui
Storing debug log for failure in /root/.pip/pip.log
... sorry for the formatting of the above, I couldn't get it to stay inside one code box.
I have no idea what module "new" is. I tried everything else under the sun, such as installing from the official resources: https://pypi.python.org/pypi/PyAutoGUI and various other guides, with NO results.. I'm kinda loosing my mind right now.
ANY Help is grately appreciated :)

Try the following:
sudo pip3 install python3-xlib
sudo pip3 install pyautogui
This assumes you have some other python3 libraries already installed, but you will see missing installs in the above if not.

Related

distutils.util missing after upgrading to 3.8

I just upgraded to Pop OS(Ubuntu) 20.04, which upgraded Python 3.7 to 3.8. Now I get this error below when I run sam (from the AWS SAM CLI). Solutions found online all had to do with making sure python3-distutils is installed. I have verified that python3-disutils is installed. /usr/lib/python3.8/distutils looks fine, just not getting picked up for some reason.
One thing I noticed is that in the traceback below, it's using the system-wide pip, while I have a later version of pip installed under my .local. I don't know if those two symptoms are related but looks like I'm missing some config somewhere so none of the 3.8 or user space stuff is picked up.
Build Failed
Error: PythonPipBuilder:ResolveDependencies - Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python3/dist-packages/pip/_internal/main.py", line 14, in main
from pip._internal.utils.entrypoints import _wrapper
File "/usr/lib/python3/dist-packages/pip/_internal/utils/entrypoints.py", line 3, in <module>
from pip._internal.cli.main import main
File "/usr/lib/python3/dist-packages/pip/_internal/cli/main.py", line 10, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "/usr/lib/python3/dist-packages/pip/_internal/cli/autocompletion.py", line 9, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "/usr/lib/python3/dist-packages/pip/_internal/cli/main_parser.py", line 7, in <module>
from pip._internal.cli import cmdoptions
File "/usr/lib/python3/dist-packages/pip/_internal/cli/cmdoptions.py", line 19, in <module>
from distutils.util import strtobool
ModuleNotFoundError: No module named 'distutils.util'
I have the same issue on Debian Bullseye (or rather mixed Bullseye/Buster).
Package python3-distutils (3.8.6) contains module for Python 3.8 and 3.9 (!).
Old package (3.7.3) for Python 3.7. You have to choose.
My workaround is just copy module.
mkdir -p /usr/lib/python3.7/distutils
cp -a /usr/lib/python3.8/distutils/* /usr/lib/python3.7/distutils/

Pyautogui-module is not installing with pip3 on Ubuntu 19.10

I'm developing with python 3 and trying to install the pyautogui Module, and to be able to use it I had to install some packages. But I keep getting errors when installing the packages with pip3.
Collecting pyobjc-framework-Quartz
Using cached https://files.pythonhosted.org/packages/a9/af/fb7a7264d3bf0147bdd1d01eeb4e8b1cac90f0613aca336b178771dcdec7/pyobjc-framework-Quartz-6.2.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-4ukazwoa/pyobjc-framework-Quartz/setup.py", line 67, in <module>
py_limited_api=True,
File "/tmp/pip-install-4ukazwoa/pyobjc-framework-Quartz/pyobjc_setup.py", line 390, in Extension
os_level = get_os_level()
File "/tmp/pip-install-4ukazwoa/pyobjc-framework-Quartz/pyobjc_setup.py", line 200, in get_os_level
with open("/System/Library/CoreServices/SystemVersion.plist", "rb") as fp:
FileNotFoundError: [Errno 2] No such file or directory: '/System/Library/CoreServices/SystemVersion.plist'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-4ukazwoa /pyobjc-framework-Quartz/
Anyone has a idea what the problem is?
Anything related to Objective C, pyobjc and especially pyobjc-framework-Quartz require Mac OS X. You cannot install them at Ubuntu.

How to deal with "ModuleNotFoundError: No module named 'setup' "

I installed the module "pyunicorn" in Ubuntu 16.04 LTS and all the dependencies but when I import the module in python 3.7.3 i get this error :
>>> import pyunicorn
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/user/anaconda3/lib/python3.7/site-packages/pyunicorn/__init__.py", line 43, in <module>
from setup import __version__
ModuleNotFoundError: No module named 'setup'
What should i do to make it run properly???
I had this problem. I wanted to install it on Google Colab. I tried installing pyunicorn directly from Github and it worked for me. Try using following instruction:
pip install git+https://github.com/pik-copan/pyunicorn.git#egg=pyunicorn

python3 path only running google-appengine modules

When running django projects with python3 or installing modules with pip, I am getting google-appengine errors, even if my project is not using google appengine.
When running pip3 freeze I get the following results:
andrew#andrew:~/dev/quickistock$ pip3 freeze
Traceback (most recent call last):
File "/usr/bin/pip3", line 9, in <module>
from pip import main
File "/home/andrew/.local/lib/python3.5/site-packages/pip/__init__.py", line 26, in <module>
from pip.utils import get_installed_distributions, get_prog
File "/home/andrew/.local/lib/python3.5/site-packages/pip/utils/__init__.py", line 23, in <module>
from pip.locations import (
File "/home/andrew/.local/lib/python3.5/site-packages/pip/locations.py", line 10, in <module>
from distutils.command.install import install, SCHEME_KEYS # noqa
File "/usr/local/google-cloud-sdk/platform/google_appengine/lib/distutils/distutils/command/install.py", line 258
raise DistutilsOptionError, \
^
SyntaxError: invalid syntax
The file usr/local/google-cloud-sdk/platform/google_appengine/lib/distutils/distutils/command/install.py has lines like this and is compatible with python 2.1. Note. this is not the official google repository but it's accurate:
print "config vars:"
This means that install.py is a python 2 file and you are running pip from python 3. There probably is some incompatibility between them.

can't install CherryPy with python3.3 under ubuntu12.04

I tried to install CherryPy under Ubuntu 12.04.3 server with command:
sudo python3.3 setup.py install
It seems that everything was fine.
But when running test:
python3.3 -c "import cherrypy"
it gives an error:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/lib/python3.3/dist-packages/cherrypy/__init__.py", line 82, in <module>
from cherrypy import process
File "/usr/local/lib/python3.3/dist-packages/cherrypy/process/__init__.py", line 14, in <module>
from cherrypy.process import plugins, servers
File "/usr/local/lib/python3.3/dist-packages/cherrypy/process/plugins.py", line 424, in <module>
class PerpetualTimer(threading._Timer):
AttributeError: 'module' object has no attribute '_Timer'
When doing the same with
python2.7 -c "import cherrypy"
it gives no output.
What could it be?
Best regards,
Leonid
"Timer class was renamed from _Timer to Timer in Python 3.3"
https://bitbucket.org/cherrypy/cherrypy/issue/1163/attributeerror-in-cherrypyprocessplugins
Hope this helps!
I have downloaded CherryPy 3.2.3 from python.org (https://pypi.python.org/pypi/CherryPy/3.2.3) instead of 3.2.2 taken from cherrypy.org (http://download.cherrypy.org/cherrypy/3.2.2/) used before and run installation process once more.
Now it works for some reason...
I work with Cherrypy and I install this with Mako always with Terminal writing:
sudo apt-get install subversion python-mako python-simplejson python-cherrypy3 graphviz
This I find inside the site, you can save this in bookmarks' s browser.
Installation simpler and faster

Resources