1. Albert-Jan Roskam
  2. savReaderWriter
  3. Issues
Issue #12 resolved

Win64 Error

Anonymous created an issue

Hi, Im trying to run it under win64 and get such error:

Traceback (most recent call last): File "C:/Documents/workspace/db/convertors/SPSS.py", line 7, in <module> reader = SavReader(savFileName) File "C:\Program Files\Python27\lib\site-packages\savreaderwriter-3.2.1-py2.7.egg\savReaderWriter\savReader.py", line 48, in init ioUtf8, ioLocale) File "C:\Program Files\Python27\lib\site-packages\savreaderwriter-3.2.1-py2.7.egg\savReaderWriter\header.py", line 20, in init super(Header, self).init(savFileName, ioUtf8, ioLocale) File "C:\Program Files\Python27\lib\site-packages\savreaderwriter-3.2.1-py2.7.egg\savReaderWriter\generic.py", line 18, in init self.spssio = self.loadLibrary() File "C:\Program Files\Python27\lib\site-packages\savreaderwriter-3.2.1-py2.7.egg\savReaderWriter\generic.py", line 85, in loadLibrary spssio = self._loadLibs("win64") File "C:\Program Files\Python27\lib\site-packages\savreaderwriter-3.2.1-py2.7.egg\savReaderWriter\generic.py", line 71, in _loadLibs return [load(os.path.join(path, lib)) for lib in libs][-2] File "C:\Program Files\Python27\lib\ctypes__init.py", line 365, in init__ self._handle = _dlopen(self._name, mode) WindowsError: [Error 193] %1 is not a valid Win32 application

It happens on spssjdio.dll, which was built for 32bit as i see from its meta:

<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"> <security> <requestedPrivileges> <requestedExecutionLevel level="asInvoker" uiAccess="false"> </requestedExecutionLevel> </requestedPrivileges> </security> </trustInfo> <dependency> <dependentAssembly> <assemblyIdentity type="win32" name="Microsoft.VC90.CRT" version="9.0.21022.8" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"> </assemblyIdentity> </dependentAssembly> </dependency> </assembly>

Could you provide with win64 built library or tell how to build it by my own? thx

Comments (8)

  1. Albert-Jan Roskam repo owner

    Hi, That's odd. I am sure this is the way I downloaded them. You can download the IO modules here (bottom of the page, but you need to create an account). I am planning to use the v22 modules for the next version of savReaderWriter. https://www.ibm.com/developerworks/community/wikis/home?lang=en#/wiki/We70df3195ec8_4f95_9773_42e448fa9029/page/Downloads%20for%20IBM%C2%AE%20SPSS%C2%AE%20Statistics

    But what I'd first try is to replace the following line (currently line 69) of generic.py:

    pats = ['(lib)?icuda?t', '(lib)?icuuc', '(lib)?icui',
                    '(lib)?zlib', '(lib)?spssd?io', '(lib)?spssjdio']
    

    with this:

    pats = ['(lib)?icuda?t', '(lib)?icuuc', '(lib)?icui',
                    '(lib)?zlib', '(lib)?spssd?io']
    

    and then of course also do (pick the last element, not -2, like before:

    return [load(os.path.join(path, lib)) for lib in libs][-1]
    

    Can you let me know if that works?

    Thanks.

    Regards, Albert-Jan

  2. NoRecces

    Thanks, Albert-Jan

    After modify generic.py as you said everething starts working. And you are right that the problem is in package which provided on ibm.com . It contains spssjdio library compiled for x86 in folder for x64. Ive tried to use package for 22spss that has the same library compiled correctly but python raises in the same place another erorrs (WINDOWS ERROR 126).

    Could you explain which features depends on spssjdio? And is it possible to work without it?

  3. Albert-Jan Roskam repo owner

    Hi,

    As far as I know: None. I was just hesitant not to load the module. It must be there for some reason. I just did the following:

    objdump -p spssjdio.dll > ~/Desktop/dump.txt
    

    The output seems to suggest that the module is some interface for Java, i.e. spss java data file IO (?):

    [Ordinal/Name Pointer] Table
        [   0] ?Java_com_spss_tools_dio_SpssioNativeInterface_getSysmisValue@@YGNPAUJNIEnv_@@PAV_jclass@@@Z
        [   1] _Java_com_spss_tools_dio_SpssioNativeInterface_addMultRespDefC@32
        [   2] _Java_com_spss_tools_dio_SpssioNativeInterface_addMultRespDefN@32
        [   3] _Java_com_spss_tools_dio_SpssioNativeInterface_closeAppend@12
        [   4] _Java_com_spss_tools_dio_SpssioNativeInterface_closeRead@12
        [   5] _Java_com_spss_tools_dio_SpssioNativeInterface_closeWrite@12
        [   6] _Java_com_spss_tools_dio_SpssioNativeInterface_commitCase@16
        [   7] _Java_com_spss_tools_dio_SpssioNativeInterface_commitHeader@12
        [   8] _Java_com_spss_tools_dio_SpssioNativeInterface_getCaseSize@12
        [   9] _Java_com_spss_tools_dio_SpssioNativeInterface_getCaseValueNumeric@20
        [  10] _Java_com_spss_tools_dio_SpssioNativeInterface_getCaseValueString@20
        [  11] _Java_com_spss_tools_dio_SpssioNativeInterface_getCaseWeightVar@12
        [  12] _Java_com_spss_tools_dio_SpssioNativeInterface_getCompression@12
        [  13] _Java_com_spss_tools_dio_SpssioNativeInterface_getDateTimeStamps@12
        [  14] _Java_com_spss_tools_dio_SpssioNativeInterface_getIdString@12
        [  15] _Java_com_spss_tools_dio_SpssioNativeInterface_getMultRespSets@12
        [  16] _Java_com_spss_tools_dio_SpssioNativeInterface_getNumberOfCases@12
        [  17] _Java_com_spss_tools_dio_SpssioNativeInterface_getNumberOfVariables@12
        [  18] _Java_com_spss_tools_dio_SpssioNativeInterface_getPrintFormat@16
        [  19] _Java_com_spss_tools_dio_SpssioNativeInterface_getReleaseInfo@12
        [  20] _Java_com_spss_tools_dio_SpssioNativeInterface_getSystemString@12
        [  21] _Java_com_spss_tools_dio_SpssioNativeInterface_getValueLabels@20
        [  22] _Java_com_spss_tools_dio_SpssioNativeInterface_getVarCodes@12
        [  23] _Java_com_spss_tools_dio_SpssioNativeInterface_getVarHandle@16
        [  24] _Java_com_spss_tools_dio_SpssioNativeInterface_getVarLabel@16
        [  25] _Java_com_spss_tools_dio_SpssioNativeInterface_getVarMeasureLevel@16
        [  26] _Java_com_spss_tools_dio_SpssioNativeInterface_getVarNames@12
        [  27] _Java_com_spss_tools_dio_SpssioNativeInterface_getVarRole@16
        [  28] _Java_com_spss_tools_dio_SpssioNativeInterface_getVarTypes@12
        [  29] _Java_com_spss_tools_dio_SpssioNativeInterface_getWriteFormat@16
        [  30] _Java_com_spss_tools_dio_SpssioNativeInterface_openAppend@12
        [  31] _Java_com_spss_tools_dio_SpssioNativeInterface_openRead@12
        [  32] _Java_com_spss_tools_dio_SpssioNativeInterface_openWrite@12
        [  33] _Java_com_spss_tools_dio_SpssioNativeInterface_queryType7@16
        [  34] _Java_com_spss_tools_dio_SpssioNativeInterface_setCaseValueNumeric@28
        [  35] _Java_com_spss_tools_dio_SpssioNativeInterface_setCaseValueString@24
        [  36] _Java_com_spss_tools_dio_SpssioNativeInterface_setCompression@16
        [  37] _Java_com_spss_tools_dio_SpssioNativeInterface_setCurrentCase@20
        [  38] _Java_com_spss_tools_dio_SpssioNativeInterface_setInterfaceEncoding@12
        [  39] _Java_com_spss_tools_dio_SpssioNativeInterface_setVarCValueLabels@24
        [  40] _Java_com_spss_tools_dio_SpssioNativeInterface_setVarColumnWidth@20
        [  41] _Java_com_spss_tools_dio_SpssioNativeInterface_setVarLabel@20
        [  42] _Java_com_spss_tools_dio_SpssioNativeInterface_setVarMeasureLevel@20
        [  43] _Java_com_spss_tools_dio_SpssioNativeInterface_setVarNValueLabels@24
        [  44] _Java_com_spss_tools_dio_SpssioNativeInterface_setVarName@20
        [  45] _Java_com_spss_tools_dio_SpssioNativeInterface_setVarPrintFormat@28
        [  46] _Java_com_spss_tools_dio_SpssioNativeInterface_setVarRole@20
        [  47] _Java_com_spss_tools_dio_SpssioNativeInterface_setVarWriteFormat@28
        [  48] _Java_com_spss_tools_dio_SpssioNativeInterface_validateVarName@12
    

    If you experience any problems that indicate that this module is needed, I would love to hear it, but let's hope it keeps working now.

    Regards, Albert-Jan

  4. Albert-Jan Roskam repo owner

    Hi,

    Sorry to bother you. I temporarily have access to a 64-bit Windows system now so I am trying to reproduce the problem you mentioned. However, I experience no problems with a simple test script. See the python session below. Are you using a 64 bit python interpreter? Notice, btw, that the information by the platform module is strange. Any idea why you experienced problems but I am not? I have not received any other reports of win64 users who experienced problems.

    Thank you in advance for your time.

    Regards, Albert-Jan

    >>> import sys, platform
    >>> sys.version
    '2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit (Intel)]'
    >>> sys.platform
    'win32'
    >>> platform.platform()
    'Windows-7-6.1.7601-SP1'
    >>> platform.architecture()
    ('32bit', 'WindowsPE')  # huh?? but I am on a 64 bit machine?!
    >>> from savReaderWriter import *
    >>> with SavReader(savFileName) as reader:
    ...     for lino, line in enumerate(reader):
    ...         if lino < 2:
    ...             print line
    ...
    [1.0, 'm', '1952-02-03', 15.0, 3.0, 57000.0, 27000.0, 98.0, 144.0, 0.0]
    [2.0, 'm', '1958-05-23', 16.0, 1.0, 40200.0, 18750.0, 98.0, 36.0, 0.0]
    

    Here is partial information given by msinfo32.exe:

    Item    Value   
    OS Name Microsoft Windows 7 Professional    
    Version 6.1.7601 Service Pack 1 Build 7601  
    Other OS Description    Not Available   
    OS Manufacturer Microsoft Corporation   
    System Manufacturer FUJITSU 
    System Model    CELSIUS M720    
    System Type x64-based PC    
    Processor   Intel(R) Xeon(R) CPU E5-2670 0 @ 2.60GHz, 2601 Mhz, 8 Core(s), 16 Logical Processor(s)  
    BIOS Version/Date   FUJITSU // American Megatrends Inc. V4.6.5.1 R1.11.0 for D3128-A1x, 20-3-2013   
    
  5. NoRecces

    Hi, Albert-Jan

    Thanks for asking, Yes, I was using 64-bit interpreter. You don`t experience any problems because 32-bit python using 32-bit libraries (spssjdio and others), which were built for 32-bit system and that is ok. But if you have 64-bit python it will use 64-bit spss libraries which actually were built for 32-bit system which is totally not ok. (situation at the time of writing the first message). May be I should write message in community of developers on ibm.com?

    >>> import sys, platform
    >>> sys.version
    '2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)]'
    >>> sys.platform
    'win32'
    >>> platform.platform()
    'Windows-7-6.1.7601-SP1'
    >>> platform.architecture()
    ('64bit', 'WindowsPE')
    

    For now Im using 32-bit python interpreter on 64-bit mashine and also experience no problems.

  6. Log in to comment