Неустранимая ошибка: файл «my_config.h» не найден на Mac Mojave во время установки Python MySQL - PullRequest
0 голосов
/ 30 ноября 2018

У меня есть проект, который зависит от MySQL-python == 1.2.5 Я получил ответы вроде this , this и это .Однако ни один из шагов, упомянутых во всех этих ответах, не помог.Таким образом, этот проект является приложением Django с зависимостью от MySQL-python, как упомянуто выше.Проект находится в Python 2.7 и не может быть обновлен до Python 3.X.Когда я запускаю,

     pip install MySQL-python

я получаю следующее сообщение об ошибке:

  Collecting MySQL-python
  Using cached https://files.pythonhosted.org/packages/a5/e9/51b544da85a36a68debe7a7091f068d802fc515a3a202652828c73453cad/MySQL-python-1.2.5.zip
  Building wheels for collected packages: MySQL-python
  Running setup.py bdist_wheel for MySQL-python ... error
  Complete output from command /Users/user.m2/.virtualenvs/del/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/f3/t5bk652s70g8f7x3q6_q290drg8nf8/T/pip-install-YiTuKO/MySQL-python/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 /private/var/folders/f3/t5bk652s70g8f7x3q6_q290drg8nf8/T/pip-wheel-e63D7H --python-tag cp27:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.14-intel-2.7
  copying _mysql_exceptions.py -> build/lib.macosx-10.14-intel-2.7
  creating build/lib.macosx-10.14-intel-2.7/MySQLdb
  copying MySQLdb/__init__.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb
  copying MySQLdb/converters.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb
  copying MySQLdb/connections.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb
  copying MySQLdb/cursors.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb
  copying MySQLdb/release.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb
  copying MySQLdb/times.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb
  creating build/lib.macosx-10.14-intel-2.7/MySQLdb/constants
  copying MySQLdb/constants/__init__.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb/constants
  copying MySQLdb/constants/CR.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb/constants
  copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb/constants
  copying MySQLdb/constants/ER.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb/constants
  copying MySQLdb/constants/FLAG.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb/constants
  copying MySQLdb/constants/REFRESH.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb/constants
  copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb/constants
  running build_ext
  building '_mysql' extension
  creating build/temp.macosx-10.14-intel-2.7
  cc -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/local/Cellar/mysql/8.0.12/include/mysql -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.14-intel-2.7/_mysql.o
  _mysql.c:44:10: fatal error: 'my_config.h' file not found
  #include "my_config.h"
          ^~~~~~~~~~~~~
  1 error generated.
  error: command 'cc' failed with exit status 1

  ----------------------------------------
  Failed building wheel for MySQL-python
  Running setup.py clean for MySQL-python
Failed to build MySQL-python
Installing collected packages: MySQL-python
  Running setup.py install for MySQL-python ... error
    Complete output from command /Users/user.m2/.virtualenvs/del/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/f3/t5bk652s70g8f7x3q6_q290drg8nf8/T/pip-install-YiTuKO/MySQL-python/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/f3/t5bk652s70g8f7x3q6_q290drg8nf8/T/pip-record-gOGq_n/install-record.txt --single-version-externally-managed --compile --install-headers /Users/user.m2/.virtualenvs/del/include/site/python2.7/MySQL-python:
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.14-intel-2.7
    copying _mysql_exceptions.py -> build/lib.macosx-10.14-intel-2.7
    creating build/lib.macosx-10.14-intel-2.7/MySQLdb
    copying MySQLdb/__init__.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb
    copying MySQLdb/converters.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb
    copying MySQLdb/connections.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb
    copying MySQLdb/cursors.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb
    copying MySQLdb/release.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb
    copying MySQLdb/times.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb
    creating build/lib.macosx-10.14-intel-2.7/MySQLdb/constants
    copying MySQLdb/constants/__init__.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb/constants
    copying MySQLdb/constants/CR.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb/constants
    copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb/constants
    copying MySQLdb/constants/ER.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb/constants
    copying MySQLdb/constants/FLAG.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb/constants
    copying MySQLdb/constants/REFRESH.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb/constants
    copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.14-intel-2.7/MySQLdb/constants
    running build_ext
    building '_mysql' extension
    creating build/temp.macosx-10.14-intel-2.7
    cc -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/local/Cellar/mysql/8.0.12/include/mysql -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.14-intel-2.7/_mysql.o
    _mysql.c:44:10: fatal error: 'my_config.h' file not found
    #include "my_config.h"
            ^~~~~~~~~~~~~
    1 error generated.
    error: command 'cc' failed with exit status 1

    ----------------------------------------
Command "/Users/user.m2/.virtualenvs/del/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/f3/t5bk652s70g8f7x3q6_q290drg8nf8/T/pip-install-YiTuKO/MySQL-python/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/f3/t5bk652s70g8f7x3q6_q290drg8nf8/T/pip-record-gOGq_n/install-record.txt --single-version-externally-managed --compile --install-headers /Users/user.m2/.virtualenvs/del/include/site/python2.7/MySQL-python" failed with error code 1 in /private/var/folders/f3/t5bk652s70g8f7x3q6_q290drg8nf8/T/pip-install-YiTuKO/MySQL-python/

Я пытался использовать другой виртуальный env, пытался обновить homebrew перед выполнением вышеуказанных шагов.Я до сих пор не могу заставить это установить.Есть ли способ заставить это работать?

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...