Use Python .NET with existing Python installation
Dear Sir, according to the Readme.txt ---------------------------------------------------------------------------- **Can I use it with my existing Python installation?** Yes, at least on win32 systems. Just copy the files Python.Runtime.dll and CLR.dll from the PythonNet directory to the root directory of your python installation. ---------------------------------------------------------------------------- I follow the instaructio to copy the DLLs to my Python 2.3.3 installation directory. But cannot import CLR. ------------------------------------------------------------------------------------------------------ C:\Python23>python Python 2.3.3 (#51, Dec 18 2003, 20:22:39) [MSC v.1200 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information.
from CLR.System import String Traceback (most recent call last): File "<stdin>", line 1, in ? ImportError: No module named System
What did I miss?
Cheng, This is usually due to a loading delay for the CLR (there are other posts previously that discuss this). The simple solution is to just try to import it again, and if Python can see the DLLs, the import will work (see output below). On my system I have Python.Runtime.dll and Python.Runtime.key in my Python root directory, and CLR.dll in my DLLs directory. Alternatively, you could just copy the Python.exe from the PythonNet distribution into your root directory, and this will solve the problem. See the second listing below where I have called this 'Python-CLR.exe'. Hope this helps, --Thane C:\Documents and Settings\thane.TIGER>python Python 2.3.3 (#51, Dec 18 2003, 20:22:39) [MSC v.1200 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information.
from CLR.System import String getattr: proxy getattr: dict getattr: __path__ Traceback (most recent call last): File "<stdin>", line 1, in ? ImportError: No module named System from CLR.System import String String
^Z
C:\Documents and Settings\thane.TIGER>python-CLR Python 2.3.3 (#51, Dec 18 2003, 20:22:39) [MSC v.1200 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information.
from CLR.System import String String
-----Original Message----- From: pythondotnet-bounces@python.org [mailto:pythondotnet- bounces@python.org] On Behalf Of 007 cheng Sent: Thursday, October 07, 2004 6:41 AM To: pythondotnet@python.org Subject: [Python.NET] Use Python .NET with existing Python installation
Dear Sir,
according to the Readme.txt -------------------------------------------------------------------------- -- **Can I use it with my existing Python installation?**
Yes, at least on win32 systems. Just copy the files Python.Runtime.dll and CLR.dll from the PythonNet directory to the root directory of your python installation. -------------------------------------------------------------------------- -- I follow the instaructio to copy the DLLs to my Python 2.3.3 installation directory. But cannot import CLR. -------------------------------------------------------------------------- ---------------------------- C:\Python23>python Python 2.3.3 (#51, Dec 18 2003, 20:22:39) [MSC v.1200 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information.
from CLR.System import String Traceback (most recent call last): File "<stdin>", line 1, in ? ImportError: No module named System
----------------------------
What did I miss? _________________________________________________ Python.NET mailing list - PythonDotNet@python.org http://mail.python.org/mailman/listinfo/pythondotnet
participants (2)
-
007 cheng
-
Thane