omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    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

    Pythonista
    2
    8
    6096
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • dominik
      dominik last edited by

      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!

      1 Reply Last reply Reply Quote 0
      • mikael
        mikael last edited by

        Where do you see a mysql folder? I do not seem to have it.

        1 Reply Last reply Reply Quote 0
        • dominik
          dominik last edited by

          ...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.

          mikael 1 Reply Last reply Reply Quote 0
          • mikael
            mikael @dominik last edited by

            @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.

            1 Reply Last reply Reply Quote 0
            • dominik
              dominik last edited by

              Thanks a lot for your feedback! I will try and let you know about the results!

              1 Reply Last reply Reply Quote 0
              • dominik
                dominik last edited by

                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.

                mikael 1 Reply Last reply Reply Quote 0
                • mikael
                  mikael @dominik last edited by

                  @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?

                  1 Reply Last reply Reply Quote 0
                  • dominik
                    dominik last edited by

                    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.

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post
                    Powered by NodeBB Forums | Contributors