"enchant C library not found" while installing pyenchant using pip on OSX - macos

I typed in pip install pyenchant into my shell, but it raised two Traceback errors:
1:
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/private/var/folders/q4/l70hdqjd5db2n2bdj69qrwz40000gq/T/pip_build_prernauppal/pyenchant/setup.py", line 195, in <module>
import enchant
File "enchant/__init__.py", line 90, in <module>
from enchant import _enchant as _e
File "enchant/_enchant.py", line 133, in <module>
raise ImportError("enchant C library not found")
ImportError: enchant C library not found
2:
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/private/var/folders/q4/l70hdqjd5db2n2bdj69qrwz40000gq/T/pip_build_prernauppal/pyenchant/setup.py", line 195, in <module>
import enchant
File "enchant/__init__.py", line 90, in <module>
from enchant import _enchant as _e
File "enchant/_enchant.py", line 133, in <module>
raise ImportError("enchant C library not found")
ImportError: enchant C library not found
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /private/var/folders/q4/l70hdqjd5db2n2bdj69qrwz40000gq/T/pip_build_prernauppal/pyenchant
I have python 2.7 default installed on my mac, but it still isn't working. I have already looked at Unable to install pyenchant-1.6.5 for python 2.7 on Mac OSX Lion but it doesn't answer my question, as easy_install pyenchant raises even more errors.

Try this - It worked for me on Ubuntu.
sudo apt-get install libenchant1c2a

You need to install enchant, which is a C library. You can use Homebrew, to do this kind of package management. Just enter:
brew install enchant
Before trying to pip install pyenchant and you should be fine.

Try either sudo pip install or sudo easy install.

[nltk_data] Error loading enchant: Package 'enchant' not found in
No. if you get this problem, you are supposed to install it like this:
$ sudo easy_install pyenchant
it is not an nltk package, it is a package on its own.

sudo easy_install
sudo because MAC permissions are usually messed up

Try a pip install, an easy_install, and a brew.

You have to download the NLTK package. That is how you get Pyenchant running. But if your building a grammar checker, pyenchant is not advisable because it only grammar checks two words. You should consider building a grammar checker on your own by starting with an autocomplete word completion from here:
How to code autocompletion in python?

For windows: download the required .exe file based on version from https://pypi.python.org/simple/pyenchant/
and pip install pyenchant

Related

Can't install pyenchant

I need installing pyenchant v1.6.7 on MacBook with Apple Silicon (M1 Pro) for Python 2.7.18.
This package is a wrapper for C-library enchant, so it requires to the enchant was installed firstly. Well, I've installed the enchant by: brew install enchant.
However, when I try to install pyenchant using PIP I got the next error:
cwd: /private/var/folders/8t/b2kn5tm162s614gvsfrdcbhm0000gn/T/pip-install-8FO32O/pyenchant/
Complete output (9 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/8t/b2kn5tm162s614gvsfrdcbhm0000gn/T/pip-install-8FO32O/pyenchant/setup.py", line 210, in <module>
import enchant
File "enchant/__init__.py", line 92, in <module>
from enchant import _enchant as _e
File "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.
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Also I have tried to specify LDFLAGS and CFLAGS:
LDFLAGS='-L/opt/homebrew/Cellar/enchant/2.3.3/lib' CFLAGS="-I/opt/homebrew/Cellar/enchant/2.3.3/include" ~/.pyenv/versions/2.7.18/bin/pip install --no-cache-dir pyenchant==1.6.7
But it doesn't work, I still get the same error.
How to specify the enchant library for the pyenchant module?

./odoo-bin --config=' /etc/odoo.conf' ODOO 11

Traceback (most recent call last):
File "./odoo-bin", line 5, in <module>
import odoo
File "/opt/odoo/odoo/odoo/__init__.py", line 88, in <module>
from . import service
File "/opt/odoo/odoo/odoo/service/__init__.py", line 7, in <module>
from . import wsgi_server
File "/opt/odoo/odoo/odoo/service/wsgi_server.py", line 25, in <module>
import werkzeug.contrib.fixers
ModuleNotFoundError: No module named 'werkzeug.contrib'
After tracing back errors, I got this error.
Failed building wheel for pyldap
And after I run this code.
sudo apt-get install libsasl2-dev python-dev libldap2-dev libssl-dev
and
pip3 install -r requirements.txt
Make sure your werkzeug version in requirements.txt is 0.11.15.
If not 'pip3 install werkzeug==0.11.15'
then you can execute odoo
I ran into the same issue when trying to use Proxyfix in werkzeug==1.0.0
Since that Werkzeug 1.0.0 has removed deprecated code from werkzeug.contrib, ProxyFix was relocated to werkzeug.middleware.proxy_fix
To fix the ModuleNotFoundError: No module named 'werkzeug.contrib' Error:
You should import ProxyFix with the following code:
from werkzeug.middleware.proxy_fix import ProxyFix
I hope this helps and fix your issues 😄

unable to install pip on python 2.6.6 - lack of dependencies

I'm on Ubuntu 18.04 and using python 2.6.6 that I installed from tgz package from here https://www.python.org/downloads/release/python-266/ using this instruction: https://askubuntu.com/questions/25961/how-do-i-install-a-tar-gz-or-tar-bz2-file. I'm trying to install pip using this instruction https://pip.pypa.io/en/latest/installing/
but when I run
python get-pip.py
I got errors about dependencies:
Traceback (most recent call last): File "get-pip.py", line 28, in
import tempfile File "/usr/local/lib/python2.6/tempfile.py", line 34, in
from random import Random as _Random File "/usr/local/lib/python2.6/random.py", line 47, in
from os import urandom as _urandom ImportError: cannot import name urandom
First it was cannot import name zlib. I installed zlib and now I got about urandom so I guess there might be more that I don't have installed. What's the best way to deal with it?
You could try sudo. If that doesn't work, try stating the python version.
$ sudo python2.6 get-pip.py
I think it is better to install via OS package:
apt install python python-pip python-setuptools

"ImportError: No module named zlib" when install google cloud sdk

I'm installing google cloud sdk on mac following this documentation. But I failed when trying to run this command:
$ curl https://sdk.cloud.google.com | bash
And this is error:
Welcome to the Google Cloud SDK!
Traceback (most recent call last):
File "/Users/tran.ba.vinh.son/google-cloud-sdk/bin/bootstrapping/install.py", line 12, in <module>
import bootstrapping
File "/Users/tran.ba.vinh.son/google-cloud-sdk/bin/bootstrapping/bootstrapping.py", line 44, in <module>
from googlecloudsdk.core.credentials import store as c_store
File "/Users/tran.ba.vinh.son/google-cloud-sdk/lib/googlecloudsdk/core/credentials/store.py", line 32, in <module>
from googlecloudsdk.core import http
File "/Users/tran.ba.vinh.son/google-cloud-sdk/lib/googlecloudsdk/core/http.py", line 31, in <module>
from googlecloudsdk.core import http_proxy
File "/Users/tran.ba.vinh.son/google-cloud-sdk/lib/googlecloudsdk/core/http_proxy.py", line 26, in <module>
import httplib2
File "/Users/tran.ba.vinh.son/google-cloud-sdk/lib/third_party/httplib2/__init__.py", line 18, in <module>
from httplib2.python2.httplib2 import *
File "/Users/tran.ba.vinh.son/google-cloud-sdk/lib/third_party/httplib2/python2/httplib2/__init__.py", line 35, in <module>
import gzip
File "/usr/local/Cellar/python#2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/gzip.py", line 9, in <module>
import zlib
ImportError: No module named zlib
I tried with Homebrew but same error:
brew cask install google-cloud-sdk
And even after install zlib via brew install zlib. I still got that error. Please help me if you have any suggestions, thanks a lot !
I found this comment on homebrew core that fixed it for me.
TL;DR ->
sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
I had this issue when installing asdf as well. I ran the command above and then brew install asdf worked. I think this issue happens after a macOS update because I had to run it again to install google-cloud-sdk.
Install Developer Command Line Tools :
xcode-select --install
Reinstall python2 :
brew reinstall python2

Not being able to install LinkChecker

I'm having issues installing broken link-checker.
When I do 'sudo pip install LinkChecker' like said in installation, I get following error
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-uBq7xh/LinkChecker/setup.py", line 95, in <module>
import py2app
File "/Library/Python/2.7/site-packages/py2app/__init__.py", line 31, in <module>
__version__ = pkg_resources.require('py2app')[0].version
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 968, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 854, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'macholib>=1.4' distribution was not found and is required by py2app
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-uBq7xh/LinkChecker/
You are using pip version 8.1.2, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
The error message you get suggests you fail to meet the dependencies needed for the package you're installing.
Try installing macholib and upgrading pip, as suggested by the log
pip install macholib
pip install --upgrade pip

Resources