Question

I want to add a new class to PICOS, a python module. I installed it the normal way a long time ago. But now I have downloaded the source and I a am trying to make some changes.

The problem is that I cannot manage to ask python to load the module from the development folder and not the normal folder.

reload(picos.constraint)

Out[22]: <module 'picos.constraint' from '/home/optimi/bzffourn/python/lib/python2.7/site-packages/picos/constraint.pyc'>

while the source code are here:

/home/optimi/bzffourn/ZIB/python_scripts/pyMathProg/picos

So the changes I make are not considered.

Was it helpful?

Solution

This should help you do it: Override Python import order. Just change your import to this:

import sys
sys.path.insert(0,"/home/optimi/bzffourn/ZIB/python_scripts/pyMathProg/picos")
import picos.constraint
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top