Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
import mysqldb fails - no module named mysqldb
-
Hi,
Pythonista provides a msql folder in the Python Modules area. But unfortunately using „import mysqldb“ fails! I get the message: No Module named mysqldb.
I would be glad about any hint! Thanks in advance! -
Where do you see a mysql folder? I do not seem to have it.
-
...you go to Python Modules > Standard Library (3.6) > ...and then search! You can even select the mysql folder as a favorite, but no chance to copy or move it anywhere else.
-
@xyz200, it looks to be contained sqlalchemy as some kind of a connector for the mysql ”dialect”, not an independent library. For you to be able to import something, it would need to be in the root directory, or you would need to explicitly lay out the path with the dot notation, e.g. sqlalchemy.dialects.mysql (which is probably not a stand-alone useful library for a mysql client).
But if you need to access a mysql db, why not try out sqlalchemy? I understand that people who still use sql databases like it.
-
Thanks a lot for your feedback! I will try and let you know about the results!
-
Current situation looks as follows:
import sqlalchemy.dialects.mysql.pymysql as mariadb
conn = mariadb.MySQLDialect_pymysql.connect(host= 'myhost', user = 'myuser', passwd='', db='mydb', port = 3307)
Error Message: TypeError: connect() missing 1 required positional argument: 'self'
...guess, I will have to dig deeper into the dot notation specifics.
-
@dominik, I was not really suggesting that you try to use sqlalchemy-internal module this way, unless you find a clear documentation supporting it in their docs.
I trust you saw the discussion in the other MySQL thread that just popped up?
-
Thank you very much! I will have a look at that!
For the time being, I figured a kind of a workaround for my purposes in pythonista (& editorial), using paramiko and this simple script of omz:
https://gist.github.com/omz/9cc60b13658b565b34cc
...plus a shell script.