Search code examples
pythonpython-3.xpippyautogui

Installing PyAutoGui on multiple versions of Python


I, as it will soon be obvious, am a total newb when it comes to Python.

I am running python version 3.5 on Windows 10, 64 bit.

I installed the PyAutoGui module for a small project I am working on. At first, everything worked perfectly. But now it appears that PyAutoGui is crashing when it clicks. I suspect that it's because PyAutoGui is only intended for use up to Python 3.4.

In order to rectify this, I downloaded Python 3.4. Unfortunately, however, when I try to install PyAutoGui (using pip install pyautogui), it tells me that it's already been installed because it sees it in the Python 3.5 folder.

My question is this: How do I install PyAutoGui in Python 3.4 with it already installed in Python 3.5? Assume that I know virtually nothing about how to install a module manually without using pip

Thanks in advance!


Solution

  • If you have multiple versions of Python installed you need to find your versions and rename them and their Pips.

    In windows the path is, C:\\Users\USERNAME\AppData\Local\Programs\Python\Python3x-32. The x should be replaced with the Python version and USERNAME with your username. On Mac it's located in /usr/local/bin/python. On Linux it should be in /usr/bin/python. The location might vary depending on OS and Python version.

    Rename the files python.exe/python and pip.exe/pip so that each file is different. I named mine python35.exe, python2.exe and python.exe(for 3.5, 2.7 and 3.6).

    Now when you execute your pip command use, pip34 install pyautogui or whatever you named the file.

    Or if you really want to you can go the painful way of renaming all the path variables, but I won't explain that here.