ratal / mdfreader

Read Measurement Data Format (MDF) versions 3.x and 4.x file formats in python
Other
169 stars 74 forks source link

Exception in MDFreader while reading mdf file #163

Closed sunlg5 closed 5 years ago

sunlg5 commented 5 years ago

Python version

Please write here the output of printing sys.version '2.7.16 (v2.7.16:413a49145e, Mar 4 2019, 01:37:19) [MSC v.1500 64 bit (AMD64)]'

Platform information

Please write here the output of printing platform.platform() 'Windows-10-10.0.16299'

Numpy version

Please write here the output of printing numpy.__version__ '1.16.3'

mdfreader version

Please write here the output of printing mdfreader.__version__ '3.1'

Description

Please describe the issue pr error stack here and eventually script used to use mdfreader -------------------------------------------error stack--------------------------------------------------- Warning (from warnings module): File "C:\Python27\lib\site-packages\mdfreader\mdf3reader.py", line 545 warn('Unexpected error: {}'.format(exc_info())) UserWarning: Unexpected error: (<type 'exceptions.ImportError'>, ImportError('No module named dataRead',), <traceback object at 0x000000000F2AC4C8>)

Warning (from warnings module): File "C:\Python27\lib\site-packages\mdfreader\mdf3reader.py", line 546 warn('dataRead crashed, back to python data reading') UserWarning: dataRead crashed, back to python data reading

Warning (from warnings module): File "C:\Python27\lib\site-packages\mdfreader\mdf3reader.py", line 545 warn('Unexpected error: {}'.format(exc_info())) UserWarning: Unexpected error: (<type 'exceptions.ImportError'>, ImportError('No module named dataRead',), <traceback object at 0x00000000115525C8>)

Warning (from warnings module): File "C:\Python27\lib\site-packages\mdfreader\mdf3reader.py", line 545 warn('Unexpected error: {}'.format(exc_info())) UserWarning: Unexpected error: (<type 'exceptions.ImportError'>, ImportError('No module named dataRead',), <traceback object at 0x0000000011474688>)

Traceback (most recent call last): File "<pyshell#2>", line 1, in yop = mdfreader.Mdf('C:\Sunil\mdfDatFiles\RailCPosFaults_5941_14_1_VehMovingDrvlineEngaged.mdf') File "C:\Python27\lib\site-packages\mdfreader\mdf.py", line 160, in init metadata=metadata) File "C:\Python27\lib\site-packages\mdfreader\mdfreader.py", line 401, in read convert_after_read, filter_channel_names, compression) File "C:\Python27\lib\site-packages\mdfreader\mdf3reader.py", line 928, in read3 buf.read(channel_set, self.fileName) # reads datablock potentially containing several channel groups File "C:\Python27\lib\site-packages\mdfreader\mdf3reader.py", line 706, in read self.load_sorted(self[record_id]['record'], name_list=channel_set) File "C:\Python27\lib\site-packages\mdfreader\mdf3reader.py", line 730, in load_sorted return record.read_sorted_record(self.fid, self.pointerToData, name_list) File "C:\Python27\lib\site-packages\mdfreader\mdf3reader.py", line 553, in read_sorted_record channel.posByteEnd])[0] error: unpack requires a string argument of length 4 ----------------------------------------------code here-------------------------------------------------

import mdfreader yop = mdfreader.Mdf('C:\Sunil\mdfDatFiles\RailCPosFaults_5941_14_1_VehMovingDrvlineEngaged.mdf') Also mentioning version of mdf file will be helpful (using mdfvalidator or mdfreader if functional for reading) MDF 3.20

print of issue related variables at the errors location and eventually mdfvalidator screenshots can help troubleshooting complicated issues

ratal commented 5 years ago

Hi, A bit hard to troubleshoot like this but a snapshot of the channel description from MDFValidator could help to understand what goes wrong. Anyway, my guess is that your channel is encoded in 3 bytes for instance (16 < number of bits <=24) but the CFormat expects 4 bytes --> not possible, that is the reason why dataRead cython module is existing. So you should install the wheel (I think only win10 64bit but python 3.7) or compile it on your platform (you need proper environment for python2.7 and win10)

sunlg5 commented 5 years ago

Thank you very much Ratal for your reply I am having lot of signals in MDF file, I am not able to locate channel having 3 bytes. I used PIP install wheel, it showed, "Requirement already satisfied" could you please elaborate more what steps I should take next?

ratal commented 5 years ago

Where your mdfreader is installed, you could try : python setup.py build_ext or the git repo and in the cloned folder : python setup.py develop Maybe errors will appear when you launch those commands, most probably because you do not have installed the right compilation environment -> install it and try again. dataRead module is not used because you have warnings

warn('dataRead crashed, back to python data reading')

As long as you have this, you will face same issue.

sunlg5 commented 5 years ago

Hello Ratal, sorry I was out of office for a two weeks I have installed MinGW as per instructions at: https://cython.readthedocs.io/en/latest/src/tutorial/appendix.html

then I have installed cython and then i downloaded mdfreader-master from github repository and fired on command prompt: python setup.py develop but while installing bitarray its giving exception: Can you please guide me further?? if anything that I am not doing correctly

please refer below command prompt activity log:

C:\Python27>python -m pip install cython DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. Collecting cython Using cached https://files.pythonhosted.org/packages/ec/22/78d1e02ee144454130495280bedf43006337c1d25fe8e066e6cd225572be/Cython-0.29.10-cp27-cp27m-win32.whl Installing collected packages: cython Successfully installed cython-0.29.10 c:\Python27>cd C:\Users\E5251914\Downloads\bitarray-0.9.3.tar\dist\bitarray-0.9.3

C:\Users\E5251914\Downloads\bitarray-0.9.3.tar\dist\bitarray-0.9.3>python setup.py install running install running build running build_py creating build creating build\lib.win32-2.7 creating build\lib.win32-2.7\bitarray copying bitarray\test_bitarray.py -> build\lib.win32-2.7\bitarray copying bitarray__init__.py -> build\lib.win32-2.7\bitarray running build_ext building 'bitarray._bitarray' extension creating build\temp.win32-2.7 creating build\temp.win32-2.7\Release creating build\temp.win32-2.7\Release\bitarray C:\MinGW\bin\gcc.exe -mdll -O -Wall -IC:\Python27\include -IC:\Python27\PC -c bitarray/_bitarray.c -o build\temp.win32-2.7\Release\bitarray_bitarray.o bitarray/_bitarray.c: In function 'check_overflow': bitarray/_bitarray.c:105:61: warning: unknown conversion type character 'l' in format [-Wformat=] sprintf(buff, "cannot create bitarray of size %lld, " ^ bitarray/_bitarray.c:105:27: warning: unknown conversion type character 'l' in format [-Wformat=] sprintf(buff, "cannot create bitarray of size %lld, " ^~~~~~~~~~~ bitarray/_bitarray.c:106:42: note: format string is defined here "max size is %lld", nbits, max_bits); ^ bitarray/_bitarray.c:105:27: warning: too many arguments for format [-Wformat-extra-args] sprintf(buff, "cannot create bitarray of size %lld, " ^~~~~~~~~~~ bitarray/_bitarray.c: In function 'setslice': bitarray/_bitarray.c:1873:65: warning: unknown conversion type character 'l' in format [-Wformat=] sprintf(buff, "attempt to assign sequence of size %lld " ^ bitarray/_bitarray.c:1873:27: warning: unknown conversion type character 'l' in format [-Wformat=] sprintf(buff, "attempt to assign sequence of size %lld " ^~~~~~~~~~ bitarray/_bitarray.c:1874:56: note: format string is defined here "to extended slice of size %lld", ^ bitarray/_bitarray.c:1873:27: warning: too many arguments for format [-Wformat-extra-args] sprintf(buff, "attempt to assign sequence of size %lld " ^~~~~~~~~~ writing build\temp.win32-2.7\Release\bitarray_bitarray.def C:\MinGW\bin\gcc.exe -shared -s build\temp.win32-2.7\Release\bitarray_bitarray.o build\temp.win32-2.7\Release\bitarray_bitarray.def -LC:\Python27\libs -LC:\Python27\PCbuild -lpython27 -lmsvcr90 -o build\lib.win32-2.7\bitarray_bitarray.pyd c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\Python27\libs/libpython27.a: error adding symbols: file format not recognized collect2.exe: error: ld returned 1 exit status error: command 'C:\MinGW\bin\gcc.exe' failed with exit status 1

C:\Users\E5251914\Downloads\bitarray-0.9.3.tar\dist\bitarray-0.9.3>cd C:\Users\E5251914\Downloads\mdfreader-master

C:\Users\E5251914\Downloads\mdfreader-master>python setup.py develop Compiling dataRead.pyx because it depends on C:\Python27\lib\site-packages\Cython\Includes\numpy__init__.pxd. [1/1] Cythonizing dataRead.pyx C:\Python27\lib\site-packages\Cython\Compiler\Main.py:367: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: C:\Users\E5251914\Downloads\mdfreader-master\dataRead.pyx tree = Parsing.p_module(s, pxd, full_module_name) C:\Python27\lib\distutils\dist.py:267: UserWarning: Unknown distribution option: 'long_description_content_type' warnings.warn(msg) running develop running egg_info writing requirements to mdfreader.egg-info\requires.txt writing mdfreader.egg-info\PKG-INFO writing top-level names to mdfreader.egg-info\top_level.txt writing dependency_links to mdfreader.egg-info\dependency_links.txt writing entry points to mdfreader.egg-info\entry_points.txt reading manifest file 'mdfreader.egg-info\SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no files found matching '*' under directory 'docs\build\html' warning: no files found matching 'mdfreader.pdf' under directory 'docs\build\latex' warning: no files found matching 'README' writing manifest file 'mdfreader.egg-info\SOURCES.txt' running build_ext building 'dataRead' extension creating build creating build\temp.win32-2.7 creating build\temp.win32-2.7\Release C:\MinGW\bin\gcc.exe -mdll -O -Wall -IC:\Python27\lib\site-packages\numpy\core\include -IC:\Python27\include -IC:\Python27\PC -IC:\Python27\include -IC:\Python27\PC -c dataRead.c -o build\temp.win32-2.7\Release\dataread.o In file included from C:\Python27\lib\site-packages\numpy\core\include/numpy/ndarraytypes.h:1822, from C:\Python27\lib\site-packages\numpy\core\include/numpy/ndarrayobject.h:12, from C:\Python27\lib\site-packages\numpy\core\include/numpy/arrayobject.h:4, from dataRead.c:611: C:\Python27\lib\site-packages\numpy\core\include/numpy/npy_1_7_deprecated_api.h:14:9: note: #pragma message: C:\Python27\lib\site-packages\numpy\core\include/numpy/npy_1_7_deprecated_api.h(14) : Warning Msg: Using deprecated NumPy API, disable it with #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION

pragma message(_WARN_LOC"Using deprecated NumPy API, disable it with " \

     ^~~~~~~

dataRead.c: In function 'pyx_f_8dataRead_read_unsigned_longlong': dataRead.c:7652:56: warning: left shift count >= width of type [-Wshift-count-overflow] pyx_v_temp8byte = (((((((((pyx_v_temp8[0]) << 56) | ((pyx_v_temp8[1]) << 48)) | ((pyx_v_temp8[2]) << 40)) | ((pyx_v_temp8[3]) << 32)) | ((pyx_v_temp8[4]) << 24)) | ((pyx_v_temp8[5]) << 16)) | ((pyx_v_temp8[6]) << 8)) | (pyx_v_temp8[7])); ^~ dataRead.c:7652:85: warning: left shift count >= width of type [-Wshift-count-overflow] pyx_v_temp8byte = (((((((((pyx_v_temp8[0]) << 56) | ((pyx_v_temp8[1]) << 48)) | ((pyx_v_temp8[2]) << 40)) | ((pyx_v_temp8[3]) << 32)) | ((pyx_v_temp8[4]) << 24)) | ((pyx_v_temp8[5]) << 16)) | ((pyx_v_temp8[6]) << 8)) | (pyx_v_temp8[7])); ^~ dataRead.c:7652:115: warning: left shift count >= width of type [-Wshift-count-overflow] pyx_v_temp8byte = (((((((((pyx_v_temp8[0]) << 56) | ((pyx_v_temp8[1]) << 48)) | ((pyx_v_temp8[2]) << 40)) | ((pyx_v_temp8[3]) << 32)) | ((pyx_v_temp8[4]) << 24)) | ((pyx_v_temp8[5]) << 16)) | ((pyx_v_temp8[6]) << 8)) | (pyx_v_temp8[7])); ^~ dataRead.c:7652:145: warning: left shift count >= width of type [-Wshift-count-overflow] pyx_v_temp8byte = (((((((((pyx_v_temp8[0]) << 56) | ((pyx_v_temp8[1]) << 48)) | ((pyx_v_temp8[2]) << 40)) | ((pyx_v_temp8[3]) << 32)) | ((pyx_v_temp8[4]) << 24)) | ((pyx_v_temp8[5]) << 16)) | ((pyx_v_temp8[6]) << 8)) | (pyx_v_temp8[7])); ^~ dataRead.c:7892:55: warning: left shift count >= width of type [-Wshift-count-overflow] pyx_v_temp8byte = ((((((((pyx_v_temp7[0]) << 48) | ((pyx_v_temp7[1]) << 40)) | ((pyx_v_temp7[2]) << 32)) | ((pyx_v_temp7[3]) << 24)) | ((pyx_v_temp7[4]) << 16)) | ((pyx_v_temp7[5]) << 8)) | (pyx_v_temp7[6])); ^~ dataRead.c:7892:84: warning: left shift count >= width of type [-Wshift-count-overflow] pyx_v_temp8byte = ((((((((pyx_v_temp7[0]) << 48) | ((pyx_v_temp7[1]) << 40)) | ((pyx_v_temp7[2]) << 32)) | ((pyx_v_temp7[3]) << 24)) | ((pyx_v_temp7[4]) << 16)) | ((pyx_v_temp7[5]) << 8)) | (pyx_v_temp7[6])); ^~ dataRead.c:7892:114: warning: left shift count >= width of type [-Wshift-count-overflow] pyx_v_temp8byte = ((((((((pyx_v_temp7[0]) << 48) | ((pyx_v_temp7[1]) << 40)) | ((pyx_v_temp7[2]) << 32)) | ((pyx_v_temp7[3]) << 24)) | ((pyx_v_temp7[4]) << 16)) | ((pyx_v_temp7[5]) << 8)) | (pyx_v_temp7[6])); ^~ dataRead.c:8132:54: warning: left shift count >= width of type [-Wshift-count-overflow] pyx_v_temp8byte = (((((((pyx_v_temp6[0]) << 40) | ((pyx_v_temp6[1]) << 32)) | ((pyx_v_temp6[2]) << 24)) | ((pyx_v_temp6[3]) << 16)) | ((pyx_v_temp6[4]) << 8)) | (pyx_v_temp6[5])); ^~ dataRead.c:8132:83: warning: left shift count >= width of type [-Wshift-count-overflow] pyx_v_temp8byte = (((((((pyx_v_temp6[0]) << 40) | ((pyx_v_temp6[1]) << 32)) | ((pyx_v_temp6[2]) << 24)) | ((pyx_v_temp6[3]) << 16)) | ((pyx_v_temp6[4]) << 8)) | (pyx_v_temp6[5])); ^~ dataRead.c:8372:53: warning: left shift count >= width of type [-Wshift-count-overflow] pyx_v_temp8byte = ((((((pyx_v_temp5[0]) << 32) | ((pyx_v_temp5[1]) << 24)) | ((pyx_v_temp5[2]) << 16)) | ((pyx_v_temp5[3]) << 8)) | (pyx_v_temp5[4])); ^~ dataRead.c: In function '__pyx_f_8dataRead_read_signed_longlong': dataRead.c:8947:56: warning: left shift count >= width of type [-Wshift-count-overflow] pyx_v_temp8byte = (((((((((pyx_v_temp8[0]) << 56) | ((pyx_v_temp8[1]) << 48)) | ((pyx_v_temp8[2]) << 40)) | ((pyx_v_temp8[3]) << 32)) | ((pyx_v_temp8[4]) << 24)) | ((pyx_v_temp8[5]) << 16)) | ((pyx_v_temp8[6]) << 8)) | (pyx_v_temp8[7])); ^~ dataRead.c:8947:85: warning: left shift count >= width of type [-Wshift-count-overflow] pyx_v_temp8byte = (((((((((pyx_v_temp8[0]) << 56) | ((pyx_v_temp8[1]) << 48)) | ((pyx_v_temp8[2]) << 40)) | ((pyx_v_temp8[3]) << 32)) | ((pyx_v_temp8[4]) << 24)) | ((pyx_v_temp8[5]) << 16)) | ((pyx_v_temp8[6]) << 8)) | (pyx_v_temp8[7])); ^~ dataRead.c:8947:115: warning: left shift count >= width of type [-Wshift-count-overflow] pyx_v_temp8byte = (((((((((pyx_v_temp8[0]) << 56) | ((pyx_v_temp8[1]) << 48)) | ((pyx_v_temp8[2]) << 40)) | ((pyx_v_temp8[3]) << 32)) | ((pyx_v_temp8[4]) << 24)) | ((pyx_v_temp8[5]) << 16)) | ((pyx_v_temp8[6]) << 8)) | (pyx_v_temp8[7])); ^~ dataRead.c:8947:145: warning: left shift count >= width of type [-Wshift-count-overflow] pyx_v_temp8byte = (((((((((pyx_v_temp8[0]) << 56) | ((pyx_v_temp8[1]) << 48)) | ((pyx_v_temp8[2]) << 40)) | ((pyx_v_temp8[3]) << 32)) | ((pyx_v_temp8[4]) << 24)) | ((pyx_v_temp8[5]) << 16)) | ((pyx_v_temp8[6]) << 8)) | (pyx_v_temp8[7])); ^~ dataRead.c:9261:55: warning: left shift count >= width of type [-Wshift-count-overflow] pyx_v_temp8byte = ((((((((pyx_v_temp7[0]) << 48) | ((pyx_v_temp7[1]) << 40)) | ((pyx_v_temp7[2]) << 32)) | ((pyx_v_temp7[3]) << 24)) | ((pyx_v_temp7[4]) << 16)) | ((pyx_v_temp7[5]) << 8)) | (pyx_v_temp7[6])); ^~ dataRead.c:9261:84: warning: left shift count >= width of type [-Wshift-count-overflow] pyx_v_temp8byte = ((((((((pyx_v_temp7[0]) << 48) | ((pyx_v_temp7[1]) << 40)) | ((pyx_v_temp7[2]) << 32)) | ((pyx_v_temp7[3]) << 24)) | ((pyx_v_temp7[4]) << 16)) | ((pyx_v_temp7[5]) << 8)) | (pyx_v_temp7[6])); ^~ dataRead.c:9261:114: warning: left shift count >= width of type [-Wshift-count-overflow] pyx_v_temp8byte = ((((((((pyx_v_temp7[0]) << 48) | ((pyx_v_temp7[1]) << 40)) | ((pyx_v_temp7[2]) << 32)) | ((pyx_v_temp7[3]) << 24)) | ((pyx_v_temp7[4]) << 16)) | ((pyx_v_temp7[5]) << 8)) | (pyx_v_temp7[6])); ^~ dataRead.c:9575:54: warning: left shift count >= width of type [-Wshift-count-overflow] pyx_v_temp8byte = (((((((pyx_v_temp6[0]) << 40) | ((pyx_v_temp6[1]) << 32)) | ((pyx_v_temp6[2]) << 24)) | ((pyx_v_temp6[3]) << 16)) | ((pyx_v_temp6[4]) << 8)) | (pyx_v_temp6[5])); ^~ dataRead.c:9575:83: warning: left shift count >= width of type [-Wshift-count-overflow] pyx_v_temp8byte = (((((((pyx_v_temp6[0]) << 40) | ((pyx_v_temp6[1]) << 32)) | ((pyx_v_temp6[2]) << 24)) | ((pyx_v_temp6[3]) << 16)) | ((pyx_v_temp6[4]) << 8)) | (pyx_v_temp6[5])); ^~ dataRead.c:9889:53: warning: left shift count >= width of type [-Wshift-count-overflow] pyx_v_temp8byte = ((((((pyx_v_temp5[0]) << 32) | ((pyx_v_temp5[1]) << 24)) | ((pyx_v_temp5[2]) << 16)) | ((pyx_v_temp5[3]) << 8)) | (pyx_v_temp5[4])); ^~ dataRead.c: In function 'Pyx_RaiseArgtupleInvalid': dataRead.c:13474:18: warning: unknown conversion type character 'z' in format [-Wformat=] "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", ^~~~~~~ dataRead.c:318:32: note: format string is defined here

define CYTHON_FORMAT_SSIZE_T "z"

                            ^

dataRead.c:13474:18: warning: format '%s' expects argument of type 'char *', but argument 5 has type 'Py_ssize_t' {aka 'int'} [-Wformat=] "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", ^~~~~~~ func_name, more_or_less, num_expected,

dataRead.c:13474:89: note: format string is defined here
                  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                                                                                      ~~~^
                                                                                      %.1d
dataRead.c:13474:18: warning: unknown conversion type character 'z' in format [-Wformat=]
                  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                  ^~~~~~~~~~~~~~~~~~~~~~~
dataRead.c:318:32: note: format string is defined here
 #define CYTHON_FORMAT_SSIZE_T "z"
                                ^
dataRead.c:13474:18: warning: too many arguments for format [-Wformat-extra-args]
                  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                  ^~~~~~~~~~~~~~~~~~~~~~~
dataRead.c: In function '__Pyx_BufFmt_ProcessTypeChunk':
dataRead.c:14101:57: warning: unknown conversion type character 'z' in format [-Wformat=]
                          "Expected a dimension of size %zu, got %zu",
                                                         ^
dataRead.c:14101:66: warning: unknown conversion type character 'z' in format [-Wformat=]
                          "Expected a dimension of size %zu, got %zu",
                                                                  ^
dataRead.c:14101:26: warning: too many arguments for format [-Wformat-extra-args]
                          "Expected a dimension of size %zu, got %zu",
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dataRead.c:14153:20: warning: unknown conversion type character 'z' in format [-Wformat=]
                    "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dataRead.c:318:32: note: format string is defined here
 #define CYTHON_FORMAT_SSIZE_T "z"
                                ^
dataRead.c:14153:20: warning: unknown conversion type character 'z' in format [-Wformat=]
                    "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dataRead.c:318:32: note: format string is defined here
 #define CYTHON_FORMAT_SSIZE_T "z"
                                ^
dataRead.c:14153:20: warning: too many arguments for format [-Wformat-extra-args]
                    "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dataRead.c: In function '__pyx_buffmt_parse_array':
dataRead.c:14215:56: warning: unknown conversion type character 'z' in format [-Wformat=]
                         "Expected a dimension of size %zu, got %d",
                                                        ^
dataRead.c:14215:25: warning: too many arguments for format [-Wformat-extra-args]
                         "Expected a dimension of size %zu, got %d",
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dataRead.c: In function '__Pyx__GetBufferAndValidate':
dataRead.c:14407:7: warning: unknown conversion type character 'z' in format [-Wformat=]
       "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)",
       ^~~~~~~~~~~~~~~~~~~~~~~~
dataRead.c:318:32: note: format string is defined here
 #define CYTHON_FORMAT_SSIZE_T "z"
                                ^
dataRead.c:14407:7: warning: format '%s' expects argument of type 'char *', but argument 3 has type 'Py_ssize_t' {aka 'int'} [-Wformat=]
       "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)",
       ^~~~~~~~~~~~~~~~~~~~~~~~
       buf->itemsize, (buf->itemsize > 1) ? "s" : "",

dataRead.c:14407:62: note: format string is defined here "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)", ~^ %d dataRead.c:14407:7: warning: unknown conversion type character 'z' in format [-Wformat=] "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)", ^~~~~~~~ dataRead.c:318:32: note: format string is defined here

define CYTHON_FORMAT_SSIZE_T "z"

                            ^

dataRead.c:14407:7: warning: too many arguments for format [-Wformat-extra-args] "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)", ^~~~~~~~ dataRead.c: In function '__Pyx_RaiseTooManyValuesError': dataRead.c:14908:18: warning: unknown conversion type character 'z' in format [-Wformat=] "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); ^~~~~~~~~~~ dataRead.c:318:32: note: format string is defined here

define CYTHON_FORMAT_SSIZE_T "z"

                            ^

dataRead.c:14908:18: warning: too many arguments for format [-Wformat-extra-args] "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); ^~~~~~~~~~~ dataRead.c: In function '__Pyx_RaiseNeedMoreValuesError': dataRead.c:14914:18: warning: unknown conversion type character 'z' in format [-Wformat=] "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", ^~~~~~ dataRead.c:318:32: note: format string is defined here

define CYTHON_FORMAT_SSIZE_T "z"

                            ^

dataRead.c:14914:18: warning: format '%s' expects argument of type 'char *', but argument 3 has type 'Py_ssize_t' {aka 'int'} [-Wformat=] "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", ^~~~~~ index, (index == 1) ? "" : "s");


dataRead.c:14914:70: note: format string is defined here
                  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                                                                   ~~~^
                                                                   %.1d
dataRead.c:14914:18: warning: too many arguments for format [-Wformat-extra-args]
                  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                  ^~~~~~~~~~~~~~~~~~
dataRead.c: In function '__Pyx_ImportType':
dataRead.c:15113:13: warning: unknown conversion type character 'z' in format [-Wformat=]
             "%.200s.%.200s size changed, may indicate binary incompatibility. "
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dataRead.c:15114:24: note: format string is defined here
             "Expected %zd from C header, got %zd from PyObject",
                        ^
dataRead.c:15113:13: warning: unknown conversion type character 'z' in format [-Wformat=]
             "%.200s.%.200s size changed, may indicate binary incompatibility. "
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dataRead.c:15114:47: note: format string is defined here
             "Expected %zd from C header, got %zd from PyObject",
                                               ^
dataRead.c:15113:13: warning: too many arguments for format [-Wformat-extra-args]
             "%.200s.%.200s size changed, may indicate binary incompatibility. "
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dataRead.c:15120:13: warning: unknown conversion type character 'z' in format [-Wformat=]
             "%.200s.%.200s size changed, may indicate binary incompatibility. "
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dataRead.c:15121:24: note: format string is defined here
             "Expected %zd from C header, got %zd from PyObject",
                        ^
dataRead.c:15120:13: warning: unknown conversion type character 'z' in format [-Wformat=]
             "%.200s.%.200s size changed, may indicate binary incompatibility. "
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dataRead.c:15121:47: note: format string is defined here
             "Expected %zd from C header, got %zd from PyObject",
                                               ^
dataRead.c:15120:13: warning: too many arguments for format [-Wformat-extra-args]
             "%.200s.%.200s size changed, may indicate binary incompatibility. "
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dataRead.c:15127:13: warning: unknown conversion type character 'z' in format [-Wformat=]
             "%s.%s size changed, may indicate binary incompatibility. "
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dataRead.c:15128:24: note: format string is defined here
             "Expected %zd from C header, got %zd from PyObject",
                        ^
dataRead.c:15127:13: warning: unknown conversion type character 'z' in format [-Wformat=]
             "%s.%s size changed, may indicate binary incompatibility. "
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dataRead.c:15128:47: note: format string is defined here
             "Expected %zd from C header, got %zd from PyObject",
                                               ^
dataRead.c:15127:13: warning: too many arguments for format [-Wformat-extra-args]
             "%s.%s size changed, may indicate binary incompatibility. "
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
writing build\temp.win32-2.7\Release\dataRead.def
creating build\lib.win32-2.7
C:\MinGW\bin\gcc.exe -shared -s build\temp.win32-2.7\Release\dataread.o build\temp.win32-2.7\Release\dataRead.def -LC:\Python27\libs -LC:\Python27\PCbuild -lpython27 -lmsvcr90 -o build\lib.win32-2.7\dataRead.pyd
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\Python27\libs/libpython27.a: error adding symbols: file format not recognized
collect2.exe: error: ld returned 1 exit status
('Unexpected error:', (<type 'exceptions.SystemExit'>, SystemExit("error: command 'C:\\\\MinGW\\\\bin\\\\gcc.exe' failed with exit status 1",), <traceback object at 0x0C619E40>))
running develop
running egg_info
writing requirements to mdfreader.egg-info\requires.txt
writing mdfreader.egg-info\PKG-INFO
writing top-level names to mdfreader.egg-info\top_level.txt
writing dependency_links to mdfreader.egg-info\dependency_links.txt
writing entry points to mdfreader.egg-info\entry_points.txt
reading manifest file 'mdfreader.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*' under directory 'docs\build\html'
warning: no files found matching 'mdfreader.pdf' under directory 'docs\build\latex'
warning: no files found matching 'README'
writing manifest file 'mdfreader.egg-info\SOURCES.txt'
running build_ext
Creating c:\python27\lib\site-packages\mdfreader.egg-link (link to .)
mdfreader 3.2 is already the active version in easy-install.pth
Installing mdfconverter-script.py script to C:\Python27\Scripts
Installing mdfconverter.exe script to C:\Python27\Scripts
Installing mdfconverter.exe.manifest script to C:\Python27\Scripts

Installed c:\users\e5251914\downloads\mdfreader-master
Processing dependencies for mdfreader==3.2
Searching for bitarray
Reading https://pypi.python.org/simple/bitarray/
Best match: bitarray 0.9.3
Downloading https://files.pythonhosted.org/packages/23/3e/ff197e545fd0f1d3796a4460a355c2beac92525823a3073cec66c03d63c3/bitarray-0.9.3.tar.gz#sha256=b2783d74247abb2669f581a001ecaa747e4b2ff9440762dbb499ed69b83e321e
Processing bitarray-0.9.3.tar.gz
Writing c:\users\e5251914\appdata\local\temp\easy_install-ftxkaz\bitarray-0.9.3\setup.cfg
Running bitarray-0.9.3\setup.py -q bdist_egg --dist-dir c:\users\e5251914\appdata\local\temp\easy_install-ftxkaz\bitarray-0.9.3\egg-dist-tmp-b8iygq
bitarray/_bitarray.c: In function 'check_overflow':
bitarray/_bitarray.c:105:61: warning: unknown conversion type character 'l' in format [-Wformat=]
             sprintf(buff, "cannot create bitarray of size %lld, "
                                                             ^
bitarray/_bitarray.c:105:27: warning: unknown conversion type character 'l' in format [-Wformat=]
             sprintf(buff, "cannot create bitarray of size %lld, "
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bitarray/_bitarray.c:106:42: note: format string is defined here
                           "max size is %lld", nbits, max_bits);
                                          ^
bitarray/_bitarray.c:105:27: warning: too many arguments for format [-Wformat-extra-args]
             sprintf(buff, "cannot create bitarray of size %lld, "
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bitarray/_bitarray.c: In function 'setslice':
bitarray/_bitarray.c:1873:65: warning: unknown conversion type character 'l' in format [-Wformat=]
             sprintf(buff, "attempt to assign sequence of size %lld "
                                                                 ^
bitarray/_bitarray.c:1873:27: warning: unknown conversion type character 'l' in format [-Wformat=]
             sprintf(buff, "attempt to assign sequence of size %lld "
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bitarray/_bitarray.c:1874:56: note: format string is defined here
                           "to extended slice of size %lld",
                                                        ^
bitarray/_bitarray.c:1873:27: warning: too many arguments for format [-Wformat-extra-args]
             sprintf(buff, "attempt to assign sequence of size %lld "
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: C:\Python27\libs/libpython27.a: error adding symbols: file format not recognized
collect2.exe: error: ld returned 1 exit status
error: Setup script exited with error: command 'C:\\MinGW\\bin\\gcc.exe' failed with exit status 1
ratal commented 5 years ago

Both dataRead and bitarray where not able to compile. I have no experience with mingw. As backup, you could install visual C++ community edition and try to compile for windows. Also according to below link, you might have mixed up 32 and 64 bit python/windows/Mingw. https://forums.x-plane.org/index.php?/forums/topic/118001-error-adding-symbols-helloworld-wont-compile/

sunlg5 commented 5 years ago

Earlier I had installed Visual C++ for python 2.7, still compiling gave issue but now i installed Visual C++ community edition and it compiled well and it did read MDF file well Thank you very much Ratal and I appreciate your help and patience as well

sunlg5 commented 5 years ago

but I have question, how MDFreder setup file decides which compiler to be used for compiling, because while compiling I had both MinGW and Visual C++ community edition compiler on machine?