Errors in mysqlclient in the host through ssh (django,python 3.7.3)



  • Friends, tell me why mysqlclient doesn't want to be installed?The course of action was like https://hoster.by/help/unix-khosting-nastroyka/ustanovka-django/

    If in brief:

    • created a Python app on the spanel
    • Established OBD
    • I went through SSH in a virtual environment.
    • Got a mistake after this team pip install django mysqlclient

       (mysite:3.7)[u91715@whm5 mysite]$ pip install django mysqlclient
    Requirement already satisfied: django in /home/u91715/virtualenv/mysite/3.7/lib/python3.7/site-packages (3.0.5)
    Collecting mysqlclient
    Using cached mysqlclient-1.4.6.tar.gz (85 kB)
    Requirement already satisfied: pytz in /home/u91715/virtualenv/mysite/3.7/lib/python3.7/site-packages (from django) (2019.3)
    Requirement already satisfied: asgiref~=3.2 in /home/u91715/virtualenv/mysite/3.7/lib/python3.7/site-packages (from django) (3.2.7)
    Requirement already satisfied: sqlparse>=0.2.2 in /home/u91715/virtualenv/mysite/3.7/lib/python3.7/site-packages (from django) (0.3.1)
    Building wheels for collected packages: mysqlclient
    Building wheel for mysqlclient (setup.py) ... error
    ERROR: Command errored out with exit status 1:
    command: /home/u91715/virtualenv/mysite/3.7/bin/python3.7_bin -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-f3hrb87f/mysqlclient/setup.py'"'"'; file='"'"'/tmp/pip-install-f3hrb87f/mysqlclient/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-0g98v_yc
    cwd: /tmp/pip-install-f3hrb87f/mysqlclient/
    Complete output (35 lines):
    /bin/mysql_config: line 8: rpm: command not found
    /bin/mysql_config: line 8: rpm: command not found
    /bin/mysql_config: line 8: rpm: command not found
    /bin/mysql_config: line 8: rpm: command not found
    running bdist_wheel
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.7
    creating build/lib.linux-x86_64-3.7/MySQLdb
    copying MySQLdb/init.py -> build/lib.linux-x86_64-3.7/MySQLdb
    copying MySQLdb/exceptions.py -> build/lib.linux-x86_64-3.7/MySQLdb
    copying MySQLdb/compat.py -> build/lib.linux-x86_64-3.7/MySQLdb
    copying MySQLdb/connections.py -> build/lib.linux-x86_64-3.7/MySQLdb
    copying MySQLdb/converters.py -> build/lib.linux-x86_64-3.7/MySQLdb
    copying MySQLdb/cursors.py -> build/lib.linux-x86_64-3.7/MySQLdb
    copying MySQLdb/release.py -> build/lib.linux-x86_64-3.7/MySQLdb
    copying MySQLdb/times.py -> build/lib.linux-x86_64-3.7/MySQLdb
    creating build/lib.linux-x86_64-3.7/MySQLdb/constants
    copying MySQLdb/constants/init.py -> build/lib.linux-x86_64-3.7/MySQLdb/constants
    copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-3.7/MySQLdb/constants
    copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-3.7/MySQLdb/constants
    copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-3.7/MySQLdb/constants
    copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-3.7/MySQLdb/constants
    copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-3.7/MySQLdb/constants
    running build_ext
    building 'MySQLdb.mysql' extension
    creating build/temp.linux-x86_64-3.7
    creating build/temp.linux-x86_64-3.7/MySQLdb
    gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Dversion_info=(1,4,6,'final',0) -D__version
    =1.4.6 -I/opt/alt/python37/include/python3.7m -c MySQLdb/_mysql.c -o build/temp.linux-x86_64-3.7/MySQLdb/_mysql.o
    MySQLdb/_mysql.c:29:19: fatal error: mysql.h: No such file or directory
    #include "mysql.h"
    ^
    compilation terminated.
    error: command 'gcc' failed with exit status 1

    ERROR: Failed building wheel for mysqlclient
    Running setup.py clean for mysqlclient
    Failed to build mysqlclient
    Installing collected packages: mysqlclient
    Running setup.py install for mysqlclient ... error
    ERROR: Command errored out with exit status 1:
    command: /home/u91715/virtualenv/mysite/3.7/bin/python3.7_bin -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-f3hrb87f/mysqlclient/setup.py'"'"'; file='"'"'/tmp/pip-install-f3hrb87f/mysqlclient/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-gzjcm687/install-record.txt --single-version-externally-managed --compile --install-headers /home/u91715/virtualenv/mysite/3.7/include/site/python3.7/mysqlclient
    cwd: /tmp/pip-install-f3hrb87f/mysqlclient/
    Complete output (35 lines):
    /bin/mysql_config: line 8: rpm: command not found
    /bin/mysql_config: line 8: rpm: command not found
    /bin/mysql_config: line 8: rpm: command not found
    /bin/mysql_config: line 8: rpm: command not found
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.7
    creating build/lib.linux-x86_64-3.7/MySQLdb
    copying MySQLdb/init.py -> build/lib.linux-x86_64-3.7/MySQLdb
    copying MySQLdb/exceptions.py -> build/lib.linux-x86_64-3.7/MySQLdb
    copying MySQLdb/compat.py -> build/lib.linux-x86_64-3.7/MySQLdb
    copying MySQLdb/connections.py -> build/lib.linux-x86_64-3.7/MySQLdb
    copying MySQLdb/converters.py -> build/lib.linux-x86_64-3.7/MySQLdb
    copying MySQLdb/cursors.py -> build/lib.linux-x86_64-3.7/MySQLdb
    copying MySQLdb/release.py -> build/lib.linux-x86_64-3.7/MySQLdb
    copying MySQLdb/times.py -> build/lib.linux-x86_64-3.7/MySQLdb
    creating build/lib.linux-x86_64-3.7/MySQLdb/constants
    copying MySQLdb/constants/init.py -> build/lib.linux-x86_64-3.7/MySQLdb/constants
    copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-3.7/MySQLdb/constants
    copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-3.7/MySQLdb/constants
    copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-3.7/MySQLdb/constants
    copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-3.7/MySQLdb/constants
    copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-3.7/MySQLdb/constants
    running build_ext
    building 'MySQLdb.mysql' extension
    creating build/temp.linux-x86_64-3.7
    creating build/temp.linux-x86_64-3.7/MySQLdb
    gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Dversion_info=(1,4,6,'final',0) -D__version
    =1.4.6 -I/opt/alt/python37/include/python3.7m -c MySQLdb/_mysql.c -o build/temp.linux-x86_64-3.7/MySQLdb/_mysql.o
    MySQLdb/_mysql.c:29:19: fatal error: mysql.h: No such file or directory
    #include "mysql.h"
    ^
    compilation terminated.
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
    ERROR: Command errored out with exit status 1: /home/u91715/virtualenv/mysite/3.7/bin/python3.7_bin -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-f3hrb87f/mysqlclient/setup.py'"'"'; file='"'"'/tmp/pip-install-f3hrb87f/mysqlclient/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-gzjcm687/install-record.txt --single-version-externally-managed --compile --install-headers /home/u91715/virtualenv/mysite/3.7/include/site/python3.7/mysqlclient Check the logs for full command output.



  • It's all written in that reference.

    Compiler-supported tariff option: pip install django mysqlclient Option for the remaining tariffs: pip install django pymysql So different libraries can be used to work with the database. Default, Django is expected to work with a compilable mysqlclient module. The pymysql option does not require a compiler, but corrects will be needed in the application launch code and those set out below. Computer-supported video Push through pymysql Or write that support.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2