ratal / mdfreader

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

ImportError: cannot import name 'mdfinfo' #49

Closed ginseil closed 7 years ago

ginseil commented 7 years ago

Hi,

I installed the latest version using pip:

$ pip install git+https://github.com/ratal/mdfreader Collecting git+https://github.com/ratal/mdfreader Cloning https://github.com/ratal/mdfreader to c:\users\stoev\appdata\local\temp\pip-jv3atn6p-build Requirement already satisfied: numpy>=1.7 in c:\users\stoev\appdata\local\continuum\anaconda3\lib\site-packages (from mdfreader==0.2.4) Requirement already satisfied: sympy in c:\users\stoev\appdata\local\continuum\anaconda3\lib\site-packages (from mdfreader==0.2.4) Requirement already satisfied: cython>=0.21 in c:\users\stoev\appdata\local\continuum\anaconda3\lib\site-packages (from mdfreader==0.2.4) Installing collected packages: mdfreader Running setup.py install for mdfreader: started Running setup.py install for mdfreader: finished with status 'done' Successfully installed mdfreader-0.2.4

Now an attempt to import the mdfreader results in an ImportError:

import mdfreader Traceback (most recent call last): File "..\Continuum\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 2881, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "", line 1, in import mdfreader File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 2016.3.2\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 21, in do_import module = self._system_import(name, *args, **kwargs) File "..\Continuum\Anaconda3\lib\site-packages\mdfreader__init__.py", line 30, in from mdfreader import mdf,mdfinfo ImportError: cannot import name 'mdfinfo'

The version from https://pypi.python.org/pypi/mdfreader/0.2.3 runs without any problems

ratal commented 7 years ago

Hi, Bit strange, there are no files called mdfreader_init.py. You changed name of init in mdfreader module folder or is it the packager ? Just to try, did just import the git in a folder a perform a python(2/3) setup.py develop ?

ginseil commented 7 years ago

Hi,

I just tried to install it using pip.

the second error message seems to be wrong, since I wrote is as quote. This should be the correct one:

Traceback (most recent call last): File "C:\Users\stoev\AppData\Local\Continuum\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 2881, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "<ipython-input-2-d5befc510197>", line 1, in <module> import mdfreader File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 2016.3.2\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import module = self._system_import(name, *args, **kwargs) File "C:\Users\stoev\AppData\Local\Continuum\Anaconda3\lib\site-packages\mdfreader\__init__.py", line 30, in <module> from mdfreader import mdf,mdfinfo ImportError: cannot import name 'mdfinfo'

ratal commented 7 years ago

I did not know it was possible to use pip to install git repo. I recently changed the way importing module and I must say I did not try on windows/anaconda. maybe you can try with: from .mdfreader import mdf,mdfinfo

ratal commented 7 years ago

I installed anaconda on a fresh windows and uploaded mdfreader repo, installed with python setup.py develop I could not reproduce your errors, import of mdfreader went fine in ipython. Maybe you could give another try in a fresh new environment ?

ginseil commented 7 years ago

Hi, the installation in a new environment seems to work, but now I get following import errors: Unexpected error: (<class 'ImportError'>, ImportError('attempted relative import with no known parent package',), <traceback object at 0x0000000005BEA948>) dataRead crashed, back to python data reading [...]

It is looking for 'dataRead' which seems to be missing. I installed mdfreader using pip: pip install git+https://github.com/ratal/mdfreader I also tried to install it by cloning the repository and running 'python setup.py install'. The result is still the same...

ginseil commented 7 years ago

Hi again,

finally I found the problem for ImportError: cannot import name 'mdfinfo'. It was a simple naming conflict with one of my own modules which is called 'mdf'.

Thanks a lot for your support!