Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing fails: mysql_config not found #275

Open
ndvbd opened this issue Apr 22, 2019 · 9 comments
Open

Installing fails: mysql_config not found #275

ndvbd opened this issue Apr 22, 2019 · 9 comments

Comments

@ndvbd
Copy link

ndvbd commented Apr 22, 2019

I want to upgrade from pattern 2.6 to 3.6
I uninstalled, and now I do:

sudo pip install pattern

and get
EnvironmentError: mysql_config not found

@abhijithneilabraham
Copy link

Try installing mysqlclient separately and then try the sudo pip install pattern
for macos try

brew install mysqlclient 

and then install pattern

@ndvbd
Copy link
Author

ndvbd commented Apr 23, 2019

Hi, but I don't want to install mysql...
I just want to use the Pattern for the English textual skills, like singularize, etc.

@abhijithneilabraham
Copy link

abhijithneilabraham commented Apr 23, 2019

When you install pattern mysqlclient is a dependency. It is not made optional yet.(That's what I faced anyway)

@ndvbd
Copy link
Author

ndvbd commented Apr 23, 2019

So we can install the client, but don't have to install the database itself, right?

@ndvbd
Copy link
Author

ndvbd commented Apr 29, 2019

I managed to install 3.6 after I did
sudo apt-get install libmysqlclient-dev
and then
sudo pip2 install pattern==3.6

However, when I am now doing
from pattern.en import singularize
It fails:


    from pattern.en import singularize
  File "/usr/local/lib/python2.7/dist-packages/pattern/text/en/__init__.py", line 61, in <module>
    from pattern.text.en.inflect import (
  File "/usr/local/lib/python2.7/dist-packages/pattern/text/en/__init__.py", line 80, in <module>
    from pattern.text.en import wordnet
  File "/usr/local/lib/python2.7/dist-packages/pattern/text/en/wordnet/__init__.py", line 57, in <module>
    nltk.data.find("corpora/" + token)
  File "/usr/local/lib/python2.7/dist-packages/nltk/data.py", line 653, in find
    return find(modified_name, paths)
  File "/usr/local/lib/python2.7/dist-packages/nltk/data.py", line 639, in find
    return ZipFilePathPointer(p, zipentry)
  File "/usr/local/lib/python2.7/dist-packages/nltk/compat.py", line 221, in _decorator
    return init_func(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/nltk/data.py", line 486, in __init__
    zipfile = OpenOnDemandZipFile(os.path.abspath(zipfile))
  File "/usr/local/lib/python2.7/dist-packages/nltk/compat.py", line 221, in _decorator
    return init_func(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/nltk/data.py", line 1012, in __init__
    zipfile.ZipFile.__init__(self, filename)
  File "/usr/lib/python2.7/zipfile.py", line 770, in __init__
    self._RealGetContents()
  File "/usr/lib/python2.7/zipfile.py", line 811, in _RealGetContents
    raise BadZipfile, "File is not a zip file"
zipfile.BadZipfile: File is not a zip file

@amoux
Copy link

amoux commented Oct 1, 2019

I got it working with no errors.

  • OS: Ubuntu 19.04
  • Anaconda environment: python 3.6

make sure you install libmysqlclient-dev first!

sudo apt install libmysqlclient-dev
git clone https://github.com/clips/pattern
cd pattern/
# activate conda environment.
python setup.py install

output after running python setup.py install:

Using /home/<USER-NAME>/anaconda3/envs/<ENV-NAME>/lib/python3.6/site-packages
Finished processing dependencies for Pattern==3.6

@knarrff
Copy link

knarrff commented Apr 9, 2020

You don't have root on all machines where you might want to use pattern, and I also do not see a reason why mysql-client should be a required dependency. Especially when the documentation mentions:

The module has no external dependencies except when using LSA in the pattern.vector module, which requires NumPy

Please make optional dependencies optional.

@Sjoerd82
Copy link

Related to #250

@perfectm
Copy link

Please....We are unable to use Pattern because of this error message from MySQL.....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants