Search code examples
pythonpippyautogui

Where do python modules get saved to in a root directory?


So, I'm a bit new to python and have mastered javascript. I know that javascript modules are saved in node_modules folder in a directory

I did: $ pip install pyautogui

but when I'm about to run my code, it says :

'Traceback (most recent call last):
  File "bruh.py", line 1, in <module>
    import pyautogui, time
ImportError: No module named pyautogui'

where do python modules get saved to? 'python_modules' folder?????

also, idk what to do, can anyone help me with this error?


Solution

  • To see the path where your modules are saved once you pip them.

    You can open a python shell, import sys and print the sys.path variable. One of the path would end with site-packages, thats the path where modules are saved.

    $ python3
    >>> import sys
    >>> print(sys.path)
    [‘’, ‘/Users/uname/.local/lib/python3.6/site-packages/‘]