[IronPython] Visual Studio Interactive Shell Search Path:

Dino Viehland dinov at microsoft.com
Fri Jan 28 18:52:34 CET 2011


Federico wrote:
> Opening visual studio with no project open, and running the Ironpython
> interactive window, gives me this:
> 
> > import sys
> > sys.path
> ['.', 'C:\\PROGRAM FILES (X86)\\MICROSOFT VISUAL STUDIO
> 10.0\\COMMON7\\IDE\\EXTENSIONS\\MICROSOFT\\IRONSTUDIO\\0.4\\Lib',
> 'C:\\PROGRAM FILES (X86)\\MICROSOFT VISUAL STUDIO
> 10.0\\COMMON7\\IDE\\EXTENSIONS\\MICROSOFT\\IRONSTUDIO\\0.4\\DLLs']
> >
> 
> Making a dummy project, then running it via the debug command in interactive
> mode, gives me this:
> 
> Running c:\users\fedev\documents\visual studio
> 2010\Projects\ConsoleApplication1\ConsoleApplication1\Program.py
> Remote process has been reset...
> ['.', 'C:\\PROGRAM FILES (X86)\\MICROSOFT VISUAL STUDIO
> 10.0\\COMMON7\\IDE\\EXTENSIONS\\MICROSOFT\\IRONSTUDIO\\0.4\\Lib',
> 'C:\\PROGRAM FILES (X86)\\MICROSOFT VISUAL STUDIO
> 10.0\\COMMON7\\IDE\\EXTENSIONS\\MICROSOFT\\IRONSTUDIO\\0.4\\DLLs']
> >
> 
> It doesn't appear that having a project open fixes it.  Where does the
> interactive window pick up its path from anyway?  Or is it hardcoded?

Ahh, I guess we're just setting the current working directory so that you can import
things but we still don't include the standard lib in the path.  So the "." part is reasonable
now but we're picking up Lib/DLLs from where we have our RemoteScriptFactory
class.

We probably need to figure out where ipy.exe is installed and call SetSearchPaths
on the remote script engine in RemotePythonVsEvaluator.Initialize.  

PythonRuntimeHost.GetPythonInstallDir() already has the code for finding IronPython
so it should be pretty easy to fix if anyone wants to give it a try.






More information about the Ironpython-users mailing list