Can't install pyenchant - pip

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?

Related

problems installing pip3 install virtualenvwrapper

I am using ubuntu 16.04, what and installed for the first time and I try to install pip3 install virtualenvwrapper for it tells me to install first sudo apt install python3-pip once you install it I run the command pip3 install virtualenvwrapper but it generates the following error.
Collecting virtualenvwrapper
Downloading https://files.pythonhosted.org/packages/c1/6b/2f05d73b2d2f2410b48b90d3783a0034c26afa534a4a95ad5f1178d61191/virtualenvwrapper-4.8.4.tar.gz (334kB)
100% |████████████████████████████████| 337kB 233kB/s
Complete output from command python setup.py egg_info:
Couldn't find index page for 'pbr' (maybe misspelled?)
No local packages or download links found for pbr
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-xwa__f7e/virtualenvwrapper/setup.py", line 7, in <module>
pbr=True,
File "/usr/lib/python3.5/distutils/core.py", line 108, in setup
_setup_distribution = dist = klass(attrs)
File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 269, in __init__
self.fetch_build_eggs(attrs['setup_requires'])
File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 313, in fetch_build_eggs
replace_conflicting=True,
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 826, in resolve
dist = best[req.key] = env.best_match(req, ws, installer)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1092, in best_match
return self.obtain(req, installer)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1104, in obtain
return installer(requirement)
File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 380, in fetch_build_egg
return cmd.easy_install(req)
File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 657, in easy_install
raise DistutilsError(msg)
distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('pbr')
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-xwa__f7e/virtualenvwrapper/

"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

BitStream for Python fails to install

I'm trying to install the bitstream Python package via pip on my windows7 machine. But it fails with:
Q:\python>pip install bitstream
Collecting bitstream
Using cached bitstream-2.4.0.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\vm\AppData\Local\Temp\pip-build-jdkts06o\bitstream\setup.py", line 5, in <module>
import ConfigParser
ModuleNotFoundError: No module named 'ConfigParser'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\vm\AppData\Local\Temp\pip-build-jdkts06o\bitstream\
But ConfigParser is already installed !
Q:\python>pip install configparser
Requirement already satisfied: configparser in c:\users\vm\appdata\local\programs\python\python36-32\lib\site-packages
bitstream is Python 2.7 only, do not install it with Py 3.6.

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

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

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

Resources