I have created a folder named C:\Python27\Lib\site-packages\perso
and inside I have put a file mymodule.py
. The goal is to have this module accessible from any future Python script.
Let's do a D:\My Documents\test.py
file:
import mymodule #fails
import perso.mymodule #fails
Why does it fail? How to import a module from C:\Python27\Lib\site-packages\perso
? What are the best practice for using user-modules in all Python scripts of the same computer?
__init__.py
to use perso as package