0

MacOs 10.14.6 Python3.7

I've been trying to install pyautogui for days now and I always get the same error. I've tryed a lot of solutions i found online but none of them seem to work!

This is the message I get everytime no matter what.

ERROR: Command errored out with exit status 1:
 command: /Library/Frameworks/Python.framework/Versions/3.7/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/sm/t3vkq_9922q9v8b134b2hc5w0000gn/T/pip-install-e51jb872/pyobjc-framework-QTKit/setup.py'"'"'; __file__='"'"'/private/var/folders/sm/t3vkq_9922q9v8b134b2hc5w0000gn/T/pip-install-e51jb872/pyobjc-framework-QTKit/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/sm/t3vkq_9922q9v8b134b2hc5w0000gn/T/pip-pip-egg-info-xsobu9ep
     cwd: /private/var/folders/sm/t3vkq_9922q9v8b134b2hc5w0000gn/T/pip-install-e51jb872/pyobjc-framework-QTKit/
Complete output (7 lines):
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/private/var/folders/sm/t3vkq_9922q9v8b134b2hc5w0000gn/T/pip-install-e51jb872/pyobjc-framework-QTKit/setup.py", line 33, in <module>
    for fn in os.listdir("Modules")
  File "/private/var/folders/sm/t3vkq_9922q9v8b134b2hc5w0000gn/T/pip-install-e51jb872/pyobjc-framework-QTKit/pyobjc_setup.py", line 432, in Extension
    % (tuple(map(int, os.path.basename(data)[6:-4].split("."))))
ValueError: invalid literal for int() with base 10: ''
----------------------------------------

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

I'm not an expert at all so if there's someone here that might know how to help please hmu.

Things i've already tried:

sudo pip3 install pillow

That did install pillow into site-packages

sudo pip3 install pyobjc-core

That did install pyobjc-core

sudo pip3 install pyobjc

This one delivered the same error! :

 ERROR: Command errored out with exit status 1:
 command: /Library/Frameworks/Python.framework/Versions/3.7/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-5bnt0it8/pyobjc-framework-QTKit/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-5bnt0it8/pyobjc-framework-QTKit/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/tmp/pip-pip-egg-info-_onha5oq
     cwd: /private/tmp/pip-install-5bnt0it8/pyobjc-framework-QTKit/
Complete output (7 lines):
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/private/tmp/pip-install-5bnt0it8/pyobjc-framework-QTKit/setup.py", line 33, in <module>
    for fn in os.listdir("Modules")
  File "/private/tmp/pip-install-5bnt0it8/pyobjc-framework-QTKit/pyobjc_setup.py", line 432, in Extension
    % (tuple(map(int, os.path.basename(data)[6:-4].split("."))))
ValueError: invalid literal for int() with base 10: ''
----------------------------------------

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Mattt
  • 1
  • According to the documentation `macOS needs the rubicon-objc module installed (in that order).` Did you do that? The error is saying something tried to convert an empty string to an integer, which of course won't work. – Sam Morgan Jun 20 '20 at 18:52
  • I did the "python3 -m pip install rubicon-objc" which installed the module, however that did not fix the problem – Mattt Jun 20 '20 at 19:55

1 Answers1

0

Have you tried to create a new venv (or a conda environment) and run again the installation?

If you are using an IDE like pycharm, you can run the command inside the terminal environment (you have to create a project and setup a new venv in that case):

python3 -m pip install pyautogui

I just tried to install it in my conda environment and it has been installed without any problem (Mac Os Catalina), so I suppose it is a matter of the environment and the packages you have installed before that (if any) or maybe some upgrade is missing.

net_programmer
  • 360
  • 1
  • 2
  • 11
  • I just tried it. Opened a new virtual enviroment using PyCharm, opened the terminal there, pasted the code and the same error happened. – Mattt Jun 20 '20 at 19:52
  • It could be a problem with your python intsallation. Try to make a fresh installation deleting python (maybe using something like appcleaner) and install again python. Be sure to delete all the folders you have created so far – net_programmer Jun 21 '20 at 15:07
  • Hi, today I did remove python with appcleaner and deleted any extra folder. Then I installed it again but the same error happened. :( – Mattt Jun 22 '20 at 23:49
  • Can you try with python 3.8? – net_programmer Jun 23 '20 at 21:07
  • Ok, i did get it to work this time!!! what i did was uninstall my python with appcleaner, then i manually deleted the framework file and the files in bin directory, then i reinstalled python3.7 and user "python3 -m pip install pyautogui" on my virtual enviroment and it worked!!! – Mattt Jun 25 '20 at 01:59
  • great! Have a nice development :) – net_programmer Jun 25 '20 at 09:29