From: Tim B. <ti...@tb...> - 2005-10-20 05:42:04
|
Hi all, First thanks to all those who have been helping out - it is really appreciated. I have cross posted to the numarray, py2exe and matplotlib lists I have attempted to use numarray from cvs but I can't build it - no VC7 clang - did a penny drop anywhere? I am working with python 2.4.1 and numarray 1.3.3 for 2.4 (obviously) Since I couldnt build numarray - I looked at the new import code in the cvs init module and ripped it off and stuffed it into my numarray installation and then when that didnt work - I jammed it right up front of my application. It looks like this def main(): import numarray.numarrayall from numarray.numinclude import version as __version__ # stolen from next numarray version in cvs TjB import numarray._conv import numarray._sort import numarray._bytes import numarray._ufunc import numarray._ufuncBool import numarray._ufuncInt8 import numarray._ufuncUInt8 import numarray._ufuncInt16 import numarray._ufuncUInt16 import numarray._ufuncInt32 import numarray._ufuncUInt32 import numarray._ufuncFloat32 import numarray._ufuncFloat64 import numarray._ufuncComplex32 import numarray._ufuncComplex64 import numarray._ndarray import numarray._numarray import numarray._chararray import numarray._objectarray import numarray.memory import numarray._converter import numarray._operator import numarray._numerictype import numarray.libnumarray import numarray.libnumeric import numarray._ufuncInt64 import numarray._ufuncUInt64 print numarray.__version__ application = BoaApp(0) Still no go - but a changed error message.... grrr I get Traceback (most recent call last): File "AEMdaApp.py", line 81, in ? File "AEMdaApp.py", line 41, in main File "numarray\__init__.pyc", line 42, in ? File "numarray\numarrayall.pyc", line 1, in ? File "numarray\numerictypes.pyc", line 35, in ? File "numarray\numinclude.pyc", line 4, in ? File "numarray\_ndarray.pyc", line 9, in ? File "numarray\_ndarray.pyc", line 7, in __load ImportError: init_ndarray: can't find memory.new_memory ok I confess my bottom lip trembled.... then - probably because I was reading the numarray manual this morning - I went to my numarray install and decided to run testall.py I got F:\Python24\Lib\site-packages\numarray>\python24\python testall.py Testing numarray 1.3.3 on normal Python (2, 4, 1, 'final', 0) on platform win32 ********************************************************************** File "F:\python24\lib\site-packages\numarray\numtest.py", line 2843, in cache p ss Failed example: cPickle.loads(cPickle.dumps(arange(5)+1j)) Exception raised: Traceback (most recent call last): File "F:\Python24\lib\doctest.py", line 1243, in __run compileflags, 1) in test.globs File "<doctest cache pass[968]>", line 1, in ? PicklingError: Can't pickle <built-in function memory_from_string>: it's no the same object as memory.memory_from_string ********************************************************************** File "F:\python24\lib\site-packages\numarray\numtest.py", line 2849, in cache p ss Failed example: p = p.dump(a) Exception raised: Traceback (most recent call last): File "F:\Python24\lib\doctest.py", line 1243, in __run compileflags, 1) in test.globs File "<doctest cache pass[973]>", line 1, in ? PicklingError: Can't pickle <built-in function memory_from_string>: it's no the same object as memory.memory_from_string ********************************************************************** File "F:\python24\lib\site-packages\numarray\numtest.py", line 2850, in cache p ss Failed example: p = p.dump(b) Exception raised: and so on for quite some time. Hmm the message about memory.memory_from_string and my applications ImportError: init_ndarray: can't find memory.new_memory are these a little related? Am I clutching at straws? Yet my app runs fine under any ide I wish to use. WAIT! - my install of numarray is broken.... I deleted it and reinstalled - still broken I installed on my laptop and tested - broken there too My legacy python 2.3 and numarray 1.3.3 installation passes all the tests just fine. Is there a problem with python2.4.1 and numarray 1.3.3? Could some kind soul build me a numarray windows installer for python 2.4 from cvs - please - so that I can see if that works better with py2exe. I need a stiff drink -- Tim Burgess IT Consultant RedHat Certified Engineer TBITC Pty Ltd Professional Computer Support for Business ti...@tb... Mobile 0422 942 972 Office 85 662 016 http://www.tbitc.com |
From: Chris B. <Chr...@no...> - 2005-10-20 07:02:56
|
Tim, Sorry I can't help much, but: > I have attempted to use numarray from cvs but I can't build it - no VC7 You can build Python extensions with MinGW. You have to do a little patching to Python, but it's not too hard, and it does work. Here's one link. Googling will get you others: http://www.mingw.org/MinGWiki/index.php/Python extensions -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no... |
From: Yaroslav S. <ya...@an...> - 2005-10-20 07:54:54
|
On 20 Okt 2005, at 10:02, Chris Barker wrote: > >> I have attempted to use numarray from cvs but I can't build it - >> no VC7 >> > > You can build Python extensions with MinGW. You have to do a little > patching to Python, but it's not too hard, and it does work. > > Here's one link. Googling will get you others: > > http://www.mingw.org/MinGWiki/index.php/Python extensions You also can use MS VC Toolkit. I'm sure, one of my colegues had posted an instruction somewhere, but I can't find a reference to it. To build extensions using that toolkit you have to: 1. Install toolkit (http://msdn.microsoft.com/visualc/vctoolkit2003/) 2. Install Platform SDK ( http://www.microsoft.com/msdownload/ platformsdk/sdkupdate/downlevel.htm) 3. You have to find somewhere MSVCRT.LIB and put it to %VCTOOLKIT_ROOT %/lib. (for python 2.3 you must put there a library from the 6th visual studio, for 2.4 from the 7.1 -- it must be stored somewhere after installing PSDK) 4. registry (for py23) === cut === REGEDIT4 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DevStudio\6.0\Build System \Components\Platforms\Win32 (x86)\Directories] "Include Dirs"="E:\\usr\\vc7\\psdk\\include;E:\\usr\\vc7\\include" "Library Dirs"="E:\\usr\\vc7\\psdk\\lib;E:\\usr\\vc7\\lib" "Path Dirs"="E:\\usr\\vc7\\bin" === cut === for py24 I can't post registry settings, cuz I'm on my macintosh now. you have to satisfy the next code from distutils (msvccompiler.py): def load_macros(self, version): vsbase = r"Software\Microsoft\VisualStudio\%0.1f" % version self.set_macro("VCInstallDir", vsbase + r"\Setup\VC", "productdir") self.set_macro("VSInstallDir", vsbase + r"\Setup\VS", "productdir") net = r"Software\Microsoft\.NETFramework" self.set_macro("FrameworkDir", net, "installroot") try: if version > 7.0: self.set_macro("FrameworkSDKDir", net, "sdkinstallrootv1.1") else: self.set_macro("FrameworkSDKDir", net, "sdkinstallroot") except KeyError, exc: # raise DistutilsPlatformError, \ ("The .NET Framework SDK needs to be installed before " "building extensions for Python.") and path = path + " dirs" if self.__version >= 7: key = (r"%s\%0.1f\VC\VC_OBJECTS_PLATFORM_INFO\Win32 \Directories" % (self.__root, self.__version)) else: key = (r"%s\6.0\Build System\Components\Platforms" r"\Win32 (%s)\Directories" % (self.__root, platform)) for base in HKEYS: d = read_values(base, key) if d: if self.__version >= 7: return string.split(self.__macros.sub(d[path]), ";") else: return string.split(d[path], ";") ...... if len (self.__paths) == 0: raise DistutilsPlatformError, \ ("Python was built with version %s of Visual Studio, " "and extensions need to be built with the same " "version of the compiler, but it isn't installed." % self.__version) where string values named "Library Dirs", "Include Dirs", "Path Dirs" must be defined and point to the same location as the corresponding strings in the registry settings I had posated in this mail. I someone will be interested in, I can write a small python script, which will create these registry stuff according to the current MSVCToolkit and PSDK installations. -- Best regards, Yaroslav |
From: Michael F. <mi...@pc...> - 2005-10-20 08:08:36
|
Yaroslav Samchuk wrote: > > On 20 Okt 2005, at 10:02, Chris Barker wrote: > >> >>> I have attempted to use numarray from cvs but I can't build it - no VC7 >>> >> I have successfully compiled extensions using the free optimising compiler from Microsoft. This is the same compiler used by VC7. I followed the instructions here : http://www.vrplumber.com/programming/mstoolkit/ It does mean a fair bit of downloading - but once it's done... it just works. All the best, Fuzzyman http://www.voidspace.org.uk/python >> You can build Python extensions with MinGW. You have to do a little >> patching to Python, but it's not too hard, and it does work. >> >> Here's one link. Googling will get you others: >> >> http://www.mingw.org/MinGWiki/index.php/Python extensions > > > You also can use MS VC Toolkit. I'm sure, one of my colegues had posted > an instruction somewhere, but I can't find a reference to it. > > To build extensions using that toolkit you have to: > > 1. Install toolkit (http://msdn.microsoft.com/visualc/vctoolkit2003/) > 2. Install Platform SDK ( http://www.microsoft.com/msdownload/ > platformsdk/sdkupdate/downlevel.htm) > 3. You have to find somewhere MSVCRT.LIB and put it to %VCTOOLKIT_ROOT > %/lib. (for python 2.3 you must put there a library from the 6th visual > studio, for 2.4 from the 7.1 -- it must be stored somewhere after > installing PSDK) > 4. registry (for py23) > > === cut === > REGEDIT4 > > [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DevStudio\6.0\Build System > \Components\Platforms\Win32 (x86)\Directories] > "Include Dirs"="E:\\usr\\vc7\\psdk\\include;E:\\usr\\vc7\\include" > "Library Dirs"="E:\\usr\\vc7\\psdk\\lib;E:\\usr\\vc7\\lib" > "Path Dirs"="E:\\usr\\vc7\\bin" > > === cut === > > for py24 I can't post registry settings, cuz I'm on my macintosh now. > you have to satisfy the next code from distutils (msvccompiler.py): > > def load_macros(self, version): > vsbase = r"Software\Microsoft\VisualStudio\%0.1f" % version > self.set_macro("VCInstallDir", vsbase + r"\Setup\VC", > "productdir") > self.set_macro("VSInstallDir", vsbase + r"\Setup\VS", > "productdir") > net = r"Software\Microsoft\.NETFramework" > self.set_macro("FrameworkDir", net, "installroot") > try: > if version > 7.0: > self.set_macro("FrameworkSDKDir", net, > "sdkinstallrootv1.1") > else: > self.set_macro("FrameworkSDKDir", net, "sdkinstallroot") > except KeyError, exc: # > raise DistutilsPlatformError, \ > ("The .NET Framework SDK needs to be installed before " > "building extensions for Python.") > > > > and > > path = path + " dirs" > if self.__version >= 7: > key = (r"%s\%0.1f\VC\VC_OBJECTS_PLATFORM_INFO\Win32 > \Directories" > % (self.__root, self.__version)) > else: > key = (r"%s\6.0\Build System\Components\Platforms" > r"\Win32 (%s)\Directories" % (self.__root, platform)) > > for base in HKEYS: > d = read_values(base, key) > if d: > if self.__version >= 7: > return string.split(self.__macros.sub(d[path]), ";") > else: > return string.split(d[path], ";") > > ...... > > if len (self.__paths) == 0: > raise DistutilsPlatformError, \ > ("Python was built with version %s of Visual Studio, " > "and extensions need to be built with the same " > "version of the compiler, but it isn't installed." % > self.__version) > > > where string values named "Library Dirs", "Include Dirs", "Path Dirs" > must be defined and point to the same location as the corresponding > strings in the registry settings I had posated in this mail. > > I someone will be interested in, I can write a small python script, > which will create these registry stuff according to the current > MSVCToolkit and PSDK installations. > > -- > Best regards, > Yaroslav > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: > Power Architecture Resource Center: Free content, downloads, discussions, > and more. http://solutions.newsforge.com/ibmarch.tmpl > _______________________________________________ > Py2exe-users mailing list > Py2...@li... > https://lists.sourceforge.net/lists/listinfo/py2exe-users > > > |
From: Todd M. <jm...@st...> - 2005-10-20 16:34:27
|
Tim Burgess wrote: > Hi all, > > First thanks to all those who have been helping out - it is really > appreciated. > > Since I couldnt build numarray - I looked at the new import code in > the cvs init module and ripped it off and stuffed it into my numarray > installation and then when that didnt work - I jammed it right up > front of my application. > > It looks like this > > def main(): > import numarray.numarrayall > from numarray.numinclude import version as __version__ > > # stolen from next numarray version in cvs TjB > > import numarray._conv > import numarray._sort > import numarray._bytes > import numarray._ufunc > import numarray._ufuncBool > import numarray._ufuncInt8 > import numarray._ufuncUInt8 > import numarray._ufuncInt16 > import numarray._ufuncUInt16 > import numarray._ufuncInt32 > import numarray._ufuncUInt32 > import numarray._ufuncFloat32 > import numarray._ufuncFloat64 > import numarray._ufuncComplex32 > import numarray._ufuncComplex64 > import numarray._ndarray > import numarray._numarray > import numarray._chararray > import numarray._objectarray > import numarray.memory > import numarray._converter > import numarray._operator > import numarray._numerictype > import numarray.libnumarray > import numarray.libnumeric > import numarray._ufuncInt64 > import numarray._ufuncUInt64 > > print numarray.__version__ > > application = BoaApp(0) > > Still no go - but a changed error message.... grrr Well, that's progress anyway. > > I get > > Traceback (most recent call last): > File "AEMdaApp.py", line 81, in ? > File "AEMdaApp.py", line 41, in main > File "numarray\__init__.pyc", line 42, in ? > File "numarray\numarrayall.pyc", line 1, in ? > File "numarray\numerictypes.pyc", line 35, in ? > File "numarray\numinclude.pyc", line 4, in ? > File "numarray\_ndarray.pyc", line 9, in ? > File "numarray\_ndarray.pyc", line 7, in __load > ImportError: init_ndarray: can't find memory.new_memory Is numarray.memory actually present in your install directory? Can you CD to that directory and import memory by itself? > then - probably because I was reading the numarray manual this morning > - I went to my numarray install and decided to run testall.py > > I got There's two things going on here. (1) This manner of running the numarray self-tests isn't recommended since it doesn't work anywhere. Read Doc/INSTALL.txt for how to run them. (2) There's bit-rot in numarray CVS for windows. I'm working on the rot now. > F:\Python24\Lib\site-packages\numarray>\python24\python testall.py > Testing numarray 1.3.3 on normal Python (2, 4, 1, 'final', 0) on > platform win32 > ********************************************************************** > File "F:\python24\lib\site-packages\numarray\numtest.py", line 2843, > in cache p > ss > Failed example: > cPickle.loads(cPickle.dumps(arange(5)+1j)) > Exception raised: > Traceback (most recent call last): > File "F:\Python24\lib\doctest.py", line 1243, in __run > compileflags, 1) in test.globs > File "<doctest cache pass[968]>", line 1, in ? > PicklingError: Can't pickle <built-in function > memory_from_string>: it's no > the same object as memory.memory_from_string > ********************************************************************** > File "F:\python24\lib\site-packages\numarray\numtest.py", line 2849, > in cache p > ss > Failed example: > p = p.dump(a) > Exception raised: > Traceback (most recent call last): > File "F:\Python24\lib\doctest.py", line 1243, in __run > compileflags, 1) in test.globs > File "<doctest cache pass[973]>", line 1, in ? > PicklingError: Can't pickle <built-in function > memory_from_string>: it's no > the same object as memory.memory_from_string > ********************************************************************** > File "F:\python24\lib\site-packages\numarray\numtest.py", line 2850, > in cache p > ss > Failed example: > p = p.dump(b) > Exception raised: > > and so on for quite some time. > > Hmm the message about > memory.memory_from_string > and my applications > ImportError: init_ndarray: can't find memory.new_memory > > are these a little related? Am I clutching at straws? > > Yet my app runs fine under any ide I wish to use. > > WAIT! - my install of numarray is broken.... > I deleted it and reinstalled - still broken I'm a little confused here. How is numarray installed where your application actually works? How is numarray installed where numarray does not work? (I was under the impression that you're using a tool to build a self-contained installer... which isn't working. I figured your development systems have numarray installed independently... which is working. What are you doing?) > I installed on my laptop and tested - broken there too > > My legacy python 2.3 and numarray 1.3.3 installation passes all the > tests just fine. > > Is there a problem with python2.4.1 and numarray 1.3.3? Nope. > Could some kind soul build me a numarray windows installer for python > 2.4 from cvs - please - so that I can see if that works better with > py2exe. Let me know if you still want this and I'll make one for you. FYI, MinGW works great for matplotlib but you may have to row-your-own-boat when it comes to numarray. As far as I know, there are missing glibc dependencies for numarray, particularly IEEE exception handling. Regards, Todd |