2

this is my first time question on stackoverflow.

a few days ago, i've been trying to setup a python app on my cpanel server. it was about a django project i've been working on. so i wanted to install mysqlclient using pip tool.

cPanel, cloudlinux os, apache latest version, python and ruby selector installed

i've bypassed this problem by switching from python3.7 to 3.6 !!! but i still want to know why i'm getting these errors using python3.7?

pip install mysqlclient:

    version node not found for symbol SSLeay@OPENSSL_1.0.1
    /usr/bin/ld: failed to set dynamic section sizes: Bad value
    collect2: error: ld returned 1 exit status
    error: command 'gcc' failed with exit status 1

pip install mysqlclient output:

    Collecting mysqlclient
    Using cached
https://files.pythonhosted.org/packages/f4/f1/3bb6f64ca7a429729413e6556b7ba5976df06019a5245a43d36032f1061e/mysqlclient-1.4.2.post1.tar.gz
Building wheels for collected packages: mysqlclient
  Building wheel for mysqlclient (setup.py) ... error
  ERROR: Complete output from command /home/airtab/virtualenv/public__html_test/3.7/bin/python3.7 -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-4c1a9d8u/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-fm79t5sn --python-tag cp37:
  ERROR: /opt/alt/python37/lib64/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'long_description_content_type'
    warnings.warn(msg)
  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,2,'post',1) -D__version__=1.4.2.post1 -I/usr/include/mysql -I/usr/include/mysql/.. -I/opt/alt/python37/include/python3.7m -c MySQLdb/_mysql.c -o build/temp.linux-x86_64-3.7/MySQLdb/_mysql.o
  gcc -pthread -shared -Wl,-z,relro -Wl,-rpath=/opt/alt/python37/lib64 -L/opt/alt/openssl/lib64 -Wl,-rpath=/opt/alt/openssl/lib64 build/temp.linux-x86_64-3.7/MySQLdb/_mysql.o -L/usr/lib64/mysql -L/opt/alt/python37/lib64 -lmariadb -lpthread -lz -ldl -lm -lssl -lcrypto -lpython3.7m -o build/lib.linux-x86_64-3.7/MySQLdb/_mysql.cpython-37m-x86_64-linux-gnu.so
  /usr/bin/ld: build/lib.linux-x86_64-3.7/MySQLdb/_mysql.cpython-37m-x86_64-linux-gnu.so: version node not found for symbol SSLeay@OPENSSL_1.0.1
  /usr/bin/ld: failed to set dynamic section sizes: Bad value
  collect2: error: ld returned 1 exit status
  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: Complete output from command /home/airtab/virtualenv/public__html_test/3.7/bin/python3.7 -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-4c1a9d8u/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-xtuvq5ww/install-record.txt --single-version-externally-managed --compile --install-headers /home/airtab/virtualenv/public__html_test/3.7/include/site/python3.7/mysqlclient:
    ERROR: /opt/alt/python37/lib64/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'long_description_content_type'
      warnings.warn(msg)
    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,2,'post',1) -D__version__=1.4.2.post1 -I/usr/include/mysql -I/usr/include/mysql/.. -I/opt/alt/python37/include/python3.7m -c MySQLdb/_mysql.c -o build/temp.linux-x86_64-3.7/MySQLdb/_mysql.o
    gcc -pthread -shared -Wl,-z,relro -Wl,-rpath=/opt/alt/python37/lib64 -L/opt/alt/openssl/lib64 -Wl,-rpath=/opt/alt/openssl/lib64 build/temp.linux-x86_64-3.7/MySQLdb/_mysql.o -L/usr/lib64/mysql -L/opt/alt/python37/lib64 -lmariadb -lpthread -lz -ldl -lm -lssl -lcrypto -lpython3.7m -o build/lib.linux-x86_64-3.7/MySQLdb/_mysql.cpython-37m-x86_64-linux-gnu.so
    /usr/bin/ld: build/lib.linux-x86_64-3.7/MySQLdb/_mysql.cpython-37m-x86_64-linux-gnu.so: version node not found for symbol SSLeay@OPENSSL_1.0.1
    /usr/bin/ld: failed to set dynamic section sizes: Bad value
    collect2: error: ld returned 1 exit status
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command "/home/airtab/virtualenv/public__html_test/3.7/bin/python3.7 -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-4c1a9d8u/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-xtuvq5ww/install-record.txt --single-version-externally-managed --compile --install-headers /home/airtab/virtualenv/public__html_test/3.7/include/site/python3.7/mysqlclient" failed with error code 1 in /tmp/pip-install-4c1a9d8u/mysqlclient/

1 Answer 1

2

If you using cpanel

Please check and allow gcc / compiler

  1. Login WHM
  2. Security Center
  3. Compiler Access

Allow spesific user and enable compiler

If you been enable compiler, please restart virtualenv and try again to install using command

pip install mysqlclient

if having problem on pip please upgrade pip using command : pip install --upgrade pip

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.