-
Couldn't load subscription status.
- Fork 1.6k
Open
Description
With Python3 and pip3 on Mac OSX, there's a sql config error
$ sudo pip3 install -U https://github.com/clips/pattern/archive/development.zip
Collecting https://github.com/clips/pattern/archive/development.zip
Downloading https://github.com/clips/pattern/archive/development.zip (24.8MB)
100% |████████████████████████████████| 24.8MB 40kB/s
Collecting future (from Pattern==2.6)
Downloading future-0.16.0.tar.gz (824kB)
100% |████████████████████████████████| 829kB 850kB/s
Collecting backports.csv (from Pattern==2.6)
Downloading backports.csv-1.0.5-py2.py3-none-any.whl
Collecting mysqlclient (from Pattern==2.6)
Downloading mysqlclient-1.3.12.tar.gz (89kB)
100% |████████████████████████████████| 92kB 2.5MB/s
Complete output from command python setup.py egg_info:
/bin/sh: mysql_config: command not found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/tmp/pip-build-c2voibrz/mysqlclient/setup.py", line 17, in <module>
metadata, options = get_config()
File "/private/tmp/pip-build-c2voibrz/mysqlclient/setup_posix.py", line 44, in get_config
libs = mysql_config("libs_r")
File "/private/tmp/pip-build-c2voibrz/mysqlclient/setup_posix.py", line 26, in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
OSError: mysql_config not found
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/tmp/pip-build-c2voibrz/mysqlclient/
the21st, matthewdeanmartin, ShushanArakelyan, michaschwab, flekschas and 2 more
Activity
derNarr commentedon Jan 4, 2018
I had the same error in linux (debian 9) and could solve it by installing
mysql_configover the package manager withsudo apt-get install libmariadbclient-dev(this is the mariadb drop-in replacement for mysql_config).This might solve you problem: https://stackoverflow.com/questions/25459386/mac-os-x-environmenterror-mysql-config-not-found (I cannot judge if this is the proper way to install mysql_config on your system).
curiousrohan commentedon Mar 3, 2018
I had the same error in MacOS High Sierra
Doing:
brew install mysqlPATH=$PATH:/usr/local/mysql/binsolved the problem
ghost commentedon May 20, 2018
I found downloading Pattern from source allows you to use Pattern without worrying about SQL, until you actually need to use the database feature.
evanmiltenburg commentedon Oct 22, 2018
I got the same error as @alvations using the version from PyPI:
evanmiltenburg commentedon Oct 23, 2018
Because I don't need the database feature, I bluntly solved the issue by commenting out line 140 in
setup.py. So this:Becomes:
This way,
python setup.py installruns without any errors. It's not pretty but it works.falconair commentedon Jun 19, 2019
I am coming across this issue when I install pattern via pip (on python 3.6). I am installing this library as a dependency for gensim. I just need pattern for lemmatization features, is a mysql installation really required?
Several people have suggested installing mysql via brew or apt, but I need to install this library in an environment where things are pretty locked down. Not having a mysql dependency will make this much easier.
evanmiltenburg commentedon Jun 19, 2019
No. Mysql is needed for storing results. My solution above would work for you as well.
cheneypinata commentedon Jun 20, 2019
Having the same issue with OS Mojave 10.15.5 and the workaround from @curiousrohan seemed to work.
vizzerdrix55 commentedon Jun 25, 2019
Performing these lines in terminal worked also for solving the problem in Jupyter Notebook 5.7.4 with Python 3.7.1 on macOS Mojave
flekschas commentedon Aug 27, 2019
In case you don't want to install mysql system-wide, you can easily create a Conda environment. The following works for me:
TailaneBrito commentedon Nov 20, 2019
I solved the problem using
brew install mysql
as mentioned above! thanks