pip3 install pyautogui fails with error code 1 Mac OS

2024/9/22 14:29:23

I tried installing the autogui python extension:

pip3 install pyautogui

And this installation attempt results in the following error message:

Collecting pyautoguiUsing cached PyAutoGUI-0.9.33.zipComplete output from command python setup.py egg_info:Traceback (most recent call last):File "<string>", line 1, in <module>File "/private/var/folders/00/zcr6mkx90hg7kr4x_ks6nhhw0000gn/T/pip-build-edy15oyn/pyautogui/setup.py", line 6, in <module>version=__import__('pyautogui').__version__,File "/private/var/folders/00/zcr6mkx90hg7kr4x_ks6nhhw0000gn/T/pip-build-edy15oyn/pyautogui/pyautogui/__init__.py", line 110, in <module>from . import _pyautogui_osx as platformModuleFile "/private/var/folders/00/zcr6mkx90hg7kr4x_ks6nhhw0000gn/T/pip-build-edy15oyn/pyautogui/pyautogui/_pyautogui_osx.py", line 4, in <module>import QuartzFile "/usr/local/lib/python3.5/site-packages/Quartz/__init__.py", line 5, in <module>import objcFile "/usr/local/lib/python3.5/site-packages/objc/__init__.py", line 18, in <module>_update()File "/usr/local/lib/python3.5/site-packages/objc/__init__.py", line 15, in _updateimport objc._objc as _objcImportError: dlopen(/usr/local/lib/python3.5/site-packages/objc/_objc.cpython-35m-darwin.so, 2): Symbol not found: _PyObject_REPRReferenced from: /usr/local/lib/python3.5/site-packages/objc/_objc.cpython-35m-darwin.soExpected in: flat namespacein /usr/local/lib/python3.5/site-packages/objc/_objc.cpython-35m-darwin.so----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/00/zcr6mkx90hg7kr4x_ks6nhhw0000gn/T/pip-build-edy15oyn/pyautogui

My Mac OS version is OS X El Capitan 10.11.3, my Python3 version is 3.5.1, and my pip3 version is pip 8.0.2.

There seems to be a similar question on Stackoverflow (Cannot install pip install pyautogui, error code 1), but the fix does not apply to my problem; I have already installed "pillow". Also, I have read the documentation (https://pypi.python.org/pypi/PyAutoGUI), and installed pyobjc-core as well as pyobjc. Setuptools are installed and up-to-date.

Does anyone have an idea how to fix this error (and install pyautogui)? I think the error might originate, because _PyObject_REPR is missing in Python 3.5.1.

Answer

I found a workaround. This code by "Kentzo" fixed the issue for me:

pip3 install https://github.com/GreatFruitOmsk/pyobjc-core/releases/download/v3.0.5.dev0/pyobjc-core-3.0.5.tar.gz

Since the code is not written by me, please use this workaround at your own risk.

https://en.xdnf.cn/q/71938.html

Related Q&A

BERT get sentence embedding

I am replicating code from this page. I have downloaded the BERT model to my local system and getting sentence embedding. I have around 500,000 sentences for which I need sentence embedding and it is t…

Python Subversion wrapper library

In Subversions documentation theres an example of using Subversion from Python#!/usr/bin/python import svn.fs, svn.core, svn.reposdef crawl_filesystem_dir(root, directory):"""Recursively…

How to convert a selenium webelement to string variable in python

from selenium import webdriver from time import sleep from selenium.common.exceptions import NoSuchAttributeException from selenium.common.exceptions import NoSuchElementException from selenium.webdriv…

Why are session methods unbound in sqlalchemy using sqlite?

Code replicating the error:from sqlalchemy import create_engine, Table, Column, Integer from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmakerBase = declarative…

Combining Tkinter and win32ui makes Python crash on exit

While building a basic app using the winapi with Python 2.7 (Im on Windows 8.1), I tried to add a small Tkinter gui to the program. The problem is, whenever I close the app window, Python crashes compl…

horizontal tree with graphviz_layout

in python, with networkx. I can plot a vertical tree with : g=nx.balanced_tree(2,4)pos = nx.graphviz_layout(g, prog=dot)nx.draw(g,pos,labels=b_all, node_size=500)plt.show()similar to [root]|| |nod…

Finding first n primes? [duplicate]

This question already has answers here:Closed 12 years ago.Possible Duplicate:Fastest way to list all primes below N in python Although I already have written a function to find all primes under n (pr…

Scipy.optimize.root does not converge in Python while Matlab fsolve works, why?

I am trying to find the root y of a function called f using Python. Here is my code:def f(y):w,p1,p2,p3,p4,p5,p6 = y[:7] t1 = w - 0.99006633*(p1**0.5) - (-1.010067)*((1-p1))t2 = w - 22.7235687*(p2**0.…

Query CPU ID from Python?

How I can find processor id with py2.6, windows OS?I know that there is pycpuid, but I cant compile this under 2.6.

Recover from segfault in Python

I have a few functions in my code that are randomly causing SegmentationFault error. Ive identified them by enabling the faulthandler. Im a bit stuck and have no idea how to reliably eliminate this pro…