I am running Python 3.8.5 on Mac OS Big sur.
The issue originates from my attempt to use the python library speech_recognition.
From https://github.com/Uberi/speech_recognition, an example of code contains the following, which results in the RequestError, which is an import error.
try:
print("Sphinx thinks you said " + r.recognize_sphinx(audio, language = 'it_IT'))
except sr.UnknownValueError:
print("Sphinx could not understand audio")
except sr.RequestError as e:
print("Sphinx error; {0}".format(e))
Attempting to install the module pocketsphinx with pip, I get two large bodies of errors, but at the end of the first block there is this:
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for pocketsphinx
Any search on the internet will lead to this solution (github: https://github.com/deanmalmgren/textract/issues/209, stack overflow: ERROR: Failed building wheel for pocketsphinx while trying to install pocketsphinx with pip):
sudo apt-get install -y python python-dev python-pip build-essential swig git libpulse-dev
pip install pocketsphinx
Now, it is my understanding that apt-get is not available on Mac OS X. Instead, you can use brew. But almost none of these can be installed with brew.
I tried to run:
brew install pocketsphinx
And it installed cmu-pocketsphinx, but this doesn't help me in using pocketsphinx in python.
I also tried all the instructions in the "Install development version" on https://pypi.org/project/pocketsphinx/.
I even tried modifying 2 lines of c code as per instructions here, but to no avail:
https://github.com/MycroftAI/mycroft-precise/issues/75
Without pocketsphinx, it's impossible to use, among others, speech_recognition, so my question is how can you install pocketsphinx for python?
Related
I was installing firebase-admin using pip on my raspberry pi 3b+ using the following command:
pip3 install firebase-admin
However it always ends with an error saying "Error building wheel for cryptography"
Here is the full error message:
/tmp/pip-build-env-k7qo7p54/overlay/lib/python3.7/site-packages/setuptools/command/build_py.py:202: SetuptoolsDeprecationWarning: Installing 'cryptography.hazmat.bindings._rust' as data is deprecated, please list it in packages.
!!
############################
# Package would be ignored #
############################
Python recognizes 'cryptography.hazmat.bindings._rust' as an importable package,
but it is not listed in the `packages` configuration of setuptools.
'cryptography.hazmat.bindings._rust' has been automatically added to the distribution only
because it may contain data files, but this behavior is likely to change
in future versions of setuptools (and therefore is considered deprecated).
Please make sure that 'cryptography.hazmat.bindings._rust' is included as a package by using
the `packages` configuration field or the proper discovery methods
(for example by using `find_namespace_packages(...)`/`find_namespace:`
instead of `find_packages(...)`/`find:`).
You can read more about "package discovery" and "data files" on setuptools
documentation page.
!!
check.warn(importable)
=============================DEBUG ASSISTANCE=============================
If you are seeing a compilation error please try the following steps to
successfully install cryptography:
1) Upgrade to the latest pip and try again. This will fix errors for most
users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
2) Read https://cryptography.io/en/latest/installation/ for specific
instructions for your platform.
3) Check our frequently asked questions for more information:
https://cryptography.io/en/latest/faq/
4) Ensure you have a recent Rust toolchain installed:
https://cryptography.io/en/latest/installation/#rust
Python: 3.7.3
platform: Linux-5.10.103-v7+-armv7l-with-debian-10.13
pip: n/a
setuptools: 67.0.0
setuptools_rust: 1.5.2
rustc: n/a
=============================DEBUG ASSISTANCE=============================
error: can't find Rust compiler
If you are using an outdated pip version, it is possible a prebuilt wheel is available for this package but pip is not able to install from it. Installing from the wheel would avoid the need for a Rust compiler.
To update pip, run:
pip install --upgrade pip
and then retry package installation.
If you did intend to build this package from source, try installing a Rust compiler from your system package manager and ensure it is on the PATH during installation. Alternatively, rustup (available at https://rustup.rs) is the recommended way to download and update the Rust compiler toolchain.
This package requires Rust >=1.48.0.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for cryptography
Failed to build cryptography
ERROR: Could not build wheels for cryptography, which is required to install pyproject.toml-based projects
I have tried different commands like:
pip3 install firebase-admin
or
python -m pip install firebase-admin
I have upgraded pip and tried again, but still it didn't work
I faced a similar problem long time ago and solved by installing openssl. Tried it this time, it didn't work
Also tried installing rust compiler and using it but it didn't work
I am using Raspbian OS Buster on my Raspberry Pi 3
I have tried fresh installs of the OS
Still the same problem occurs
It's possible I should just open this is an issue on the Enchant package, but it could definitely be something I'm missing too. I'm using El Capitan and python 2.7. I tried a few things:
pip install penchant seems to successfully install pyenchant-1.6.6, but when I try to import enchant I get the error 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. I followed the advice here and upgraded pip.
I followed the advice here and started with brew install enchant, but that gave the error
curl: (22) The requested URL returned error: 404 Not Found
Error: Failed to download resource "glib--patch"
Download failed: https://gist.githubusercontent.com/jacknagel/af332f42fae80c570a77/raw/7b5fd0d2e6554e9b770729fddacaa2d648327644/glib-hardcoded-paths.diff
I also downloaded the wheel here (second-to-last link) and tried to pip install it, but got the error that it is not a supported wheel on this platform.
Thoughts? Thanks.
I am trying to install the keras package for python on a openSUSE server where I don't have root access. According to the instructions, I should install numpy, scipy, pyyaml, Theano, HDF5 and h5py. The server already has numpy and spicy, I installed pyyaml and Theano using "pip install XXX --user".
I downloaded HDF5 source and installed it by running the ./configure, and it was installed successfully, under folder "/home/myname/software/hdf5". Now the last step is to install h5py, where I was stuck in and can't find solutions online.
I tried:
HDF5_DIR=~/software/hdf5/ pip install h5py --user
And getting the following error:
/usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld:
cannot find -lhdf5
/usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld:
cannot find -lhdf5_hl
collect2: error: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
Then I tried:
CFLAGS="-I/usr/lib/openmpi/include/ -I/home/myname/software/hdf5/include" LDFLAGS="-L/home/myname/software/hdf5/lib" pip install h5py --user
But getting the same error. I downloaded the source and tried:
HDF5_DIR=~/software/hdf5/ python setup.py install --user
But still getting the same error. It seems that the installer is not trying to look for things in my customized hdf5 folder. Could you help me on this? Thank you very much!
bash-4.1# yum install python-devel
Loaded plugins: fastestmirror, rhnplugin
This system is receiving updates from RHN Classic or RHN Satellite.
Loading mirror speeds from cached hostfile
* rpmforge: mirror.smartmedia.net.id
* webtatic-el5: uk.repo.webtatic.com
http://192.168.210.26/centos/6/updates/i386/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
Trying other mirror.
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package python-devel.x86_64 0:2.6.6-36.el6 will be installed
--> Processing Dependency: python(x86-64) = 2.6.6-36.el6 for package: python-devel-2.6.6-36.el6.x86_64
--> Finished Dependency Resolution
Error: Package: python-devel-2.6.6-36.el6.x86_64 (centos64-x86_64)
Requires: python(x86-64) = 2.6.6-36.el6
Installed: python-2.6.6-37.el6_4.x86_64 (#centos64-updates-x86_64)
python(x86-64) = 2.6.6-37.el6_4
Available: python-2.6.6-36.el6.x86_64 (centos64-x86_64)
python(x86-64) = 2.6.6-36.el6
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
Can somebody help me with above error , I am getting.
Just to let everybody know I am trying to install cx_Oracle on my CentOS system (CentOS release 6.4) and I got this error:-
error: command 'gcc' failed with exit status 1
So, I searched and found out to install python-devel and to do that I am getting the above error.
You have a newer version of python installed than the corresponding source package you're trying to install.
You have python 2.6.6-37 installed but the latest available source package from your repos (that you can successfully connect to) is 2.6.6-36.
But it looks like the python you have installed came from your "updates" repo,
http://192.168.210.26/centos/6/updates/i386/repodata/repomd.xml which isn't working at t he moment.
If that repo also had the corresponding python-devel-2.6.6-37 package, and it worked, (didn't throw a PYCURL error) you'd be fine, yum would find that and use it.
So your first step should be fixing your LAN repo / mirror.
I had an error uploading images on my Python/Django site, and so installed the PIL library (1.1.6 on python 2.4 with CentOS) and also installed the jpeg library using $ sudo yum install freetype freetype-devel jpeg jpeg-devel libpng libpng-devel and the pil library using wget http://effbot.org/downloads/Imaging-1.1.6.tar.gz
After unpacking, and running: python setup.py build_ext -i and sudo python setup.py install
I get an long string of errors, but they end in (previous ones are all about error: expected attribute etc...) :
_imaging.c:3041: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before âfunctionsâ
_imaging.c:3138: warning: return type defaults to âintâ
_imaging.c: In function âDL_EXPORTâ:
_imaging.c:3138: error: expected declaration specifiers before âinit_imagingâ
_imaging.c:3149: error: expected â{â at end of input
error: command 'gcc' failed with exit status 1
Please let me know if more of the errors messages are required to properly troubleshoot.