DevZone
DevZone

Reputation: 63

Error when trying to install pyautogui

I am trying to install pytautogui through pip, but keep running into issues. This is on a Mac. I have tried running the command under python 2.7 as well as 3.6.1, but to no success.

Complete output from command python setup.py egg_info:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/private/var/folders/sz/62b931pd5zjbclx2fzpkww1w0000gn/T/pip-build-0vb25t/pyautogui/setup.py", line 6, in <module>
    version=__import__('pyautogui').__version__,
  File "pyautogui/__init__.py", line 110, in <module>
    from . import _pyautogui_osx as platformModule
  File "pyautogui/_pyautogui_osx.py", line 7, in <module>
    assert False, "You must first install pyobjc-core and pyobjc: https://pyautogui.readthedocs.io/en/latest/install.html"
AssertionError: You must first install pyobjc-core and pyobjc: https://pyautogui.readthedocs.io/en/latest/install.html

What am I missing here, I already installed pyobjc-core but that didnt fix it? Does this look like an issue with pyautogui installer ?

Thanks for your help.

Upvotes: 4

Views: 2762

Answers (3)

JayRizzo
JayRizzo

Reputation: 3616

To Check if you have installed the require packages pyobjc & pyobjc-core

pip list | grep pyobjc

# OR if you have python2 & python3.

pip3 list | grep pyobjc

Try:

pip install pyobjc
pip install pyobjc-core

# OR if you have python2 & python3.

pip3 install pyobjc
pip3 install pyobjc-core

You should get a Requirement already satisfied message. Otherwise it will install.

If you get or have an error try using this to reinstall:

pip install pyobjc --upgrade --force
pip install pyobjc-core --upgrade --force

# OR if you have python2 & python3.

pip3 install pyobjc --upgrade --force
pip3 install pyobjc-core --upgrade --force

Then try to install again.

pip install pyautogui --upgrade --force

# OR if you have python2 & python3.

pip3 install pyautogui --upgrade --force

That should fix your issue.

Upvotes: 1

user14921214
user14921214

Reputation: 11

sudo pip3 install pyobjc --upgrade --force
sudo pip3 install pyobjc-core --upgrade --force

Upvotes: 0

Ahmad Nourallah
Ahmad Nourallah

Reputation: 335

In issue like that you should:

  1. Check if you install the version of pyobjc that compatible with your python version.
  2. Check if you install the both require packages (pyobjc, pyobjc-core)

Upvotes: 2

Related Questions