FMCorz / mdk

Moodle Development Kit. A collection of tools meant to make developers' lives easier.
GNU General Public License v3.0
85 stars 47 forks source link

install errors in debian 10 (debian:buster) #184

Open marcoblancas opened 5 years ago

marcoblancas commented 5 years ago

Please, help installing mdk in Debian 10. Some errors related with mysql (now mariadb in Debian 10).

I tried to change some packages in the apt-get install but not sure what I'm doing wrong.

root@1f982efe8590:/# cat /etc/issue
Debian GNU/Linux 10 \n \l

root@1f982efe8590:/# apt-get install python-pip libmysqlclient-dev libpq-dev python-dev unixodbc-dev
Leyendo lista de paquetes... Hecho
Creando árbol de dependencias       
Leyendo la información de estado... Hecho
El paquete libmysqlclient-dev no está disponible, pero algún otro paquete hace referencia
a él. Esto puede significar que el paquete falta, está obsoleto o sólo se
encuentra disponible desde alguna otra fuente
Sin embargo, los siguientes paquetes lo reemplazan:
  libmariadb-dev-compat libmariadb-dev

E: El paquete «libmysqlclient-dev» no tiene un candidato para la instalación

root@1f982efe8590:/# apt-get install python-pip libmariadb-dev-compat libmariadb-dev libpq-dev python-dev unixodbc-dev

...

root@1f982efe8590:/# pip install moodle-sdk
Collecting moodle-sdk
  Downloading https://files.pythonhosted.org/packages/5b/d6/5b2ad3fb574e67c666700448ac93c1c52e59f1958b56d939770f4411815a/moodle-sdk-1.7.4.tar.gz (102kB)
    100% |████████████████████████████████| 112kB 2.7MB/s 
Collecting MySQL-python>=1.2.3 (from moodle-sdk)
  Downloading https://files.pythonhosted.org/packages/a5/e9/51b544da85a36a68debe7a7091f068d802fc515a3a202652828c73453cad/MySQL-python-1.2.5.zip (108kB)
    100% |████████████████████████████████| 112kB 5.2MB/s 
Collecting jenkinsapi>=0.3.2 (from moodle-sdk)
  Downloading https://files.pythonhosted.org/packages/de/42/d966fff11505493e27676d3171f5955bedf8f3c6cdb26a72c18210974319/jenkinsapi-0.3.9-py2.py3-none-any.whl (130kB)
    100% |████████████████████████████████| 133kB 4.7MB/s 
Requirement already satisfied: keyring>=3.5 in /usr/lib/python2.7/dist-packages (from moodle-sdk) (17.1.1)
Collecting psycopg2>=2.4.5 (from moodle-sdk)
  Downloading https://files.pythonhosted.org/packages/5c/1c/6997288da181277a0c29bc39a5f9143ff20b8c99f2a7d059cfb55163e165/psycopg2-2.8.3.tar.gz (377kB)
    100% |████████████████████████████████| 378kB 2.3MB/s 
Collecting pyodbc>=4.0.21 (from moodle-sdk)
  Downloading https://files.pythonhosted.org/packages/75/29/aa190749bac37ede0f11a68a75e7055254699c11572bd94213f1163dfd8f/pyodbc-4.0.27.tar.gz (242kB)
    100% |████████████████████████████████| 245kB 3.4MB/s 
Collecting requests>=2.3.0 (from moodle-sdk)
  Downloading https://files.pythonhosted.org/packages/51/bd/23c926cd341ea6b7dd0b2a00aba99ae0f828be89d72b2190f27c11d4b7fb/requests-2.22.0-py2.py3-none-any.whl (57kB)
    100% |████████████████████████████████| 61kB 5.0MB/s 
Collecting watchdog>=0.8.0 (from moodle-sdk)
  Downloading https://files.pythonhosted.org/packages/bb/e3/5a55d48a29300160779f0a0d2776d17c1b762a2039b36de528b093b87d5b/watchdog-0.9.0.tar.gz (85kB)
    100% |████████████████████████████████| 92kB 9.5MB/s 
Collecting pytz>=2014.4 (from jenkinsapi>=0.3.2->moodle-sdk)
  Downloading https://files.pythonhosted.org/packages/87/76/46d697698a143e05f77bec5a526bf4e56a0be61d63425b68f4ba553b51f2/pytz-2019.2-py2.py3-none-any.whl (508kB)
    100% |████████████████████████████████| 512kB 2.1MB/s 
Requirement already satisfied: six>=1.10.0 in /usr/lib/python2.7/dist-packages (from jenkinsapi>=0.3.2->moodle-sdk) (1.12.0)
Requirement already satisfied: secretstorage<3 in /usr/lib/python2.7/dist-packages (from keyring>=3.5->moodle-sdk) (2.3.1)
Collecting idna<2.9,>=2.5 (from requests>=2.3.0->moodle-sdk)
  Downloading https://files.pythonhosted.org/packages/14/2c/cd551d81dbe15200be1cf41cd03869a46fe7226e7450af7a6545bfc474c9/idna-2.8-py2.py3-none-any.whl (58kB)
    100% |████████████████████████████████| 61kB 7.8MB/s 
Collecting chardet<3.1.0,>=3.0.2 (from requests>=2.3.0->moodle-sdk)
  Downloading https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133kB)
    100% |████████████████████████████████| 143kB 5.2MB/s 
Collecting certifi>=2017.4.17 (from requests>=2.3.0->moodle-sdk)
  Downloading https://files.pythonhosted.org/packages/69/1b/b853c7a9d4f6a6d00749e94eb6f3a041e342a885b87340b79c1ef73e3a78/certifi-2019.6.16-py2.py3-none-any.whl (157kB)
    100% |████████████████████████████████| 163kB 4.6MB/s 
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 (from requests>=2.3.0->moodle-sdk)
  Downloading https://files.pythonhosted.org/packages/e6/60/247f23a7121ae632d62811ba7f273d0e58972d75e58a94d329d51550a47d/urllib3-1.25.3-py2.py3-none-any.whl (150kB)
    100% |████████████████████████████████| 153kB 4.7MB/s 
Collecting PyYAML>=3.10 (from watchdog>=0.8.0->moodle-sdk)
  Downloading https://files.pythonhosted.org/packages/e3/e8/b3212641ee2718d556df0f23f78de8303f068fe29cdaa7a91018849582fe/PyYAML-5.1.2.tar.gz (265kB)
    100% |████████████████████████████████| 266kB 2.9MB/s 
Collecting argh>=0.24.1 (from watchdog>=0.8.0->moodle-sdk)
  Downloading https://files.pythonhosted.org/packages/06/1c/e667a7126f0b84aaa1c56844337bf0ac12445d1beb9c8a6199a7314944bf/argh-0.26.2-py2.py3-none-any.whl
Collecting pathtools>=0.1.1 (from watchdog>=0.8.0->moodle-sdk)
  Downloading https://files.pythonhosted.org/packages/e7/7f/470d6fcdf23f9f3518f6b0b76be9df16dcc8630ad409947f8be2eb0ed13a/pathtools-0.1.2.tar.gz
Building wheels for collected packages: moodle-sdk, MySQL-python, psycopg2, pyodbc, watchdog, PyYAML, pathtools
  Running setup.py bdist_wheel for moodle-sdk ... done
  Stored in directory: /root/.cache/pip/wheels/e0/da/a2/7392dbef251aa89c41c0960f778fda67437c677c8b745bede5
  Running setup.py bdist_wheel for MySQL-python ... error
  Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-UB9qiv/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 /tmp/pip-wheel-puiLc1 --python-tag cp27:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-2.7
  copying _mysql_exceptions.py -> build/lib.linux-x86_64-2.7
  creating build/lib.linux-x86_64-2.7/MySQLdb
  copying MySQLdb/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb
  copying MySQLdb/converters.py -> build/lib.linux-x86_64-2.7/MySQLdb
  copying MySQLdb/connections.py -> build/lib.linux-x86_64-2.7/MySQLdb
  copying MySQLdb/cursors.py -> build/lib.linux-x86_64-2.7/MySQLdb
  copying MySQLdb/release.py -> build/lib.linux-x86_64-2.7/MySQLdb
  copying MySQLdb/times.py -> build/lib.linux-x86_64-2.7/MySQLdb
  creating build/lib.linux-x86_64-2.7/MySQLdb/constants
  copying MySQLdb/constants/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
  copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
  copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
  copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
  copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
  copying MySQLdb/constants/REFRESH.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
  copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
  running build_ext
  building '_mysql' extension
  creating build/temp.linux-x86_64-2.7
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-IbFBHb/python2.7-2.7.16=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/include/mariadb -I/usr/include/mariadb/mysql -I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o
  In file included from _mysql.c:44:
  /usr/include/mariadb/my_config.h:3:2: warning: #warning This file should not be included by clients, include only <mysql.h> [-Wcpp]
   #warning This file should not be included by clients, include only <mysql.h>
    ^~~~~~~
  In file included from _mysql.c:46:
  /usr/include/mariadb/mysql.h:440:3: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
     MYSQL_CLIENT_PLUGIN_HEADER
     ^~~~~~~~~~~~~~~~~~~~~~~~~~
  _mysql.c: In function ‘_mysql_ConnectionObject_ping’:
  _mysql.c:2005:41: error: ‘MYSQL’ {aka ‘struct st_mysql’} has no member named ‘reconnect’
    if ( reconnect != -1 ) self->connection.reconnect = reconnect;
                                           ^
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

  ----------------------------------------
  Failed building wheel for MySQL-python
  Running setup.py clean for MySQL-python
  Running setup.py bdist_wheel for psycopg2 ... done
  Stored in directory: /root/.cache/pip/wheels/48/06/67/475967017d99b988421b87bf7ee5fad0dad789dc349561786b
  Running setup.py bdist_wheel for pyodbc ... done
  Stored in directory: /root/.cache/pip/wheels/87/b7/78/0740a2ed98bfe463525ad42d535370e34141c5d36b2d00dcaf
  Running setup.py bdist_wheel for watchdog ... done
  Stored in directory: /root/.cache/pip/wheels/61/1d/d0/04cfe495619be2095eb8d89a31c42adb4e42b76495bc8f784c
  Running setup.py bdist_wheel for PyYAML ... done
  Stored in directory: /root/.cache/pip/wheels/d9/45/dd/65f0b38450c47cf7e5312883deb97d065e030c5cca0a365030
  Running setup.py bdist_wheel for pathtools ... done
  Stored in directory: /root/.cache/pip/wheels/0b/04/79/c3b0c3a0266a3cb4376da31e5bfe8bba0c489246968a68e843
Successfully built moodle-sdk psycopg2 pyodbc watchdog PyYAML pathtools
Failed to build MySQL-python
Installing collected packages: MySQL-python, pytz, idna, chardet, certifi, urllib3, requests, jenkinsapi, psycopg2, pyodbc, PyYAML, argh, pathtools, watchdog, moodle-sdk
  Running setup.py install for MySQL-python ... error
    Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-UB9qiv/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 /tmp/pip-record-6a0Iq3/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-2.7
    copying _mysql_exceptions.py -> build/lib.linux-x86_64-2.7
    creating build/lib.linux-x86_64-2.7/MySQLdb
    copying MySQLdb/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb
    copying MySQLdb/converters.py -> build/lib.linux-x86_64-2.7/MySQLdb
    copying MySQLdb/connections.py -> build/lib.linux-x86_64-2.7/MySQLdb
    copying MySQLdb/cursors.py -> build/lib.linux-x86_64-2.7/MySQLdb
    copying MySQLdb/release.py -> build/lib.linux-x86_64-2.7/MySQLdb
    copying MySQLdb/times.py -> build/lib.linux-x86_64-2.7/MySQLdb
    creating build/lib.linux-x86_64-2.7/MySQLdb/constants
    copying MySQLdb/constants/__init__.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
    copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
    copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
    copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
    copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
    copying MySQLdb/constants/REFRESH.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
    copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-2.7/MySQLdb/constants
    running build_ext
    building '_mysql' extension
    creating build/temp.linux-x86_64-2.7
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-IbFBHb/python2.7-2.7.16=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/include/mariadb -I/usr/include/mariadb/mysql -I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-x86_64-2.7/_mysql.o
    In file included from _mysql.c:44:
    /usr/include/mariadb/my_config.h:3:2: warning: #warning This file should not be included by clients, include only <mysql.h> [-Wcpp]
     #warning This file should not be included by clients, include only <mysql.h>
      ^~~~~~~
    In file included from _mysql.c:46:
    /usr/include/mariadb/mysql.h:440:3: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
       MYSQL_CLIENT_PLUGIN_HEADER
       ^~~~~~~~~~~~~~~~~~~~~~~~~~
    _mysql.c: In function ‘_mysql_ConnectionObject_ping’:
    _mysql.c:2005:41: error: ‘MYSQL’ {aka ‘struct st_mysql’} has no member named ‘reconnect’
      if ( reconnect != -1 ) self->connection.reconnect = reconnect;
                                             ^
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-UB9qiv/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 /tmp/pip-record-6a0Iq3/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-UB9qiv/MySQL-python/
ericlentz commented 4 years ago

Answer to this problem is here: https://github.com/DefectDojo/django-DefectDojo/issues/407. Just add the reconnect member.