Menu

Python 3 and MySQL

davispuh
2010-08-30
2014-07-17
<< < 1 2 (Page 2 of 2)
  • davispuh

    davispuh - 2011-02-26

    LOL :D again typo in previous post with PS :D

    I meant It's very bad that posts CAN'T be edited :(

    PS. It really s*cks....

     
  • davispuh

    davispuh - 2011-02-26

    I forgot one step, after you install Python, you need download and install
    distribute

     
  • Anonymous

    Anonymous - 2011-04-01

    I am getting this error:

    building '_mysql' extension
    Traceback (most recent call last):
      File "setup.py", line 18, in <module>
        setup(**metadata)
      File "C:\Python32\lib\distutils\core.py", line 149, in setup
        dist.run_commands()
      File "C:\Python32\lib\distutils\dist.py", line 919, in run_commands
        self.run_command(cmd)
      File "C:\Python32\lib\distutils\dist.py", line 938, in run_command
        cmd_obj.run()
      File "C:\Python32\lib\site-packages\setuptools\command\install.py", line 73, i
    n run
        self.do_egg_install()
      File "C:\Python32\lib\site-packages\setuptools\command\install.py", line 93, i
    n do_egg_install
        self.run_command('bdist_egg')
      File "C:\Python32\lib\distutils\cmd.py", line 315, in run_command
        self.distribution.run_command(command)
      File "C:\Python32\lib\distutils\dist.py", line 938, in run_command
        cmd_obj.run()
      File "C:\Python32\lib\site-packages\setuptools\command\bdist_egg.py", line 179
    , in run
        cmd = self.call_command('install_lib', warn_dir=0)
      File "C:\Python32\lib\site-packages\setuptools\command\bdist_egg.py", line 166
    , in call_command
        self.run_command(cmdname)
      File "C:\Python32\lib\distutils\cmd.py", line 315, in run_command
        self.distribution.run_command(command)
      File "C:\Python32\lib\distutils\dist.py", line 938, in run_command
        cmd_obj.run()
      File "C:\Python32\lib\site-packages\setuptools\command\install_lib.py", line 2
    0, in run
        self.build()
      File "C:\Python32\lib\distutils\command\install_lib.py", line 108, in build
        self.run_command('build_ext')
      File "C:\Python32\lib\distutils\cmd.py", line 315, in run_command
        self.distribution.run_command(command)
      File "C:\Python32\lib\distutils\dist.py", line 938, in run_command
        cmd_obj.run()
      File "C:\Python32\lib\site-packages\setuptools\command\build_ext.py", line 46,
     in run
        _build_ext.run(self)
      File "C:\Python32\lib\distutils\command\build_ext.py", line 347, in run
        self.build_extensions()
      File "C:\Python32\lib\distutils\command\build_ext.py", line 456, in build_exte
    nsions
        self.build_extension(ext)
      File "C:\Python32\lib\site-packages\setuptools\command\build_ext.py", line 182
    , in build_extension
        _build_ext.build_extension(self,ext)
      File "C:\Python32\lib\distutils\command\build_ext.py", line 511, in build_exte
    nsion
        depends=ext.depends)
      File "C:\Python32\lib\distutils\msvc9compiler.py", line 463, in compile
        self.initialize()
      File "C:\Python32\lib\distutils\msvc9compiler.py", line 374, in initialize
        vc_env = query_vcvarsall(VERSION, plat_spec)
      File "C:\Python32\lib\distutils\msvc9compiler.py", line 289, in query_vcvarsal
    l
        raise ValueError(str(list(result.keys())))
    ValueError: ['path']
    Presione una tecla para continuar . . .
    

    I have installed python 3.2, mysql 5.5, distutils, MSVisual studio express 10.
    All 64 bits, but i keep getting that error. I have python.exe and the mysql
    bin files on path. If somebody get this error and know the solution please
    tellme how to fix.

     
  • davispuh

    davispuh - 2011-04-01

    hmm... can't think at first what's wrong....

    does in registry

    SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{2DB39FB6-161E-44E7-B2A1-B654C85EFBC1}\InstallLocation
    

    point to your mysql dir?

    also it could be because of VS Express, I'm not tried compile with it...

    Or it's possible that WinSDK is required, I'm not really sure, because I
    compile everything on my development machine and there I've installed many
    apps and other junks too...

    When I'll be time I'll try compile on clean VM so that I can see what exactly
    is required... (I don't know when it will be...)

     
  • davispuh

    davispuh - 2011-04-01

    look that key in HKEY_LOCAL_MACHINE

     
  • C.Renaudo

    C.Renaudo - 2011-04-05

    Sorry for my late reply, i did not get a mail warning for the replys on the
    thread.

    Finally i get the compiler working. The problem was that i had not installed
    the SDK, the express edition can compile only 32 bits target, you need the sdk
    for compile on amd64 or ia64 targets.

    First i follow the guide from:

    http://mattptr.net/2010/07/28/building-python-extensions-in-a-modern-windows-
    environment/

    later i use the fix for MsVS 10 from (end of the page):

    http://mail.scipy.org/pipermail/numpy-
    discussion/2010-August/052408.html

    And everything works.

    My test:

    >>> import _mysql
    >>> db=_mysql.connect("localhost","root","123456","l2jdb")
    >>> db.query("""SELECT * FROM accounts""")
    >>> r=db.store_result()
    >>> print(r)
    <_mysql.result object at 33e8900>
    >>> r.fetch_row()
    (('angelus_ira', 'qcd2d2b3hPVOH9NIDBk++Tu+/H4=', '1298485315640', '1', '127.0.0.1', '1', None, '192.168.1.118', '192.168.1.1', '0.0.0.0', '0.0.0.0', '0.0.0.0'),)
    

    XD

     
  • davispuh

    davispuh - 2011-04-12

    I created repository at github for this py3 lib, so there always will be newest version...

     
  • davispuh

    davispuh - 2011-05-11

    I fixed a bug... look in github here for updates and new versions... I think I'll not post here
    anymore... you can create issues there if it concerns on this py3 lib...

     
  • hemn

    hemn - 2011-06-05

    Thanks! IIm trying MySQLconn, mysql, pymysql but only this package really work
    on utf-8 mysql5.1 db with python 3.x

     
  • davispuh

    davispuh - 2014-07-17

    I've some news regarding this. So I did a bit of work, basically I took farcepest/MySQLdb1 repository from GitHub and cherry-picked my repository commits on top of his repository v1.2.3 (Git is awesome, there was no common commit history). Then I merged this branch on top of latest MySQLdb 1.2.5 and fixed all conflicts, so now it does include all fixes and is fully up-to-date. You can find this branch here https://github.com/davispuh/MySQLdb1/tree/MySQL-for-Python3

    All tests does pass and it have same behavior as my original port so it's a bit different than what pure MySQLdb would be.

    I did tested it on Arch Linux with Python 3.4.1 (x64) and Windows 8.1 (x64) with Python 3.4.1 (x86)

    Anyway maybe some day I'll look what's wrong with MySQLdb1-1.3 branch and why Python 3 doesn't really work there, but I can say that there's a bit different approach used with Unicode strings than I did and some other differences.

     
    • Chengwen Bo

      Chengwen Bo - 2014-07-17
      <HTML> <HEAD> <META http-equiv="Content-Type" content="text/html; charset=gb2312"> </HEAD>

      <BODY>

      您发给我的信件已经收到。


      This is an automatic reply, confirming that your e-mail was received.Thank you



      邮箱使用小提示


      想让对方更及时看到你的邮件,可以试试发到"对方手机号@163.com"。



      无需事先开通,还有短信提醒。了解网易手机邮箱详情


      </body>
      </html>

       
      • Chengwen Bo

        Chengwen Bo - 2014-07-17
        <HTML> <HEAD> <META http-equiv="Content-Type" content="text/html; charset=gb2312"> </HEAD>

        <BODY>

        您发给我的信件已经收到。


        This is an automatic reply, confirming that your e-mail was received.Thank you



        邮箱使用小提示


        想让对方更及时看到你的邮件,可以试试发到"对方手机号@163.com"。



        无需事先开通,还有短信提醒。了解网易手机邮箱详情


        </body>
        </html>

         
        • Chengwen Bo

          Chengwen Bo - 2014-07-17
          <HTML> <HEAD> <META http-equiv="Content-Type" content="text/html; charset=gb2312"> </HEAD>

          <BODY>

          您发给我的信件已经收到。


          This is an automatic reply, confirming that your e-mail was received.Thank you



          邮箱使用小提示


          想让对方更及时看到你的邮件,可以试试发到"对方手机号@163.com"。



          无需事先开通,还有短信提醒。了解网易手机邮箱详情


          </body>
          </html>

           
<< < 1 2 (Page 2 of 2)

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.