wolph / mt940

A library to parse MT940 files and returns smart Python collections for statistics and manipulation.
https://mt940.readthedocs.org/en/latest/
BSD 3-Clause "New" or "Revised" License
94 stars 50 forks source link

ImportError: cannot import name 'parse' #3

Closed spoetnik closed 9 years ago

spoetnik commented 9 years ago

After a pip install mt-940 I get error; importError: cannot import name 'parse'

Using Python 3.4.2 Any ideas?

wolph commented 9 years ago

It's a python 3.4 thing, easy to fix luckily :)

The new version (919710b37e801ff1020def54ac6f241e57e66a17) supports python 3.4 as well.

spoetnik commented 9 years ago
Successfully installed mt-940

Thanks! (Dank je wel!)

SlimSchip commented 1 year ago

Same issue with lastest version alsof today (4.26.0) (Master and develop branche)

Traceback (most recent call last): File "/Users/martijn/Documents/mt940.py", line 1, in import mt940 File "/Users/martijn/Documents/mt940.py", line 4, in transactions = mt940.parse('~/Downloads/NL64INGB0008766989_01-01-2019_31-12-2019.940') AttributeError: partially initialized module 'mt940' has no attribute 'parse' (most likely due to a circular import)

on both Python (MacBook) 3.10.6 and Debian 3.9. installed with pip and with setup.py master and development branches

any tips on how to solve this?

M

wolph commented 1 year ago

The problem is that your testfile is named mt940.py so it's importing itself. You need to rename both the mt940.py and the mt940.pyc (if the latter exists)

SlimSchip commented 1 year ago

Owww … how stupid can one be ...

On 6 Nov 2022, at 17:38, Rick van Hattem @.***> wrote:

The problem is that your testfile is named mt940.py so it's importing itself. You need to rename both the mt940.py and the mt940.pyc (if the latter exists) — Reply to this email directly, view it on GitHub https://github.com/wolph/mt940/issues/3#issuecomment-1304840630, or unsubscribe https://github.com/notifications/unsubscribe-auth/A2VWLRK23BJCJX4JKQ2DVFLWG7NKDANCNFSM4A62QVXQ. You are receiving this because you commented.