Seite 1 von 1

mariadb-Modul lässt sich nicht installieren

Verfasst: Mittwoch 7. April 2021, 11:28
von Cortez
Hallo,

ich habe Probleme beim Installieren des mariadb-Moduls für python. Nach Eingabe von:

Code: Alles auswählen

pip3 install mariadb
erhalte ich folgende (mir) nichtssagende Fehlermeldungen:

Code: Alles auswählen

WARNING: The directory '/home/martin/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting mariadb
  Downloading mariadb-1.0.6.tar.gz (67 kB)
     |████████████████████████████████| 67 kB 1.5 MB/s 
    ERROR: Command errored out with exit status 1:
     command: /usr/local/bin/python3.7 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-f7lkbxx8/mariadb/setup.py'"'"'; __file__='"'"'/tmp/pip-install-f7lkbxx8/mariadb/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-f7lkbxx8/mariadb/pip-egg-info
         cwd: /tmp/pip-install-f7lkbxx8/mariadb/
    Complete output (17 lines):
    /bin/sh: 1: mariadb_config: not found
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-f7lkbxx8/mariadb/setup.py", line 26, in <module>
        cfg = get_config(options)
      File "/tmp/pip-install-f7lkbxx8/mariadb/mariadb_posix.py", line 59, in get_config
        cc_version = mariadb_config(config_prg, "cc_version")
      File "/tmp/pip-install-f7lkbxx8/mariadb/mariadb_posix.py", line 29, in mariadb_config
        "mariadb_config not found.\n\nPlease make sure, that MariaDB Connector/C is installed on your system.\n"
    OSError: mariadb_config not found.
    
    Please make sure, that MariaDB Connector/C is installed on your system.
    Either set the environment variable MARIADB_CONFIG or edit the configuration
    file 'site.cfg' and set the 'mariadb_config option, which should point
    to the mariadb_config utility.
    The MariaDB Download website at <https://downloads.mariadb.com/Connectors/c/>
    provides latest stable releease of Connector/C.
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
WARNING: You are using pip version 20.0.2; however, version 21.0.1 is available.
You should consider upgrading via the '/usr/local/bin/python3.7 -m pip install --upgrade pip' command.
Nun weiß ich nicht, was da das Problem ist. Wichtig wäre eventuell zu erwähnen, dass neben Python3.7 bei mir auch noch eine Python2 Version installiert ist.

Vielleicht kann mir jeand helfen. Ich würde mich freuen.

Re: mariadb-Modul lässt sich nicht installieren

Verfasst: Mittwoch 7. April 2021, 12:18
von Sirius3
Die Fehlermeldung ist doch eindeutig. Du mußt auch noch MariaDB Connector/C installieren. Das ist eine C-Bibliothek, die Du entweder in den Paketen Deiner Distribution findest, oder selbst kompillieren mußt.

Re: mariadb-Modul lässt sich nicht installieren

Verfasst: Mittwoch 7. April 2021, 14:07
von Cortez
Danke soweit mal für die Hilfe: Habe das entsprechende Modul jetzt installiert:

Code: Alles auswählen

libmariadb3:
  Installiert:           3.0.3-1build1
  Installationskandidat: 3.0.3-1build1
  Versionstabelle:
 *** 3.0.3-1build1 500
        500 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
        100 /var/lib/dpkg/status
Dennoch gibt es weiterhin Fehlermeldungen:

Code: Alles auswählen

WARNING: The directory '/home/wolfgang/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting mariadb
  Downloading mariadb-1.0.6.tar.gz (67 kB)
     |████████████████████████████████| 67 kB 1.5 MB/s 
    ERROR: Command errored out with exit status 1:
     command: /usr/local/bin/python3.7 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-a961myf7/mariadb/setup.py'"'"'; __file__='"'"'/tmp/pip-install-a961myf7/mariadb/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-a961myf7/mariadb/pip-egg-info
         cwd: /tmp/pip-install-a961myf7/mariadb/
    Complete output (17 lines):
    /bin/sh: 1: mariadb_config: not found
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-a961myf7/mariadb/setup.py", line 26, in <module>
        cfg = get_config(options)
      File "/tmp/pip-install-a961myf7/mariadb/mariadb_posix.py", line 59, in get_config
        cc_version = mariadb_config(config_prg, "cc_version")
      File "/tmp/pip-install-a961myf7/mariadb/mariadb_posix.py", line 29, in mariadb_config
        "mariadb_config not found.\n\nPlease make sure, that MariaDB Connector/C is installed on your system.\n"
    OSError: mariadb_config not found.
    
    Please make sure, that MariaDB Connector/C is installed on your system.
    Either set the environment variable MARIADB_CONFIG or edit the configuration
    file 'site.cfg' and set the 'mariadb_config option, which should point
    to the mariadb_config utility.
    The MariaDB Download website at <https://downloads.mariadb.com/Connectors/c/>
    provides latest stable releease of Connector/C.
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
WARNING: You are using pip version 20.0.2; however, version 21.0.1 is available.
You should consider upgrading via the '/usr/local/bin/python3.7 -m pip install --upgrade pip' command.

Re: mariadb-Modul lässt sich nicht installieren

Verfasst: Mittwoch 7. April 2021, 14:32
von Sirius3
Du mußt wahrscheinlich noch das libmariadb-dev-Paket installieren, weil sonst kann man die Bibliothek nur benutzen und nicht Programme übersetzen.

Re: mariadb-Modul lässt sich nicht installieren

Verfasst: Mittwoch 7. April 2021, 16:20
von Cortez
Danke dir erstmal für deine Ratschläge.

Wir kommen der Sache so langsam näher: die roten Zeilen werden weniger.

Dennoch gibts noch Probleme:

Code: Alles auswählen

WARNING: The directory '/home/wolfgang/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting mariadb
  Downloading mariadb-1.0.6.tar.gz (67 kB)
     |████████████████████████████████| 67 kB 1.5 MB/s 
    ERROR: Command errored out with exit status 2:
     command: /usr/local/bin/python3.7 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-kys9kuqt/mariadb/setup.py'"'"'; __file__='"'"'/tmp/pip-install-kys9kuqt/mariadb/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-kys9kuqt/mariadb/pip-egg-info
         cwd: /tmp/pip-install-kys9kuqt/mariadb/
    Complete output (1 lines):
    MariaDB Connector/Python requires MariaDB Connector/C >= 3.1.5, found version 3.0.3
    ----------------------------------------
ERROR: Command errored out with exit status 2: python setup.py egg_info Check the logs for full command output.
WARNING: You are using pip version 20.0.2; however, version 21.0.1 is available.
You should consider upgrading via the '/usr/local/bin/python3.7 -m pip install --upgrade pip' command.
Muss noch orgendwas installiert werden?

Re: mariadb-Modul lässt sich nicht installieren

Verfasst: Mittwoch 7. April 2021, 16:30
von ThomasL
Der Fehler lautet:
MariaDB Connector/Python requires MariaDB Connector/C >= 3.1.5, found version 3.0.3

Du hast also version 3.0.3 installiert und >=3.1.5 ist notwendig.

Re: mariadb-Modul lässt sich nicht installieren

Verfasst: Mittwoch 7. April 2021, 16:33
von Cortez
War halt die Version, die das (aktualisierte) System installiert hat. Was anderes krieg ich wohl nicht.

Re: mariadb-Modul lässt sich nicht installieren

Verfasst: Dienstag 11. Januar 2022, 22:37
von cypher28
Hi,

das Thema ist zwar bisschen älter, stehe aber vor dem selben Problem. Ich nutze einen Macbook mit dem M1 Chip. Python in der Version 3.10.1 ist installiert. Nun möchte ich eine Verbindung zu einer externen Datenbank (MariaDB)
Habe hierfür per

Code: Alles auswählen

$ pip3 install mariadb
versucht es zu installieren. Nur führt es bei mir auch zu mehreren Fehlermeldungen auf der Konsole.
Mann soll ja den MariaDB-connector-c installieren.

Geht dies auf einem Mac mit einem M1 Chip nur über Homebrew oder gibt es eine andere möglichkeit es zu installieren?

Re: mariadb-Modul lässt sich nicht installieren

Verfasst: Mittwoch 12. Januar 2022, 00:08
von __deets__
Home brew ist sicher die einfachste Möglichkeit. Aller Wahrscheinlichkeit nach könnte man den connector + alle seine Abhängigkeiten auch “bin Hand” installieren. Das erfordert aber im Zweifel eine Menge Expertise, die im Grunde in homebrew eingebaut ist. Würde ich also auch gleich benutzen.