from __future__ import print_function
import os, site

myPackagePath = os.path.join( os.path.dirname(os.path.abspath(__file__)), "packages")

pathspec = r"""
# Generated by GST's installer (install_GST.py)
# In the lines below, list the paths where Python should look for
# GateSetTomography-supplied modules, one directory per line.
#
# If a directory does not exist when Python is started, it will be ignored.
%s
""" % myPackagePath

print("Adding path:",myPackagePath)

usp = site.getusersitepackages()
if not os.path.exists(usp):
    os.makedirs(usp)
uspfile = os.path.join(usp, 'GST.pth')
open(uspfile, 'w').write(pathspec)
print('Wrote to ' + uspfile)

print("GST package installed successfully!")
