BarraQDA / nvivotools

A range of tools to help you get more out of NVivo(tm)
GNU General Public License v3.0
46 stars 11 forks source link

Import Error #11

Closed gdzqzzx closed 3 years ago

gdzqzzx commented 3 years ago

I'm using sqlAlchemy 1.4.7 and got following import error when running python DenormaliseDB.py and python NormaliseDB.py (test only, no input parameters):

  File "NormaliseDB.py", line 20, in <module>
    import NVivo
  File "...\nvivotools-master\NVivo.py", line 48, in <module>
    exec(open(os.path.dirname(os.path.realpath(__file__)) + os.path.sep + 'DataTypes.py').read())
  File "<string>", line 27, in <module>
ImportError: cannot import name 'Binary' from 'sqlalchemy' (...\sqlalchemy\__init__.py)
Traceback (most recent call last):
  File "DenormaliseDB.py", line 20, in <module>
    import NVivo
  File "...\nvivotools-master\NVivo.py", line 48, in <module>
    exec(open(os.path.dirname(os.path.realpath(__file__)) + os.path.sep + 'DataTypes.py').read())
  File "<string>", line 27, in <module>
ImportError: cannot import name 'Binary' from 'sqlalchemy' (...\sqlalchemy\__init__.py)

It seems that somehow the query returned bytes as mentioned here.

jschultz commented 3 years ago

The problem seems to be that since version 1.4 SQLAlchemy has changed the type name from Binary to BINARY. I've pushed a commit that should fix it.

By the way it was my mistake to say you should run DenormaliseNVP.py - if you want to convert from NVivo to another format you should run NormaliseNVP.py. NormaliseDB.py should also work if you have already attached the database but it is simpler to use NormaliseNVP.py which will do the whole procedure. Plus I would like to get to the bottom of the issue you have encountered where the mounting process didn't work.

gdzqzzx commented 3 years ago

Thank you so much for the quick response!

I will test it again after your new comitting. Since my team is not going to use NVivo on next stage, I have more time to play with NVivotools and help to improve it now.

I have reopened #10, please let me know if you have further information you want to know there.

gdzqzzx commented 3 years ago

The problem seems to be that since version 1.4 SQLAlchemy has changed the type name from Binary to BINARY. I've pushed a commit that should fix it.

By the way it was my mistake to say you should run DenormaliseNVP.py - if you want to convert from NVivo to another format you should run NormaliseNVP.py. NormaliseDB.py should also work if you have already attached the database but it is simpler to use NormaliseNVP.py which will do the whole procedure. Plus I would like to get to the bottom of the issue you have encountered where the mounting process didn't work.

Import Error in 1.4 SQLAlchemy is fixed