• 1400/02/18

نصب نشدن mysqlclient در ترمینال Cpanel :

سلام استاد،

تو سوال قبلیم : 

https://toplearn.com/ShowQuestion/52773/%D9%85%D8%B4%DA%A9%D9%84-%D8%AF%D8%B1-terminalcpanel

فرمودید ورژن mysql رو همراهش وارد کنم اما اینکار رو هم کردمو باز ارور داد، الان چندروزی هست درگیر این ارورم و کاری ار کار پیش نمیره و تو نت هم راه حلی براش پیدا نکردم 

متن ارور : 

pip install mysqlclient==2.0.3
Collecting mysqlclient==2.0.3
  Using cached mysqlclient-2.0.3.tar.gz (88 kB)
Building wheels for collected packages: mysqlclient
  Building wheel for mysqlclient (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /home/arsadsho/virtualenv/arsad_eshop/3.8/bin/python3.8_bin -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-2pxjgcac/mysqlclient_f1e7df072de9423996950a4ba84169d5/setup.py'"'"'; __file__='"'"'/tmp/pip-install-2pxjgcac/mysqlclient_f1e7df072de9423996950a4ba84169d5/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-vnq84sfh
       cwd: /tmp/pip-install-2pxjgcac/mysqlclient_f1e7df072de9423996950a4ba84169d5/
  Complete output (46 lines):
  mysql_config --version
  ['10.3.29']
  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,0,3,'final',0)"), ('__version__', '2.0.3')]
  /opt/alt/python38/lib64/python3.8/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.8
  creating build/lib.linux-x86_64-3.8/MySQLdb
  copying MySQLdb/__init__.py -> build/lib.linux-x86_64-3.8/MySQLdb
  copying MySQLdb/_exceptions.py -> build/lib.linux-x86_64-3.8/MySQLdb
  copying MySQLdb/connections.py -> build/lib.linux-x86_64-3.8/MySQLdb
  copying MySQLdb/converters.py -> build/lib.linux-x86_64-3.8/MySQLdb
  copying MySQLdb/cursors.py -> build/lib.linux-x86_64-3.8/MySQLdb
  copying MySQLdb/release.py -> build/lib.linux-x86_64-3.8/MySQLdb
  copying MySQLdb/times.py -> build/lib.linux-x86_64-3.8/MySQLdb
  creating build/lib.linux-x86_64-3.8/MySQLdb/constants
  copying MySQLdb/constants/__init__.py -> build/lib.linux-x86_64-3.8/MySQLdb/constants
  copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-3.8/MySQLdb/constants
  copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-3.8/MySQLdb/constants
  copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-3.8/MySQLdb/constants
  copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-3.8/MySQLdb/constants
  copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-3.8/MySQLdb/constants
  running build_ext
  building 'MySQLdb._mysql' extension
  creating build/temp.linux-x86_64-3.8
  creating build/temp.linux-x86_64-3.8/MySQLdb
  /usr/bin/gcc -Wno-unused-result -Wsign-compare -DNDEBUG -D_GNU_SOURCE -fPIC -fwrapv -O2 -D_GNU_SOURCE -fPIC -fwrapv -D_GNU_SOURCE -fPIC -fwrapv -O2 -D_GNU_SOURCE -fPIC -fwrapv -O2 -fPIC -Dversion_info=(2,0,3,'final',0) -D__version__=2.0.3 -I/usr/include/mysql -I/usr/include/mysql/.. -I/opt/alt/python38/include/python3.8 -c MySQLdb/_mysql.c -o build/temp.linux-x86_64-3.8/MySQLdb/_mysql.o -std=c99
  MySQLdb/_mysql.c:46:20: fatal error: Python.h: No such file or directory
   #include "Python.h"
                      ^
  compilation terminated.
  error: command '/usr/bin/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/arsadsho/virtualenv/arsad_eshop/3.8/bin/python3.8_bin -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-2pxjgcac/mysqlclient_f1e7df072de9423996950a4ba84169d5/setup.py'"'"'; __file__='"'"'/tmp/pip-install-2pxjgcac/mysqlclient_f1e7df072de9423996950a4ba84169d5/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'"'"'))' install --record /tmp/pip-record-o7k28zxm/install-record.txt --single-version-externally-managed --compile --install-headers /home/arsadsho/virtualenv/arsad_eshop/3.8/include/site/python3.8/mysqlclient
         cwd: /tmp/pip-install-2pxjgcac/mysqlclient_f1e7df072de9423996950a4ba84169d5/
    Complete output (46 lines):
    mysql_config --version
    ['10.3.29']
    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,0,3,'final',0)"), ('__version__', '2.0.3')]
    /opt/alt/python38/lib64/python3.8/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.8
    creating build/lib.linux-x86_64-3.8/MySQLdb
    copying MySQLdb/__init__.py -> build/lib.linux-x86_64-3.8/MySQLdb
    copying MySQLdb/_exceptions.py -> build/lib.linux-x86_64-3.8/MySQLdb
    copying MySQLdb/connections.py -> build/lib.linux-x86_64-3.8/MySQLdb
    copying MySQLdb/converters.py -> build/lib.linux-x86_64-3.8/MySQLdb
    copying MySQLdb/cursors.py -> build/lib.linux-x86_64-3.8/MySQLdb
    copying MySQLdb/release.py -> build/lib.linux-x86_64-3.8/MySQLdb
    copying MySQLdb/times.py -> build/lib.linux-x86_64-3.8/MySQLdb
    creating build/lib.linux-x86_64-3.8/MySQLdb/constants
    copying MySQLdb/constants/__init__.py -> build/lib.linux-x86_64-3.8/MySQLdb/constants
    copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-3.8/MySQLdb/constants
    copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-3.8/MySQLdb/constants
    copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-3.8/MySQLdb/constants
    copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-3.8/MySQLdb/constants
    copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-3.8/MySQLdb/constants
    running build_ext
    building 'MySQLdb._mysql' extension
    creating build/temp.linux-x86_64-3.8
    creating build/temp.linux-x86_64-3.8/MySQLdb
    /usr/bin/gcc -Wno-unused-result -Wsign-compare -DNDEBUG -D_GNU_SOURCE -fPIC -fwrapv -O2 -D_GNU_SOURCE -fPIC -fwrapv -D_GNU_SOURCE -fPIC -fwrapv -O2 -D_GNU_SOURCE -fPIC -fwrapv -O2 -fPIC -Dversion_info=(2,0,3,'final',0) -D__version__=2.0.3 -I/usr/include/mysql -I/usr/include/mysql/.. -I/opt/alt/python38/include/python3.8 -c MySQLdb/_mysql.c -o build/temp.linux-x86_64-3.8/MySQLdb/_mysql.o -std=c99
    MySQLdb/_mysql.c:46:20: fatal error: Python.h: No such file or directory
     #include "Python.h"
                        ^
    compilation terminated.
    error: command '/usr/bin/gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/arsadsho/virtualenv/arsad_eshop/3.8/bin/python3.8_bin -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0]= '"'"'/tmp/pip-install-2pxjgcac/mysqlclient_f1e7df072de9423996950a4ba84169d5/setup.py'"'"'; __file__='"'"'/tmp/pip-install-2pxjgcac/mysqlclient_f1e7df072de9423996950a4ba84169d5/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'"'"'))' install --record /tmp/pip-record-o7k28zxm/install-record.txt --single-version-externally-managed --compile --install-headers /home/arsadsho/virtualenv/arsad_eshop/3.8/include/site/python3.8/mysqlclient Check the logs forfull command output.
  • 1400/02/18
  • ساعت 17:05

تو سوالات قبلیم اشاره کردم راه حل رو عبارت mysqlclient رو تو قسمت جستجو وارد کنید

و اینجا یه اشاره ریزی می کنم

۱- تیکت بزنید ببینید از این ماژول پشتیزانی میشه

۲-ببینید دسترسی نصب مدیر برای نصب این ماژول دارید

(یه تیکت زدم به مدیریت سایت و کلی از مشکلاتی که اگه این ماژول نصب نشه گفتم اونا هم دسترسی حسابم رو بیشتر کردن و من بدون هیچ مشکلی هر وقت بخوام می تونم این ماژول رو نصب کنم)

 

۳- اگه از مشهد هاست استفاده می کنید از نسخه ۳.۸ (آخرین نسخه برای وب اپلیکیشن استفاده کنید)

 

۴- در صورتی که تیکت زدین و اعلام شد امکان نصب ندارید در یکی از همین سوالات یکی از دوستان درباره ماژولی مشابه صحبت کرده بودن


  • 1400/02/19
  • ساعت 11:25

سلام دوست من

هنگام نصب mysqlclient ، نسخه ی اون رو هم وارد کنین

pip install mysqlclient==2.0.3

logo-samandehi