1

I tried to install mysqlclient in venv in remote server's cpanel by

pip install mysqlclient

It showed me error

    Collecting mysqlclient
      Using cached mysqlclient-2.1.1.tar.gz (88 kB)
      Preparing metadata (setup.py) ... done
    Building wheels for collected packages: mysqlclient
      Building wheel for mysqlclient (setup.py) ... error
      ERROR: Command errored out with exit status 1:
       command: /home/ssndebid/virtualenv/debidwar/3.10/bin/python3.10_bin -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-_v9zv2th/mysqlclient_4c8a2d7ab62f440eaf9a10d1c071662f/setup.py'"'"'; __file__='"'"'/tmp/pip-install-_v9zv2th/mysqlclient_4c8a2d7ab62f440eaf9a10d1c071662f/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-q5rbsxez
           cwd: /tmp/pip-install-_v9zv2th/mysqlclient_4c8a2d7ab62f440eaf9a10d1c071662f/
      Complete output (39 lines):
      mysql_config --version
      ['10.3.39']
    mysql_config --libs
      ['-L/usr/lib64', '-lmariadb', '-pthread', '-ldl', '-lm', '-lpthread', '-lssl', '-lcrypto', '-lz']
      mysql_config --cflags
      ['-I/usr/include/mysql', '-I/usr/include/mysql/..']
      ext_options:
        library_dirs: ['/usr/lib64']
        libraries: ['mariadb', 'dl', 'm', 'pthread']
        extra_compile_args: ['-std=c99']
        extra_link_args: ['-pthread']
        include_dirs: ['/usr/include/mysql', '/usr/include/mysql/..']
        extra_objects: []
        define_macros: [('version_info', "(2,1,1,'final',0)"), ('__version__', '2.1.1')]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-3.10
    creating build/lib.linux-x86_64-3.10/MySQLdb
      copying MySQLdb/__init__.py -> build/lib.linux-x86_64-3.10/MySQLdb
      copying MySQLdb/_exceptions.py -> build/lib.linux-x86_64-3.10/MySQLdb
      copying MySQLdb/connections.py -> build/lib.linux-x86_64-3.10/MySQLdb
      copying MySQLdb/converters.py -> build/lib.linux-x86_64-3.10/MySQLdb
      copying MySQLdb/cursors.py -> build/lib.linux-x86_64-3.10/MySQLdb
      copying MySQLdb/release.py -> build/lib.linux-x86_64-3.10/MySQLdb
      copying MySQLdb/times.py -> build/lib.linux-x86_64-3.10/MySQLdb
      creating build/lib.linux-x86_64-3.10/MySQLdb/constants
      copying MySQLdb/constants/__init__.py -> build/lib.linux-x86_64-3.10/MySQLdb/constants
      copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-3.10/MySQLdb/constants
      copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-3.10/MySQLdb/constants
      copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-3.10/MySQLdb/constants
      copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-3.10/MySQLdb/constants
      copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-3.10/MySQLdb/constants
      running build_ext
      creating build/temp.linux-x86_64-3.10
    creating build/temp.linux-x86_64-3.10/MySQLdb
      gcc -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -D_GNU_SOURCE -fPIC -fwrapv -O2 -pthread -Wno-unused-result -Wsign-compare -g -std=c99 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers-Werror=implicit-function-declaration -D_GNU_SOURCE -fPIC -fwrapv -D_GNU_SOURCE -fPIC -fwrapv -O2 -pthread -Wno-unused-result -Wsign-compare -g -std=c99 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -D_GNU_SOURCE -fPIC -fwrapv -O2 -pthread -Wno-unused-result -Wsign-compare -g -std=c99 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -fPIC -Dversion_info=(2,1,1,'final',0) -D__version__=2.1.1 -I/usr/include/mysql -I/usr/include/mysql/.. -I/home/ssndebid/virtualenv/debidwar/3.10/include -I/opt/alt/python310/include/python3.10 -c MySQLdb/_mysql.c -o build/temp.linux-x86_64-3.10/MySQLdb/_mysql.o -std=c99
      error: command '/bin/gcc' failed: Permission denied
      ----------------------------------------
      ERROR: Failed building wheel for mysqlclient
      Running setup.py clean for mysqlclient
    Failed to build mysqlclient

Please help me what should I do? I didn't find any solution. No description more. No description more. No description more. No description more. No description more. No description more.

mestu
  • 46
  • 2
  • try using this if don't have permision admin ```pip install --user mysqlclient ``` or using this `pip install --user pymysql ` These packages provide similar functionality – Zakaria Zhlat May 28 '23 at 07:26
  • https://stackoverflow.com/questions/51117503/python-3-7-failed-building-wheel-for-mysql-python – ilyasbbu May 28 '23 at 08:26
  • @ZakariaZhlat still same problem – mestu May 28 '23 at 13:32
  • Thanks @ilyasbbu but it is for ubuntu what you provided. I faced issue in remote server while installing django. – mestu May 28 '23 at 13:33

0 Answers0