pandas-dev / pandas

Flexible and powerful data analysis / manipulation library for Python, providing labeled data structures similar to R data.frame objects, statistical functions, and much more
https://pandas.pydata.org
BSD 3-Clause "New" or "Revised" License
43.27k stars 17.8k forks source link

Cannot create python environment due to broken dependency #23015

Closed MatanCohe closed 4 years ago

MatanCohe commented 5 years ago

Problem description

Following the documentation I've tried to create a python environment and encountered this error message:

python -m pip install -r ci/requirements_dev.txt

Collecting PyEnchant>=1.6.5 (from sphinxcontrib-spelling->-r ci/requirements_dev.txt (line 14))
  Using cached https://files.pythonhosted.org/packages/9e/54/04d88a59efa33fefb88133ceb638cdf754319030c28aadc5a379d82140ed/pyenchant-2.0.0.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-comptn20/PyEnchant/setup.py", line 212, in <module>
        import enchant
      File "/tmp/pip-install-comptn20/PyEnchant/enchant/__init__.py", line 92, in <module>
        from enchant import _enchant as _e
      File "/tmp/pip-install-comptn20/PyEnchant/enchant/_enchant.py", line 145, in <module>
        raise ImportError(msg)
    ImportError: The 'enchant' C library was not found. Please install it via your OS package manager, or use a pre-built binary wheel from PyPI. 

Looking it up online I've found that the project pyenchant is no longer maintained.

uname -sro
Linux 4.18.10-arch1-1-ARCH GNU/Linux
pip -V
pip 18.0 from /path (python 3.7) 
pacman -Qi enchant

Name            : enchant
Version         : 2.2.3-1
Description     : A wrapper library for generic spell checking
Architecture    : x86_64
URL             : https://abiword.github.io/enchant/
Licenses        : LGPL
Groups          : None
Provides        : None
Depends On      : aspell  hunspell  hspell  libvoikko  glib2
Optional Deps   : None
Required By     : python-pyenchant  webkit2gtk
Optional For    : None
Conflicts With  : None
Replaces        : None
Installed Size  : 148.00 KiB
Packager        : Felix Yan <felixonmars@archlinux.org>
Build Date      : Thu Feb 22 11:36:06 2018
Install Date    : Sun Sep 30 16:13:39 2018
Install Reason  : Installed as a dependency for another package
Install Script  : No
Validated By    : Signature
WillAyd commented 5 years ago

Good to know about pyenchant and the long term maintenance of it, but does installing the enchant C library as noted in the ImportError resolve the issue for you?

MatanCohe commented 5 years ago

No, as I've come to understand pyenchant require an older version of the package (1.6 I think).

WillAyd commented 5 years ago

Hmm OK it appears that Windows / OSX users get a pre-built version of the library to go with the binaries:

https://github.com/rfk/pyenchant#how-do-i-use-it

Not sure specifically how Arch manages the packages here but this thread might provide you some insight:

https://github.com/rfk/pyenchant/issues/125

kevswanberg commented 5 years ago

I was able to get enchant to install by linking libenchant-2.so to libenchant.so

cd /usr/lib && sudo ln libenchant-2.so libenchant.so

It looks like it is working and I'll report back if anything fails.

I think we could get the package to work if we added libenchant-2 to one of the valid library versions that it looks for.

jbrockmendel commented 4 years ago

requirements-dev.txt doesn't list sphinxcontrib-spelling. Does that render this moot?

jreback commented 4 years ago

iirc we removed this