Search code examples
pythonpippyautogui

pip install pyautogui errors in terminal


When I try importing pyautogui it says module not found and on installing it in the command line:

command

pip3 install pyautogui

responce in terminal

Command "D:\pythonp\venv\Scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\hp\\AppData\\Local\\Temp\\pip-install-1zr0j9qn\\Pillow\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.re
ad().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\hp\AppData\Local\Temp\pip-record-gwxfcxoi\install-record.txt --single-version-externally-managed --compile --install-
headers D:\pythonp\venv\include\site\python3.8\Pillow" failed with error code 1 in C:\Users\hp\AppData\Local\Temp\pip-install-1zr0j9qn\Pillow\

Solution

  • After carefully looking at everything around my project I realized for the imports to work, the python file should be inside the venv folder.