![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Where are the python modules stored?
Python Modules are usually stored in /lib/site-packages in your Python folder. If you want to see what directories Python checks when importing modules, you can log the following:
>>> import sys >>> print sys.path ['', 'C:\Python27', 'C:\Python27\Lib\site-packages', 'C:\Python27\Lib', 'C:\Python27\DLLs', 'C:\Python27\Lib\lib-tk', 'C:\Python27\Scripts', 'C:\WINDOWS\SYSTEM32\python27.zip', 'C:\Python27\lib\plat-win', 'C:\Python27\lib\site-packages\win32', 'C:\Python27\lib\site-packages\win32\lib', 'C:\Python27\lib\site-packages\Pythonwin']
You can also list where individual modules being used by a script(say hello.py) reside on the system using the python -v command. For example,
$ python -v hello.py PS C:\Users\Ayush> echo 'import scrapy' > hello.py PS C:\Users\Ayush> python -v hello.py # installing zipimport hook import zipimport # builtin # installed zipimport hook # C:\Python27\Lib\site.pyc matches C:\Python27\Lib\site.py import site # precompiled from C:\Python27\Lib\site.pyc # C:\Python27\Lib\os.pyc matches C:\Python27\Lib\os.py ... ...
Advertisements