[IPython-User] pythonnet and IPython

John Burkhart jfburkhart.reg@gmail....
Tue Nov 6 06:58:40 CST 2012


Hello,

I've narrowed the problem down. It seems the error comes somehow from the
loading of msvcrt90.dll

Which occurs around line 605 in console.py of pyreadline:

if sys.version_info[:2] < (2, 6):
    msvcrt = cdll.msvcrt
else:
    msvcrt = cdll.LoadLibrary(ctypes.util.find_msvcrt())

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.

I haven't confirmed this yet, but it seems a likely case. If it is the
problem, does anyone have suggestions for a solution?

Thank you,
john




On Tue, Nov 6, 2012 at 11:22 AM, John Burkhart <jfburkhart.reg@gmail.com>wrote:

> Hello,
>
> I'm trying to use IPython with pythonnet.
>
> I have the following .bat script:
>
> @echo off
> set path="C:\pythonnet\";%path%
> set
> PYTHONPATH="C:\Python27\Lib;C:\Python27\Lib\site-packages;C:\pythonnet\";%pythonpath%
> python.exe -c "import sys; from IPython.frontend.terminal.ipapp import
> launch_new_instance; sys.exit(launch_new_instance())" %*
> exit /B %ERRORLEVEL%
>
> 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.
>
> 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)
>
> Thank you,
> john
>
>
> Windows PowerShell
> Copyright (C) 2009 Microsoft Corporation. All rights reserved.
>
> PS C:\Users\u35888> .\ipythonnet.bat
> Traceback (most recent call last):
>   File "<string>", line 1, in <module>
>   File "C:\Python27\Lib\site-packages\IPython\frontend\terminal\ipapp.py",
> line 388, in launch_new_instance
>     app.initialize()
>   File "<string>", line 2, in initialize
>   File "C:\Python27\Lib\site-packages\IPython\config\application.py", line
> 84, in catch_config_error
>     return method(app, *args, **kwargs)
>   File "C:\Python27\Lib\site-packages\IPython\frontend\terminal\ipapp.py",
> line 324, in initialize
>     self.init_shell()
>   File "C:\Python27\Lib\site-packages\IPython\frontend\terminal\ipapp.py",
> line 340, in init_shell
>     ipython_dir=self.ipython_dir)
>   File "C:\Python27\Lib\site-packages\IPython\config\configurable.py",
> line 318, in instance
>     inst = cls(*args, **kwargs)
>   File
> "C:\Python27\Lib\site-packages\IPython\frontend\terminal\interactiveshell.py",
> line 360, in __init__
>     user_module=user_module, custom_exceptions=custom_exceptions
>   File "C:\Python27\Lib\site-packages\IPython\core\interactiveshell.py",
> line 454, in __init__
>     self.init_readline()
>   File "C:\Python27\Lib\site-packages\IPython\core\interactiveshell.py",
> line 1779, in init_readline
>     import IPython.utils.rlineimpl as readline
>   File "C:\Python27\Lib\site-packages\IPython\utils\rlineimpl.py", line
> 33, in <module>
>     from readline import *
>   File "C:\Python27\Lib\site-packages\readline.py", line 5, in <module>
>     from pyreadline.rlmain import Readline
>   File "C:\Python27\Lib\site-packages\pyreadline\__init__.py", line 9, in
> <module>
>     import unicode_helper, logger, clipboard, lineeditor, modes, console
>   File "C:\Python27\Lib\site-packages\pyreadline\console\__init__.py",
> line 14, in <module>
>     from console import *
>   File "C:\Python27\Lib\site-packages\pyreadline\console\console.py", line
> 605, in <module>
>     msvcrt = cdll.LoadLibrary(ctypes.util.find_msvcrt())
>   File "C:\Python27\Lib\ctypes\__init__.py", line 443, in LoadLibrary
>     return self._dlltype(name)
>   File "C:\Python27\Lib\ctypes\__init__.py", line 365, in __init__
>     self._handle = _dlopen(self._name, mode)
> WindowsError: [Error 126] The specified module could not be found
>
> If you suspect this is an IPython bug, please report it at:
>     https://github.com/ipython/ipython/issues
> or send an email to the mailing list at ipython-dev@scipy.org
>
> You can print a more detailed traceback right now with "%tb", or use
> "%debug"
> to interactively debug it.
>
> Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
>     c.Application.verbose_crash=True
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20121106/e1a957a5/attachment.html 


More information about the IPython-User mailing list