Python 3.4.0 with MySQL database

前端 未结 11 2570
孤城傲影
孤城傲影 2020-11-27 14:56

I have installed Python version 3.4.0 and I would like to do a project with MySQL database. I downloaded and tried installing MySQL

11条回答
  •  不知归路
    2020-11-27 15:29

    It seems that at the moment Ubuntu 15.10 has a but with python3 and pip3.

    As elaborated in this article.

    The problem makes pip3 install to python3.5 while python3 is actually running python3.4 :(

    Until a proper solution will be available via the updates you can do one of the following:

    run

    python3 -m pip install pymysql
    

    instead of

    pip3 install pymysql
    

    (or any other package)

    Now

    import pymysql
    

    should work in python3 and in idle3.

    Alternatively, if you explicitly need 3.5 you can use explicit python3.5 instead of python3. but idle3 will still point to 3.4...

提交回复
热议问题