python modifying sys.path doesn't work
问题 I have a new numpy version under /opt/lib/python2.7/site-packages , and a standard (system) version under /usr/lib/python2.7/dist-packages . I want to temporarily use the new numpy version so I add the following at the beginning of my script: In [1]: import sys In [2]: sys.path.insert(1,'/opt/numpy/lib/python2.7/site-packages') In [3]: sys.path Out[3]: ['', '/opt/numpy/lib/python2.7/site-packages', '/usr/local/bin', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7', '/usr/lib/python2.7