Trouble installing pyautogui on windows 10 - python

I'm having trouble installing pyautogui, it gives me the following error. By the way, I'm new to python so if I'm not understanding something please explain it to me.
Thanks in advance!
pip install pyautogui
Collecting pyautogui
Using cached https://files.pythonhosted.org/packages/f0/76/7a0ec1013bc3559b7438f6773cba05ffaec600b8989be2d621a144e39b50/PyAutoGUI-0.9.53.tar.gz
Collecting pymsgbox (from pyautogui)
Collecting PyTweening>=1.0.1 (from pyautogui)
Using cached https://files.pythonhosted.org/packages/e9/4f/acb6a2d95260a4377885e40c167fd5df587630696a6a7934675f86aebb06/pytweening-1.0.4.tar.gz
Collecting pyscreeze>=0.1.21 (from pyautogui)
Collecting pygetwindow>=0.0.5 (from pyautogui)
Using cached https://files.pythonhosted.org/packages/e1/70/c7a4f46dbf06048c6d57d9489b8e0f9c4c3d36b7479f03c5ca97eaa2541d/PyGetWindow-0.0.9.tar.gz
Collecting mouseinfo (from pyautogui)
Using cached https://files.pythonhosted.org/packages/28/fa/b2ba8229b9381e8f6381c1dcae6f4159a7f72349e414ed19cfbbd1817173/MouseInfo-0.1.3.tar.gz
Collecting Pillow>=6.2.1; python_version == "3.8" (from pyscreeze>=0.1.21->pyautogui)
Using cached https://files.pythonhosted.org/packages/8f/59/97618ad67fc0639ed588c60cfe9d91417f7bae8c87bbe7c7784b0ffdb9f1/Pillow-9.2.0-cp38-cp38-win_amd64.whl
Collecting pyrect (from pygetwindow>=0.0.5->pyautogui)
Using cached https://files.pythonhosted.org/packages/cb/04/2ba023d5f771b645f7be0c281cdacdcd939fe13d1deb331fc5ed1a6b3a98/PyRect-0.2.0.tar.gz
Collecting pyperclip (from mouseinfo->pyautogui)
Using cached https://files.pythonhosted.org/packages/a7/2c/4c64579f847bd5d539803c8b909e54ba087a79d01bb3aba433a95879a6c5/pyperclip-1.8.2.tar.gz
Installing collected packages: pymsgbox, PyTweening, Pillow, pyscreeze, pyrect, pygetwindow, pyperclip, mouseinfo, pyautogui
ERROR: Could not install packages due to an EnvironmentError: [WinError 5] Access is denied: 'c:\program files\python38\Lib\site-packages\pymsgbox'
Consider using the --user option or check the permissions.
WARNING: You are using pip version 19.2.3, however version 22.1.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

The error actually gives you your answer by their recommendation to use the --user option. I run into this as well, if you want to install something without admin privileges. Just add the --user flag to the end of your pip command. This will limit the installation to the current user and not require administrator privileges.
Try this:
pip install pyautogui --user
The second error also gives you the answer of what to do.
pip install --upgrade pip
or, if needed...
pip install --upgrade pip --user

Related

Error: subprocess-exited-with -error. --python

Error: subprocess-exited-with -error, python setup.py egg_info did not run successfully.
I know that there are some similar questions. But the error still exist after trying those solution. I want to install a model called midi-ddsp and it shows an error.
Requirement already satisfied: music21 in ./Library/Python/3.8/lib/python/site-packages (from midi-ddsp) (7.3.3)
Requirement already satisfied: pandas in ./Library/Python/3.8/lib/python/site-packages (from midi-ddsp) (1.3.3)
Requirement already satisfied: pretty-midi in ./Library/Python/3.8/lib/python/site-packages (from midi-ddsp) (0.2.9)
Requirement already satisfied: mir-eval in ./Library/Python/3.8/lib/python/site-packages (from ddsp==3.2.0->midi-ddsp) (0.7)
Requirement already satisfied: tensorflow-addons in ./Library/Python/3.8/lib/python/site-packages (from ddsp==3.2.0->midi-ddsp) (0.17.1)
Requirement already satisfied: cloudml-hypertune in ./Library/Python/3.8/lib/python/site-packages (from ddsp==3.2.0->midi-ddsp) (0.1.0.dev6)
Collecting crepe>=0.0.11
Using cached crepe-0.0.12.tar.gz (15 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
Because the codes are too long, if I need to paste more, please tell me!
I've tried to upgrade pip, pip3 install midi-ddsp --use-deprecated=legacy-resolver, pip3 install --upgrade setuptools, easy_install -U setuptools and so on. But neither of them could work. Hope someone could help me, thanks!
I tried these from the answers of another question on StackOverflow but didn't work for me
pip install --user pygames
python -m pip install -u pygame --user
(How to solve the "pip install pygame" issue?)
But in the end, I tried along with --pre. This worked
pip install pygame --pre
Output:
PS C:\\Windows\\system32\> pip install pygame --pre
Collecting pygame
Using cached pygame-2.1.3.dev8-cp311-cp311-win_amd64.whl (10.6 MB)
Installing collected packages: pygame
Successfully installed pygame-2.1.3.dev8
I think --pre is used for
The pip install command also supports a --pre flag that enables installation of pre-releases and development releases.
I had the same problem when I tried to import an old requirements.txt.
scipy==1.5.1
I checked it from Pypi, changed to 1.9.1 in requirements.txt,
and it works!
I had a similar problem on updating systemd-python with
python3.8 -m pip install --upgrade systemd-python
The error message began with these words:
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
The lines following were quite telling:
Cannot find libsystemd or libsystemd-journal:
Package libsystemd was not found in the pkg-config search path.
Even though the package libsystemd was installed, Python did not find it. I have learnt that often you can solve this "not finding an installed package" by installing the corresponding dev package; in this case it is libsystemd-dev.
After installing the libsystemd-dev the command python3.8 -m pip install --upgrade systemd-python ran smoothly.
I got this exact same error when trying to run:
pip install dotenv
After a lot of hunting around, I realised I got the package name wrong. The correct command was:
pip install python-dotenv
Maybe try googling "pip your-package-name" to find the PyPi page for your package and double check you are using the correct name? It is annoying that the pip error message was not more descriptive.

Having trouble installing PyTorch

I'm having trouble installing PyTorch.
C:\Users\myself>pip install torch
Collecting torch
Using cached torch-1.7.1-cp38-cp38-win_amd64.whl (184.0 MB)
Requirement already satisfied: numpy in c:\users\myself\appdata\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages (from torch) (1.19.1)
Requirement already satisfied: typing-extensions in c:\users\myself\appdata\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages (from torch) (3.7.4.3)
Installing collected packages: torch
ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: 'C:\\Users\\myself\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python38\\site-packages\\caffe2\\python\\serialized_test\\data\\operator_test\\learning_rate_adaption_op_test.test_learning_rate_adaption_op_normalization.zip'
WARNING: You are using pip version 20.2.4; however, version 20.3.3 is available.
You should consider upgrading via the 'C:\Users\myself\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe -m pip install --upgrade pip' command.
It says that I'm missing a file in caffe2, but I'm not sure how I can get that file back.
Torch wheel contains caffe2 directory.
1.Try --no-cache-dir option
pip install --no-cache-dir torch
2. Removing the MAX_PATH Limitation
See here 3. Using Python on Windows — Python 3.7.9 documentation. You can find some more detailed discussion here.

cant import sendgrid after pip installing it

I tried using pip install sendgrid, but got this error:
Collecting sendgrid
Using cached https://files.pythonhosted.org/packages/24/21/9bea4c51f949497cdce11f46fd58f1a77c6fcccd926cc1bb4e14be39a5c0/sendgrid-5.6.0-py2.py3-none-any.whl
Requirement already satisfied: python-http-client>=3.0 in /home/avin/.local/lib/python2.7/site-packages (from sendgrid) (3.1.0)
Installing collected packages: sendgrid
Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/sendgrid-5.6.0.dist-info'
Consider using the --user option or check the permissions.
I used the --user as suggested and it run ok:
Collecting sendgrid
Using cached https://files.pythonhosted.org/packages/24/21/9bea4c51f949497cdce11f46fd58f1a77c6fcccd926cc1bb4e14be39a5c0/sendgrid-5.6.0-py2.py3-none-any.whl
Requirement already satisfied: python-http-client>=3.0 in /home/avin/.local/lib/python2.7/site-packages (from sendgrid) (3.1.0)
Installing collected packages: sendgrid
Successfully installed sendgrid-5.6.0
However, now, when running IPython, I can't import sendgrid...
ImportError: No module named sendgrid
pip -V = pip 19.0.3
This is a very useful command pip install --ignore-installed <package>
It will make your life easy :)
Solved.
It required another package that I missed: pip install python-HTTP-Client.
After that I no longer needed the --user and the imports worked fine

pip doesn't install anything and tells me to upgrade pip

So whenever I try to install anything pip throws this error:
DEVICE_NAME:~ MY_NAME$ sudo pip install pyautogui
Password:
The directory '/Users/daankoning/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/daankoning/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting pyautogui
Downloading https://files.pythonhosted.org/packages/2e/83/89b5adbc37d1bbf7b486a2c1c00e8037e6f801e8c053c4897bb82d9510c6/PyAutoGUI-0.9.36.tar.gz (46kB)
100% |████████████████████████████████| 51kB 1.3MB/s
Collecting pymsgbox (from pyautogui)
Downloading https://files.pythonhosted.org/packages/b6/65/86379ede1db26c40e7972d7a41c69cdf12cc6a0f143749aabf67ab8a41a1/PyMsgBox-1.0.6.zip
Collecting PyTweening>=1.0.1 (from pyautogui)
Downloading https://files.pythonhosted.org/packages/b9/f8/c32a58d6e4dff8aa5c27e907194d69f3b57e525c2e4af96f39c6e9c854d2/PyTweening-1.0.3.zip
Collecting Pillow (from pyautogui)
Downloading https://files.pythonhosted.org/packages/df/aa/a25f211a4686f363d8ca5a1752c43a8f42459e70af13e20713d3e636f0af/Pillow-5.1.0-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (3.6MB)
100% |████████████████████████████████| 3.6MB 3.5MB/s
Collecting pyscreeze (from pyautogui)
Downloading https://files.pythonhosted.org/packages/9e/ec/e625b7c4f496977eafc441cd1f71becc8436a4ff0714263b885d269d866a/PyScreeze-0.1.14.tar.gz
matplotlib 1.3.1 requires nose, which is not installed.
matplotlib 1.3.1 requires tornado, which is not installed.
matplotlib 1.3.1 has requirement numpy>=1.5, but you'll have numpy 1.8.0rc1 which is incompatible.
Installing collected packages: pymsgbox, PyTweening, Pillow, pyscreeze, pyautogui
Running setup.py install for pymsgbox ... done
Running setup.py install for PyTweening ... done
Running setup.py install for pyscreeze ... done
Running setup.py install for pyautogui ... done
Successfully installed Pillow-5.1.0 PyTweening-1.0.3 pyautogui-0.9.36 pymsgbox-1.0.6 pyscreeze-0.1.14
You are using pip version 10.0.0b2, however version 10.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
and when I then type pip install --upgrade pip it throws the same error. I've tried reinstalling pip thrice over already and I'm completely out of ideas as to what I can do.
It also does this when I try to install any other package, not jus pyautogui.
Please note that this is only on my OSX machine whilst on my PC it works perfectly fine.
There is always the option downloading a .whl-file and install it with
pip install /some-dir/some-file.whl
I have the same problems as you have with Py 3.4, so i just use Py 3.5. But I know there is no Version of PyAutoGui for 3.x. You can install this package per wheel, and if it is only this package, this'd be ok... Obviously, it does do Pillow...

pip install livewires gets no matching distribution found for pygame

I am getting the following errors when run pip install livewires:
Collecting livewires
Using cached LiveWires-2.1.tar.gz
Collecting pygame (from livewires)
Could not find a version that satisfies the requirement pygame (from livewires) (from versions: )
No matching distribution found for pygame (from livewires)
I am in Mac with python 2.7.10, and this package can not be installed through my editor (Pycharm) neither.
Using cached LiveWires-2.1.tar.gz
Maybe there is a problem with the cached version. Try using the --no-cache-dir flag to force a fresh download.
pip install --no-cache-dir livewires

Categories