• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

1.2K
Views
Instale mysqlclient para Django Python en Mac OS X Sierra

ya he instalado

  • Pitón 2.7.13
  • Django 1.11
  • MySQL 5.7.17

Quiero usar MySQL con Django, pero después de instalar el conector mysql intenté instalar mysqlclient para Python en $ pip install mysqlclient , pero tengo este problema:

 Collecting mysqlclient Using cached mysqlclient-1.3.10.tar.gz Complete output from command python setup.py egg_info: Traceback (most recent call last): File "<string>", line 1, in <module> File "/private/var/folders/y_/c31n_1v12v169zfv829p_v_80000gn/T/pip-build-f51KhW/mysqlclient/setup.py", line 17, in <module> metadata, options = get_config() File "setup_posix.py", line 54, in get_config libraries = [dequote(i[2:]) for i in libs if i.startswith('-l')] File "setup_posix.py", line 12, in dequote if s[0] in "\"'" and s[0] == s[-1]: IndexError: string index out of range ---------------------------------------- Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/y_/c31n_1v12v169zfv829p_v_80000gn/T/pip-build-f51KhW/mysqlclient/
about 3 years ago · Santiago Trujillo
3 answers
Answer question

0

Necesitaba lo siguiente para compilar/instalar mysqlclient

 brew install mysql-client # mysql-client is not on the `PATH` by default export PATH="/usr/local/opt/mysql-client/bin:$PATH" # openssl is not on the link path by default export LIBRARY_PATH="$LIBRARY_PATH:/usr/local/opt/openssl/lib/"

Entonces podría pip wheel mysqlclient / pip install mysqlclient con éxito

about 3 years ago · Santiago Trujillo Report

0

También me he encontrado con este problema, a continuación se muestra mi paso:

1. brew install mysql-connector-c

2. pip install mysqlclient

y luego encontré este error, rastreé el código fuente, pero resolví este y luego ocurrió el otro error.

así que cambié la forma de instalar mysqlclient, solo:

1. brew install mysql

2. pip install mysqlclient

esto funcionó para mí, no ocurrió ningún error.

about 3 years ago · Santiago Trujillo Report

0

Instale mysql-client en lugar de mysql si no planea tener mysql en su computadora

brew install mysql-client

echo 'export PATH="/usr/local/opt/mysql-client/bin:$PATH"' >> ~/.bash_profile

source ~/.bash_profile

pip install mysqlclient

exportar LDFLAGS="-L/usr/local/opt/openssl/lib"

exportar CPPFLAGS="-I/usr/local/opt/openssl/include"

about 3 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error