From milankie at gmail.com Tue Aug 20 22:05:56 2013 From: milankie at gmail.com (Catherine Holloway) Date: Tue, 20 Aug 2013 16:05:56 -0400 Subject: [Python.NET] ImportError: dynamic module does not define init function (PyInit_CLR) Message-ID: When I try to do: import CLR I get the following error: ImportError: dynamic module does not define init function (PyInit_CLR) any ideas? I downloaded what I thought was the windows installer from sourceforge, but running nPython.exe just crashes (it gives something about not being able to find python27). I have python33. Does that mean that python for .net is not compatible with python 3.3.? -- /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ Catherine Holloway Institute for Quantum Computing Lab Phone: 519-888-4567 ext. 32107 Office Phone: 519-888-4567 ext. 39038 Cell Phone: 519-998-1264 -------------- next part -------------- An HTML attachment was scrubbed... URL: From btribble at ea.com Wed Aug 21 02:45:03 2013 From: btribble at ea.com (Tribble, Brett) Date: Tue, 20 Aug 2013 17:45:03 -0700 Subject: [Python.NET] ImportError: dynamic module does not define init function (PyInit_CLR) In-Reply-To: References: Message-ID: Python for .NET is in a superpositional state in which it is both working and not working. You just collapsed its wave function prematurely. Also you didn't which is why we're also not having this conversation. Addressing the question not clearly at hand, support for Python 3.x is pretty green still. You might try grabbing Tony Robert's build that has tentative support: On 5 Jul 2013 07:01, "Tony Roberts" > wrote: Yes, I made some changes to get it working in Python 3 a while ago. The code's on github: https://github.com/tonyroberts/pythonnet. I've tested it with 3.3 x64 and it works ok for me (although I've only really used the 3.2 x64 build extensively). regards, Tony From: PythonDotNet [mailto:pythondotnet-bounces+btribble=ea.com at python.org] On Behalf Of Catherine Holloway Sent: Tuesday, August 20, 2013 1:06 PM To: pythondotnet at python.org Subject: [Python.NET] ImportError: dynamic module does not define init function (PyInit_CLR) When I try to do: import CLR I get the following error: ImportError: dynamic module does not define init function (PyInit_CLR) any ideas? I downloaded what I thought was the windows installer from sourceforge, but running nPython.exe just crashes (it gives something about not being able to find python27). I have python33. Does that mean that python for .net is not compatible with python 3.3.? -- /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ Catherine Holloway Institute for Quantum Computing Lab Phone: 519-888-4567 ext. 32107 Office Phone: 519-888-4567 ext. 39038 Cell Phone: 519-998-1264 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfburkhart.reg at gmail.com Fri Aug 23 12:51:14 2013 From: jfburkhart.reg at gmail.com (John Burkhart) Date: Fri, 23 Aug 2013 12:51:14 +0200 Subject: [Python.NET] importing eggs. does pythonnet not use respect the easy-install.pth file? Message-ID: Hello, I have a pythonnet installation that works fine for the most part. However, whenever I try to import a module that was built with easy_install, I have to explicitly add the full egg path to the sys.path variable. Does pythonnet not respect the easy-install.pth file? [code] >>> import south Traceback (most recent call last): File "", line 1, in ImportError: No module named south >>> import sys >>> sys.path.append(r'C:\Python27\lib\site-packages\south-0.8.2-py2.7.egg') >>> import south >>> >>> import openpyxl Traceback (most recent call last): File "", line 1, in ImportError: No module named openpyxl >>> sys.path.append(r'C:\Python27\lib\site-packages\openpyxl-1.6.1-py2.7.egg') >>> import openpyxl >>> [/code] My easy-install.pth file contains: [code] import sys; sys.__plen = len(sys.path) ./python_distutils_extra-2.37-py2.7.egg ./openpyxl-1.6.1-py2.7.egg ./south-0.8.2-py2.7.egg import sys; new=sys.path[sys.__plen:]; del sys.path[sys.__plen:]; p=getattr(sys,'__egginsert',0); sys.path[p:p]=new; sys.__egginsert = p+len(new) [/code] -------------- next part -------------- An HTML attachment was scrubbed... URL: From jfburkhart.reg at gmail.com Fri Aug 23 13:09:02 2013 From: jfburkhart.reg at gmail.com (John Burkhart) Date: Fri, 23 Aug 2013 13:09:02 +0200 Subject: [Python.NET] importing eggs. does pythonnet not use respect the easy-install.pth file? In-Reply-To: References: Message-ID: This is my current work-around ## Seems to be a required hack for pythonnet if 'pythonnet' in sys.executable: try: import site site.addsitedir(r'C:\Python27\lib\site-packages') except: print sys.path On Fri, Aug 23, 2013 at 12:51 PM, John Burkhart wrote: > Hello, > > I have a pythonnet installation that works fine for the most part. > However, whenever I try to import a module that was built with > easy_install, I have to explicitly add the full egg path to the sys.path > variable. Does pythonnet not respect the easy-install.pth file? > > [code] > >>> import south > Traceback (most recent call last): > File "", line 1, in > ImportError: No module named south > >>> import sys > >>> sys.path.append(r'C:\Python27\lib\site-packages\south-0.8.2-py2.7.egg') > >>> import south > >>> > >>> import openpyxl > Traceback (most recent call last): > File "", line 1, in > ImportError: No module named openpyxl > >>> > sys.path.append(r'C:\Python27\lib\site-packages\openpyxl-1.6.1-py2.7.egg') > >>> import openpyxl > >>> > [/code] > > > My easy-install.pth file contains: > > [code] > import sys; sys.__plen = len(sys.path) > ./python_distutils_extra-2.37-py2.7.egg > ./openpyxl-1.6.1-py2.7.egg > ./south-0.8.2-py2.7.egg > import sys; new=sys.path[sys.__plen:]; del sys.path[sys.__plen:]; > p=getattr(sys,'__egginsert',0); sys.path[p:p]=new; sys.__egginsert = > p+len(new) > [/code] > -------------- next part -------------- An HTML attachment was scrubbed... URL: