ratal / mdfreader

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

AttributeError: module 'mdfreader' has no attribute 'mdf' #55

Closed yyazicio closed 7 years ago

yyazicio commented 7 years ago

Sorry I am new to python but I receive folloing error When I want to run following lines:

import mdfreader FILENAME = 'm35_1.dat' yop=mdfreader.mdf(FILENAME)

runfile('C:/Users/yyazicio/Desktop/Works/07.Python/mdfreader.py', wdir='C:/Users/yyazicio/Desktop/Works/07.Python') Traceback (most recent call last):

File "", line 1, in runfile('C:/Users/yyazicio/Desktop/Works/07.Python/mdfreader.py', wdir='C:/Users/yyazicio/Desktop/Works/07.Python')

File "C:\Users\yyazicio\AppData\Local\Continuum\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 866, in runfile execfile(filename, namespace)

File "C:\Users\yyazicio\AppData\Local\Continuum\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile exec(compile(f.read(), filename, 'exec'), namespace)

File "C:/Users/yyazicio/Desktop/Works/07.Python/mdfreader.py", line 8, in import mdfreader

File "C:\Users\yyazicio\Desktop\Works\07.Python\mdfreader.py", line 10, in yop=mdfreader.mdf(FILENAME)

AttributeError: module 'mdfreader' has no attribute 'mdf'

and install version is python 3.6 scipy: 0.18.1 numpy: 1.11.3 matplotlib: 2.0.0 pandas: 0.19.2 statsmodels: 0.6.1 sklearn: 0.18.1

ratal commented 7 years ago

Are you trying to run mdfreader from the module folder ? How did you install it ? via pip or github ? Did you run python setup.py install ?

yyazicio commented 7 years ago

First I install using pip ; didnt resolved Than I downloaded mdfreader-0.2.3.tar.gz and installed with python setup.py install command but I have still issue

yyazicio commented 7 years ago

here is the installation comments (short version)

Installed c:\users\yyazicio\appdata\local\continuum\anaconda3\lib\site-package mdfreader-0.2.3-py3.6.egg Processing dependencies for mdfreader==0.2.3 Searching for bitarray==0.8.1 Best match: bitarray 0.8.1 Adding bitarray 0.8.1 to easy-install.pth file

Using c:\users\yyazicio\appdata\local\continuum\anaconda3\lib\site-packages Searching for sympy==1.0 Best match: sympy 1.0 Adding sympy 1.0 to easy-install.pth file

Using c:\users\yyazicio\appdata\local\continuum\anaconda3\lib\site-packages Searching for numpy==1.11.3 Best match: numpy 1.11.3 Adding numpy 1.11.3 to easy-install.pth file

Using c:\users\yyazicio\appdata\local\continuum\anaconda3\lib\site-packages Finished processing dependencies for mdfreader==0.2.3

ratal commented 7 years ago

I cannot understand the following `File "C:/Users/yyazicio/Desktop/Works/07.Python/mdfreader.py", line 8, in import mdfreader

File "C:\Users\yyazicio\Desktop\Works\07.Python\mdfreader.py", line 10, in yop=mdfreader.mdf(FILENAME)`

there are no import mdfreader in mdfreader.py. Did you write a script which has exactly same name as the the mdfreader module ? There will then be conflict.

yyazicio commented 7 years ago

YES :)

I think that was the problem Seems working after rename according to output below Sorry to bother

import mdfreader FILENAME = 'm35_1.dat' yop=mdfreader.mdf(FILENAME) yop.keys() # list channels names

runfile('C:/Users/yyazicio/Desktop/Works/07.Python/mdf_reader.py', wdir='C:/Users/yyazicio/Desktop/Works/07.Python') m35_1.dat WARNING added number to duplicate channel name: RetarderSelectionNonEng_199 WARNING added number to duplicate channel name: RetarderRoadSpeedLimitSwitch_201 WARNING added number to duplicate channel name: RetarderRoadSpeedExceededStatus_202 WARNING added number to duplicate channel name: ActlMxAvlblRtarderPercentTorque_203 WARNING added number to duplicate channel name: DrvrsDmandRetarderPercentTorque_204 WARNING added number to duplicate channel name: RetarderRqingBrakeLight_205 WARNING added number to duplicate channel name: EngCoolantLoadIncrease_206 WARNING added number to duplicate channel name: IntendedRetarderPercentTorque_207 WARNING added number to duplicate channel name: ActualRetarderPercentTorque_208 WARNING added number to duplicate channel name: RetarderEnableShiftAssistSwitch_209 WARNING added number to duplicate channel name: RetarderEnableBrakeAssistSwitch_210 WARNING added number to duplicate channel name: RetarderTorqueMode_211 WARNING added number to duplicate channel name: ParkBrakeReleaseInhibitRq_215 WARNING added number to duplicate channel name: PTOGovernorState_216 WARNING added number to duplicate channel name: CruiseCtrlSetSpeed_222 WARNING added number to duplicate channel name: CruiseCtrlAccelerateSwitch_223 WARNING added number to duplicate channel name: CruiseCtrlResumeSwitch_224 WARNING added number to duplicate channel name: CruiseCtrlCoastSwitch_225 WARNING added number to duplicate channel name: ClutchSwitch_227 WARNING added number to duplicate channel name: BrakeSwitch_228 WARNING added number to duplicate channel name: CruiseCtrlEnableSwitch_229 WARNING added number to duplicate channel name: WheelBasedVehicleSpeed_231 WARNING added number to duplicate channel name: CruiseCtrlPauseSwitch_232 WARNING added number to duplicate channel name: ParkingBrakeSwitch_233 WARNING added number to duplicate channel name: TwoSpeedAxleSwitch_234