clips / pattern

Web mining module for Python, with tools for scraping, natural language processing, machine learning, network analysis and visualization.
https://github.com/clips/pattern/wiki
BSD 3-Clause "New" or "Revised" License
8.72k stars 1.58k forks source link

pip install throws error - bin/sh: 1: mysql_config: not found #329

Open rohan-paul opened 2 years ago

rohan-paul commented 2 years ago

After running pip install pattern getting below error

paul@paul-B85M-D3H:~$ pip install pattern
Defaulting to user installation because normal site-packages is not writeable
Collecting pattern
  Using cached Pattern-3.6.0.tar.gz (22.2 MB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: future in /usr/lib/python3/dist-packages (from pattern) (0.18.2)
Collecting backports.csv
  Using cached backports.csv-1.0.7-py2.py3-none-any.whl (12 kB)
Collecting mysqlclient
  Using cached mysqlclient-2.1.0.tar.gz (87 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [16 lines of output]
      /bin/sh: 1: mysql_config: not found
      /bin/sh: 1: mariadb_config: not found
      /bin/sh: 1: mysql_config: not found
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-qybufuhd/mysqlclient_ad587186f3304bbba8c6f9984564fb73/setup.py", line 15, in <module>
          metadata, options = get_config()
        File "/tmp/pip-install-qybufuhd/mysqlclient_ad587186f3304bbba8c6f9984564fb73/setup_posix.py", line 70, in get_config
          libs = mysql_config("libs")
        File "/tmp/pip-install-qybufuhd/mysqlclient_ad587186f3304bbba8c6f9984564fb73/setup_posix.py", line 31, in mysql_config
          raise OSError("{} not found".format(_mysql_config_path))
      OSError: mysql_config not found
      mysql_config --version
      mariadb_config --version
      mysql_config --libs
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
WARNING: There was an error checking the latest version of pip.
dcsuka commented 2 years ago

Exactly the same issue for me, Mac M1, Python 3.9.10.

EDIT: installing via conda-forge worked for me: conda install -c conda-forge pattern.

ndvbd commented 1 year ago

Same issue

ClaudiaShu commented 1 year ago

Exactly the same issue for me, Mac M1, Python 3.9.10.

EDIT: installing via conda-forge worked for me: conda install -c conda-forge pattern.

Thanks! Same issue here and this works for me. Linux, Python 3.8.