Reputation: 1044
I have installed mysql workbench v. 8.0.13, and am trying to run the migration tool, but I get an error:
Could not import the pyodbc python module. You need pyodbc 2.1.8 or newer for migrations from RDBMSes other than MySQL.
I have installed pyodbc:
Python 3.7.0 (default, Sep 28 2018, 16:44:32)
[GCC 8.2.1 20180831] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyodbc
>>> pyodbc.version
'4.0.24'
How can I fix this problem?
OS: Linux my-pc 4.19.0-3-MANJARO #1 SMP PREEMPT Sat Oct 27 22:40:22 UTC 2018 x86_64 GNU/Linux
Upvotes: 3
Views: 10506
Reputation: 11
Update as of 11/4/2024: I was running into this issue on MySQL WorkBench v8.0.34.Instead of reinstalling python, I tried upgrading to the most recent version (v8.0.40) and it worked for me.
Upvotes: 1
Reputation: 61
I was having a similar issue and came across this question first in my searching. However, the following question and answer is what finally solved my problem: Issue while starting migration wizard in mysql workbench
I downgraded MySQL Workbench to 8.0.20 and pyodbc error was gone!
There are additional steps (as per above link) you can take to copy off the necessary files and upgrade again:
Upvotes: 1
Reputation: 688
In my situation I was trying to use SQL WorkBench's database migration wizard to migrate SQL Server tables to MySQL and ran into this pyodbc error.
Building onto @Flo answer above for Windows 10:
Upvotes: 2
Reputation: 35
I faced the same issue with MySQL Workbench v. 8.0.22. Resolved it by installing Python2.7 and renaming the python27.ddl to force the MySQL Workbench to use it from python installation
Upvotes: 1
Reputation: 499
I faced the same problem on Windows and replacing python 3.8 install with a 2.7 one wasn't enough.
That was very weird because when I launched a python console, I was able to import pyodbc module. But when I launched the python.exe that is included in Mysql Workbench installation directory, the module couldn't be loaded (an error was telling that a dll couldn't be find, without telling which one).
I first thought this was related to a sys.path difference between these two contexts, but the loading error persisted after having make the paths identical.
Finally I found a python27.dll file in the Mysql Workbench directory, and renaming this file to python27.notdll (to prevent if from being loaded) solved the pyodbc loading problem.
I don't know what could be the side effects of this dll disabling, but as far as python 2.7 is already installed and works, I don't think this should be a problem.
Anyway, the migration wizard is now working.
Upvotes: 6