error: command 'x86_64-linux-gnu-gcc' when installing mysqlclient

后端 未结 5 1182
北恋
北恋 2020-12-14 03:23

I installed django 1.8.5 in virtualenv and using python 3.4.3 the worked displayed the it works page when using sqlite

I wanted to use mysql and I\'

相关标签:
5条回答
  • 2020-12-14 03:44

    For Ubuntu you also need to install build-essential

    sudo apt-get install build-essential
    
    0 讨论(0)
  • 2020-12-14 03:57

    For those using different versions, such as Python 3.5, 3.6 or 3.7 I found this:

    Part I

    For Python 2.x use:

      $ sudo apt-get install python-dev
    

    For Python 2.7 use:

      $ sudo apt-get install libffi-dev
    

    For Python 3.x use:

      $ sudo apt-get install python3-dev
    

    For Python 3.4 use:

      $ sudo apt-get install python3.4-dev
    

    For Python 3.7 use:

      $ sudo apt-get install python3.7-dev
    

    Part II

    If this still doesn't help, others have pointed out to install

      $ sudo apt-get install build-essential
    

    and finally

      $ sudo apt-get install libssl-dev
    

    But the last two didn't help me personally. Just in case, hope it helps you.

    0 讨论(0)
  • 2020-12-14 04:01

    You need to install python-dev:

    sudo apt-get install python-dev
    

    And, since you are using python3:

    sudo apt-get install python3-dev
    

    This command should help you.

    If you are using mac os you might try:

    brew update && brew rm python3 && brew install python3
    

    You need to brew has been installed already, otherwise you can install it. It is very useful for getting packages in Mac OS. http://brew.sh/

    0 讨论(0)
  • 2020-12-14 04:02

    For those using python3.5:

    apt-get install python3.5-dev
    wget https://bootstrap.pypa.io/get-pip.py
    python3.5 get-pip.py
    pip3.5 install mysqlclient
    
    0 讨论(0)
  • 2020-12-14 04:03

    Tried all of the above suggestions and a few found elsewhere and nothing worked. In the end the solution was simple enough (courtesy of ignacionf on GitHub):

    pip install git+https://github.com/PyMySQL/mysqlclient-python.git
    
    0 讨论(0)
提交回复
热议问题