techouse / mysql-to-sqlite3

Transfer data from MySQL to SQLite
https://techouse.github.io/mysql-to-sqlite3/
MIT License
217 stars 31 forks source link

Future feature annotations is not defined #55

Closed macias closed 1 year ago

macias commented 1 year ago

Describe the bug

I tried to run the program for the first time.

Expected behaviour

Conversion or human-friendly error.

Actual result

I got this error:

Traceback (most recent call last):
  File "/home/mist/.local/bin/mysql2sqlite", line 5, in <module>
    from mysql_to_sqlite3.cli import cli
  File "/home/mist/.local/lib/python3.6/site-packages/mysql_to_sqlite3/__init__.py", line 4, in <module>
    from .transporter import MySQLtoSQLite
  File "/home/mist/.local/lib/python3.6/site-packages/mysql_to_sqlite3/transporter.py", line 14, in <module>
    import mysql.connector
  File "/home/mist/.local/lib/python3.6/site-packages/mysql/connector/__init__.py", line 32, in <module>
    from .connection_cext import CMySQLConnection
  File "/home/mist/.local/lib/python3.6/site-packages/mysql/connector/connection_cext.py", line 40, in <module>
    from .abstracts import MySQLConnectionAbstract
  File "/home/mist/.local/lib/python3.6/site-packages/mysql/connector/abstracts.py", line 33
    from __future__ import annotations
    ^

System Information

$ mysql2sqlite --version

This gives the same error as above :-).

openSUSE 15.3 64-bit, Python 3.6.15

Additional context In case of errors please run the same command with --debug. This option is only available on v1.4.12 or greater.

It gives exactly the same error.

techouse commented 1 year ago

Hey!

What version where you trying to run? Since v2.0.0 Python 3.6 is not supported anymore, so you might want to run the v1 branch.

macias commented 1 year ago

Thank you for quick reply. The latest one, I didn't notice support note. Ok, this explains the problems, once again many thanks for your help.

techouse commented 1 year ago

No problem. :)

It's intriguing though that it allowed you to install v2 even though I've specifically limited it to 3.7+

macias commented 1 year ago

Well, I guess it is the latest one, because I didn't pass any special parameters to pip. But my knowledge of pip/python is very limited.

Out of curiosity, I googled, and checking the installed version is IMHO better using pip show (because it will work depending on pip, not on the package).

Name: mysql-to-sqlite3
Version: 1.4.18
Summary: A simple Python tool to transfer data from MySQL to SQLite 3
Home-page: None
Author: None
Author-email: Klemen Tusar <techouse@gmail.com>
License: MIT
Location: /home/mist/.local/lib/python3.6/site-packages
Requires: simplejson, pytimeparse2, python-slugify, tabulate, tqdm, mysql-connector-python, backports-datetime-fromisoformat, six, Click
Required-by:

So, in theory it should work with python 3.6, correct?

techouse commented 1 year ago

Heh :) Well you can always use pip freeze to get all the installed packages and then just inspect the versions there. :)

macias commented 1 year ago

You are too fast, I updated my previous post :-).

techouse commented 1 year ago

So, in theory it should work with python 3.6, correct?

Theoretically yes, but the last time it's been tested against 3.6 was like 1y ago in v1.4.14.

So you might want to install that specific version as it's known to still work with 3.6.

macias commented 1 year ago

Ha! It worked :-). Thank you very much (and I know more about pip as well :-D).

techouse commented 1 year ago

However, this looks more like an issue with mysql-connector-python. That one dropped Python 3.6 support in v8.0.29, so you might want to install pip install mysql-connector-python==8.0.28