/
๐Ÿ

Path built-in function

python

We can see the path that python look for import module or library.

python
import sys
print(sys.path)
Output
['/home/mojalali/Desktop', '/usr/lib/python38.zip', '/usr/lib/python3.8', '/usr/lib/python3.8/lib-dynload', '/home/mojalali/.local/lib/python3.8/site-packages', '/usr/local/lib/python3.8/dist-packages', '/usr/lib/python3/dist-packages']
Edit this page
logo
Hi Mohsen save your notes