Raspberry Pi ILI9341 Library

From ProjectPages
Jump to: navigation, search

UNDER CONSTRUCTION

Instead of manipulating PYTHONPATH you can also create a path configuration file. First find out in which directory Python searches for this information:

python -m site --user-site

If for some reason this doesn't seem to work in Python 2.7. There you can use:

python -c 'import site; site._script()' --user-site

Then create a .pth file in that directory containing the path you want to add (create the directory if it doesn't exist).

For example:

# find directory
SITEDIR=$(python -m site --user-site)

# create if it doesn't exist
mkdir -p "$SITEDIR"

# create new .pth file with our path
echo "/home/pi/python/lib" > "$SITEDIR/ili9341.pth"
python -m site
sys.path = [
    '/home/pi',
    '/usr/local/lib/python2.7/dist-packages/Adafruit_ILI9341-1.5.0-py2.7.egg',
    '/usr/local/lib/python2.7/dist-packages/Adafruit_GPIO-1.0.0-py2.7.egg',
    '/usr/local/lib/python2.7/dist-packages/Adafruit_PureIO-0.2.0-py2.7.egg',
    '/usr/lib/python2.7/dist-packages',
    '/usr/local/lib/python2.7/dist-packages/RPIO-0.10.0-py2.7-linux-armv6l.egg',
    '/usr/lib/python2.7',
    '/usr/lib/python2.7/plat-arm-linux-gnueabihf',
    '/usr/lib/python2.7/lib-tk',
    '/usr/lib/python2.7/lib-old',
    '/usr/lib/python2.7/lib-dynload',
    '/home/pi/.local/lib/python2.7/site-packages',
    '/home/pi/python/lib',
    '/usr/local/lib/python2.7/dist-packages',
    '/usr/lib/python2.7/dist-packages/PILcompat',
    '/usr/lib/python2.7/dist-packages/gtk-2.0',
    '/usr/lib/pymodules/python2.7',
]
USER_BASE: '/home/pi/.local' (exists)
USER_SITE: '/home/pi/.local/lib/python2.7/site-packages' (exists)
ENABLE_USER_SITE: True