Hello,<div><br></div><div>I've narrowed the problem down. It seems the error comes somehow from the loading of msvcrt90.dll</div><div><br></div><div>Which occurs around line 605 in console.py of pyreadline:</div><div><br>
</div><div><div>if sys.version_info[:2] < (2, 6):</div><div> msvcrt = cdll.msvcrt</div><div>else:</div><div> msvcrt = cdll.LoadLibrary(ctypes.util.find_msvcrt())</div></div><div><br></div><div>I think the problem may be related to the version of Visual Studio I am using to build python.NET. For the test case, I used VS2008Express. However, in production, I have to use VS2012 and target the .NET 4 assemblies.</div>
<div><br></div><div>I haven't confirmed this yet, but it seems a likely case. If it is the problem, does anyone have suggestions for a solution?</div><div><br></div><div>Thank you,</div><div>john</div><div><br></div><div>
<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Nov 6, 2012 at 11:22 AM, John Burkhart <span dir="ltr"><<a href="mailto:jfburkhart.reg@gmail.com" target="_blank">jfburkhart.reg@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<div><br></div><div>I'm trying to use IPython with pythonnet.</div><div><br></div><div>I have the following .bat script:</div>
<div><br></div><div><div>@echo off</div><div>set path="C:\pythonnet\";%path%</div>
<div>set PYTHONPATH="C:\Python27\Lib;C:\Python27\Lib\site-packages;C:\pythonnet\";%pythonpath%</div><div>python.exe -c "import sys; from IPython.frontend.terminal.ipapp import launch_new_instance; sys.exit(launch_new_instance())" %*</div>
<div>exit /B %ERRORLEVEL%</div></div><div><br></div><div>This worked previously on a VM machine running Windows 7, but now I've installed it on my actual laptop running Windows 7 and I get the traceback pasted below.</div>
<div><br></div><div>What module is it looking for that cannot be found? By the way, IPython runs fine when used normally (e.g. without pythonnet python.exe)</div><div><br></div><div>Thank you,</div><div>john</div><div><br>
</div><div><div><br></div><div><div>Windows PowerShell</div><div>Copyright (C) 2009 Microsoft Corporation. All rights reserved.</div><div><br></div><div>PS C:\Users\u35888> .\ipythonnet.bat<br></div><div>Traceback (most recent call last):</div>
<div> File "<string>", line 1, in <module></div><div> File "C:\Python27\Lib\site-packages\IPython\frontend\terminal\ipapp.py", line 388, in launch_new_instance</div><div> app.initialize()</div>
<div> File "<string>", line 2, in initialize</div><div> File "C:\Python27\Lib\site-packages\IPython\config\application.py", line 84, in catch_config_error</div><div> return method(app, *args, **kwargs)</div>
<div> File "C:\Python27\Lib\site-packages\IPython\frontend\terminal\ipapp.py", line 324, in initialize</div><div> self.init_shell()</div><div> File "C:\Python27\Lib\site-packages\IPython\frontend\terminal\ipapp.py", line 340, in init_shell</div>
<div> ipython_dir=self.ipython_dir)</div><div> File "C:\Python27\Lib\site-packages\IPython\config\configurable.py", line 318, in instance</div><div> inst = cls(*args, **kwargs)</div><div> File "C:\Python27\Lib\site-packages\IPython\frontend\terminal\interactiveshell.py", line 360, in __init__</div>
<div> user_module=user_module, custom_exceptions=custom_exceptions</div><div> File "C:\Python27\Lib\site-packages\IPython\core\interactiveshell.py", line 454, in __init__</div><div> self.init_readline()</div>
<div> File "C:\Python27\Lib\site-packages\IPython\core\interactiveshell.py", line 1779, in init_readline</div><div> import IPython.utils.rlineimpl as readline</div><div> File "C:\Python27\Lib\site-packages\IPython\utils\rlineimpl.py", line 33, in <module></div>
<div> from readline import *</div><div> File "C:\Python27\Lib\site-packages\readline.py", line 5, in <module></div><div> from pyreadline.rlmain import Readline</div><div> File "C:\Python27\Lib\site-packages\pyreadline\__init__.py", line 9, in <module></div>
<div> import unicode_helper, logger, clipboard, lineeditor, modes, console</div><div> File "C:\Python27\Lib\site-packages\pyreadline\console\__init__.py", line 14, in <module></div><div> from console import *</div>
<div> File "C:\Python27\Lib\site-packages\pyreadline\console\console.py", line 605, in <module></div><div> msvcrt = cdll.LoadLibrary(ctypes.util.find_msvcrt())</div><div> File "C:\Python27\Lib\ctypes\__init__.py", line 443, in LoadLibrary</div>
<div> return self._dlltype(name)</div><div> File "C:\Python27\Lib\ctypes\__init__.py", line 365, in __init__</div><div> self._handle = _dlopen(self._name, mode)</div><div>WindowsError: [Error 126] The specified module could not be found</div>
<div><br></div><div>If you suspect this is an IPython bug, please report it at:</div><div> <a href="https://github.com/ipython/ipython/issues" target="_blank">https://github.com/ipython/ipython/issues</a></div><div>or send an email to the mailing list at <a href="mailto:ipython-dev@scipy.org" target="_blank">ipython-dev@scipy.org</a></div>
<div><br></div><div>You can print a more detailed traceback right now with "%tb", or use "%debug"</div><div>to interactively debug it.</div><div><br></div><div>Extra-detailed tracebacks for bug-reporting purposes can be enabled via:</div>
<div> c.Application.verbose_crash=True</div><div><br></div></div></div>
</blockquote></div><br></div>