Mots clés : pythonimporterrorpython-importpython
96
# some_file.py import sys # insert at 1, 0 is the script path (or '' in REPL) sys.path.insert(1, '/path/to/application/app/folder') import file
88
from application.app.folder.file import func_name
73
application/app2/some_folder/some_file.py application/app2/another_folder/another_file.py
import sys sys.path.append('../')
65
import sys
sys.path.insert(0, '/the/folder/path/name-package/')
from name-package import name-module
55
# Linux & OSX export PYTHONPATH=$HOME/dirWithScripts/:$PYTHONPATH # Windows set PYTHONPATH=C:\path\to\dirWithScripts\;%PYTHONPATH%