<div dir="ltr">...yet when I run npython.exe it works fine:<div><br></div><div><div>C:\>c:\app\python\anaconda\1.6.0\lib\site-packages\pythonnet\npython</div><div>Python 2.7.5 |Anaconda 1.6.0 (64-bit)| (default, May 31 2013, 10:45:37) [MSC v.1</div>
<div>500 64 bit (AMD64)] on win32</div><div>Type "help", "copyright", "credits" or "license" for more information.</div><div>>>> import System</div></div><div>>>></div>
<div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jul 22, 2013 at 4:53 PM, Jason Sachs <span dir="ltr"><<a href="mailto:jmsachs@gmail.com" target="_blank">jmsachs@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I'm still missing this. Here's what I tried (never mind Eclipse+pydev for the moment, I'm just trying to run a python.exe to get what I want)<div>
<br></div><div>- I created a "pythonnet" directory under site-packages</div>
<div>- I created a "pythonnet.pth" file that contains "pythonnet"</div><div>- I added the 5 files from pythonnet into the "pythonnet" directory under site-packages</div><div><br></div><div>and if I run python here's what I get: it shows up in sys.path but I can't import System and if I import clr it gives me an error.<br>
</div><div><div><br></div><div><div>C:\>apython</div><div>Python 2.7.5 |Anaconda 1.6.0 (64-bit)| (default, May 31 2013, 10:45:37) [MSC v.1</div><div>500 64 bit (AMD64)] on win32</div><div>Type "help", "copyright", "credits" or "license" for more information.</div>
<div>>>> import sys</div><div>>>> sys.path</div><div>['', 'c:\\app\\python\\anaconda\\1.6.0\\Lib', 'c:\\app\\python\\anaconda\\1.6.0\</div><div>\python27.zip', 'c:\\app\\python\\anaconda\\1.6.0\\DLLs', 'c:\\app\\python\\anac</div>
<div>onda\\1.6.0\\lib\\plat-win', 'c:\\app\\python\\anaconda\\1.6.0\\lib\\lib-tk', 'c</div><div>:\\app\\python\\anaconda\\1.6.0', 'c:\\app\\python\\anaconda\\1.6.0\\lib\\site-p</div><div>ackages', 'c:\\app\\python\\anaconda\\1.6.0\\lib\\site-packages\\PIL', 'c:\\app\</div>
<div>\python\\anaconda\\1.6.0\\lib\\site-packages\\pythonnet', 'c:\\app\\python\\anac</div><div>onda\\1.6.0\\lib\\site-packages\\win32', 'c:\\app\\python\\anaconda\\1.6.0\\lib\</div><div>\site-packages\\win32\\lib', 'c:\\app\\python\\anaconda\\1.6.0\\lib\\site-packag</div>
<div>es\\Pythonwin', 'c:\\app\\python\\anaconda\\1.6.0\\lib\\site-packages\\setuptool</div><div>s-0.6c11-py2.7.egg-info']</div><div>>>> import System</div><div>Traceback (most recent call last):</div>
<div> File "<stdin>", line 1, in <module></div><div>ImportError: No module named System</div></div></div><div><div>>>> import clr</div><div>Traceback (most recent call last):</div><div> File "<stdin>", line 1, in <module></div>
<div>ImportError: DLL load failed: %1 is not a valid Win32 application.</div></div><div><br></div><div><div>C:\>dir c:\app\python\anaconda\1.6.0\lib\site-packages\pythonnet\</div><div> Volume in drive C is Local Disk</div>
<div> Volume Serial Number is 8242-AA56</div><div><br></div><div> Directory of c:\app\python\anaconda\1.6.0\lib\site-packages\pythonnet</div><div><br></div><div>07/22/2013 04:43 PM <DIR> .</div><div>07/22/2013 04:43 PM <DIR> ..</div>
<div>12/29/2012 04:28 PM 3,584 clr.pyd</div><div>12/29/2012 04:27 PM 275,968 nPython.exe</div><div>12/29/2012 04:27 PM 13,824 nPython.pdb</div><div>12/29/2012 04:15 PM 375,296 Python.Runtime.dll</div>
<div>12/29/2012 04:15 PM 411,136 Python.Runtime.pdb</div><div> 5 File(s) 1,079,808 bytes</div><div> 2 Dir(s) 339,216,891,904 bytes free</div></div></div><div class="HOEnZb"><div class="h5">
<div class="gmail_extra">
<br><br><div class="gmail_quote">On Mon, Jul 22, 2013 at 3:05 PM, Bradley Friedman <span dir="ltr"><<a href="mailto:brad@fie.us" target="_blank">brad@fie.us</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word"><div>You may be able to drop the binaries into those locations. Note I said build/acquire. In that case you'd acquire.</div><div><br></div><div>Deployment is another matter.</div><div>
<br></div><div>When it comes to PyDev, you'll want to make sure it's using the PYTHONPATH and site-packages locations you think it is. Further, you should probably figure out if "import clr" works. And from there, work on importing .net namespaces. If sometime fails, we'll need specific console output or stack traces to be of any use here I'd think.</div>
<div><br></div><div>-brad</div><div><div><br><div><div>On Jul 22, 2013, at 5:50 PM, Jason Sachs <<a href="mailto:jmsachs@gmail.com" target="_blank">jmsachs@gmail.com</a>> wrote:</div><br><blockquote type="cite">
<div dir="ltr"><span style="font-family:arial,sans-serif;font-size:13.333333969116211px">>To make PythonNet install formally inside an existing CPython, you are looking to build/acquire it as a module and install that module in your PYTHONPATH or in your site-packages for that CPython. </span><div>
<span style="font-family:arial,sans-serif;font-size:13.333333969116211px">>There are a number of ways to do this. depending on what you are downloading or building and where you are deploying.</span><br></div><div><span style="font-family:arial,sans-serif;font-size:13.333333969116211px"><br>
</span></div><div><span style="font-family:arial,sans-serif;font-size:13.333333969116211px">So I can't just take the pythonnet binaries and put them on PYTHONPATH or in site-packages? I have to build it from source as a module? Either PYTHONPATH or site-packages will work for me; at this point I just want to make it work somehow. I tried with PyDev and can't seem to get it to recognize that System is a valid import.</span></div>
<div><span style="font-family:arial,sans-serif;font-size:13.333333969116211px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13.333333969116211px">This is for an in-house tool that I need to make as easy as possible to install and use, I just need to write up the install procedure. It uses a data acquisition system which has .NET libraries but nothing for "pure" Python.</span></div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jul 22, 2013 at 1:43 PM, Bradley Friedman <span dir="ltr"><<a href="mailto:brad@fie.us" target="_blank">brad@fie.us</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
To make PythonNet install formally inside an existing CPython, you are looking to build/acquire it as a module and install that module in your PYTHONPATH or in your site-packages for that CPython. There are a number of ways to do this. depending on what you are downloading or building and where you are deploying.<br>
<br>
You will likely need to better define your ultimate deployment requirements/needs to figure out how you'd want to approach that issue.<br>
<br>
-brad<br>
<div><div><br>
On Jul 22, 2013, at 2:55 PM, Jason Sachs <<a href="mailto:jmsachs@gmail.com" target="_blank">jmsachs@gmail.com</a>> wrote:<br>
<br>
> Hi there--<br>
><br>
> I've used Python a lot but am new to pythondotnet. I got it running on Windows 7 with no problem, by unzipping the download file, making sure PYTHONPATH and PYTHONHOME were setup properly, and running npython.exe.<br>
><br>
> How do you get it to run in a debugger? (either PyDev on Eclipse, or Microsoft PTVS)<br>
><br>
> Also, is there a way to install it "permanently" in an existing Python installation so that it will pickup the pythondotnet bridge when you run the regular "python.exe"?<br>
><br>
> --Jason<br>
</div></div>> _________________________________________________<br>
> <a href="http://Python.NET" target="_blank">Python.NET</a> mailing list - <a href="mailto:PythonDotNet@python.org" target="_blank">PythonDotNet@python.org</a><br>
> <a href="http://mail.python.org/mailman/listinfo/pythondotnet" target="_blank">http://mail.python.org/mailman/listinfo/pythondotnet</a><br>
<br>
</blockquote></div><br></div>
</blockquote></div><br></div></div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>