Mozilla DeepSpeech on Alpine [closed] - python

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 years ago.
Improve this question
I am trying to install DeepSpeech in my Alpine container, and while I seem to fulfill all of the requirements according to the documentation, I get 'not compatible with this Python error'.
Here is the log from when I run pip install --verbose deepspeech
Step 10/13 : RUN uname -a
---> Running in dd5b145a0055
Linux dd5b145a0055 4.9.125-linuxkit #1 SMP Fri Sep 7 08:20:28 UTC 2018 x86_64 Linux
Removing intermediate container dd5b145a0055
---> e2324a616bc9
Step 11/13 : RUN python3 --version
---> Running in 127dd70a437e
Python 3.6.5
Removing intermediate container 127dd70a437e
---> 5c479002edcc
Step 12/13 : RUN pip3 --version
---> Running in 644ef37e87b1
pip 19.1.1 from /usr/local/lib/python3.6/site-packages/pip (python 3.6)
Removing intermediate container 644ef37e87b1
---> 4913080991d8
Step 13/13 : RUN pip3 install --verbose deepspeech
---> Running in a1e82420debc
Created temporary directory: /tmp/pip-ephem-wheel-cache-6thq7neq
Created temporary directory: /tmp/pip-req-tracker-89xh1p6c
Created requirements tracker '/tmp/pip-req-tracker-89xh1p6c'
Created temporary directory: /tmp/pip-install-rxt4ntrq
Collecting deepspeech
1 location(s) to search for versions of deepspeech:
* https://pypi.org/simple/deepspeech/
Getting page https://pypi.org/simple/deepspeech/
Looking up "https://pypi.org/simple/deepspeech/" in the cache
Request header has "max_age" as 0, cache bypassed
Starting new HTTPS connection (1): pypi.org:443
https://pypi.org:443 "GET /simple/deepspeech/ HTTP/1.1" 200 55772
Updating cache with response from "https://pypi.org/simple/deepspeech/"
Caching due to etag
Analyzing links from page https://pypi.org/simple/deepspeech/
Skipping link https://files.pythonhosted.org/packages/4f/71/3fbcf9309730496777375a51d441d33ec9c6a036dd0f9da5c09848625801/deepspeech-0.0.2-cp27-cp27m-macosx_10_12_x86_64.whl#sha256=b186405784bb989759a241d2f75e2aa88b4f88dd6377393620e45865cfcc0af8 (from https://pypi.org/simple/deepspeech/); it is not compatible with this Python
…
[91m ERROR: Could not find a version that satisfies the requirement deepspeech (from versions: none)
[0mCleaning up...
Removed build tracker '/tmp/pip-req-tracker-89xh1p6c'
[91mERROR: No matching distribution found for deepspeech
I seems that this is a common issue on a Windows environment, but this is a Alpine base image. What am I missing?

From https://github.com/mozilla/DeepSpeech/tree/v0.5.1#installing-bindings-from-source:
If pre-built binaries aren't available for your system, you'll need to install them from scratch. Follow these native_client installation instructions.
Alpine Linux uses the musl libc instead of glibc. The available DeepSpeech Python wheels for "manylinux" won't work on Alpine. You'll need to go through the compiling from source documentation. However, there still may be other musl libc incompatibilities compiling from source.
If Alpine is not a hard requirement you are likely to have a much better installation experience using another Linux base image that supports the pre-compiled wheels.

deepspeech is only available in 64-bit builds. Your python is probably 32-bit. Verify it with
python -c "import struct; print(struct.calcsize('P') * 8)"
If it shows 32-bit you need to reinstall 64-bit Python.

Related

Python3 on Mac having trouble loading libssh2

After getting updated to Monterey 12.2.1 and having Xcode updated to 13.2.1, I'm having trouble in a venv environment when I use the system installed Python, 3.10.2. My app is using ssh2-python, which needs to link to libssh2. I believe this spells it all out: (to skipg over the annoying horizontal scroll, the takeway text is '/usr/lib/libssh2.1.dylib' (no such file)
File "/Users/mnelson1/3m-install/venv-3.10.2/lib/python3.10/site-packages/pssh/clients/native/single.py", line 25, in <module>
from ssh2.error_codes import LIBSSH2_ERROR_EAGAIN
ImportError: dlopen(/Users/mnelson1/3m-install/venv-3.10.2/lib/python3.10/site-packages/ssh2/error_codes.cpython-310-darwin.so, 0x0002): Library not loaded: /private/var/folders/6s/q3hjdt5s00b5p_cpjbbxp6680000gr/T/pip-install-lasr65mk/ssh2-python_46cfb4509bee4529bbe0e4eacbb00674/src/src/libssh2.1.dylib
Referenced from: /Users/mnelson1/3m-install/venv-3.10.2/lib/python3.10/site-packages/ssh2/error_codes.cpython-310-darwin.so
Reason: tried: '/private/var/folders/6s/q3hjdt5s00b5p_cpjbbxp6680000gr/T/pip-install-lasr65mk/ssh2-python_46cfb4509bee4529bbe0e4eacbb00674/src/src/libssh2.1.dylib' (no such file), '/usr/lib/libssh2.1.dylib' (no such file)
Of course, libssh2 is actually installed:
❯ brew info libssh2
libssh2: stable 1.10.0 (bottled), HEAD
C library implementing the SSH2 protocol
https://www.libssh2.org/
/usr/local/Cellar/libssh2/1.10.0 (184 files, 999.8KB) *
Poured from bottle on 2022-03-03 at 15:00:10
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/libssh2.rb
License: BSD-3-Clause
==> Dependencies
Required: openssl#1.1 ✔
==> Options
--HEAD
Install HEAD version
==> Analytics
install: 101,845 (30 days), 301,986 (90 days), 1,138,668 (365 days)
install-on-request: 1,683 (30 days), 6,573 (90 days), 137,389 (365 days)
build-error: 2 (30 days)
❯ ls -l /usr/local/lib/libssh*
lrwxr-xr-x 1 mnelson1 staff 44 Mar 3 15:01 /usr/local/lib/libssh2.1.dylib# -> ../Cellar/libssh2/1.10.0/lib/libssh2.1.dylib
lrwxr-xr-x 1 mnelson1 staff 38 Mar 3 15:01 /usr/local/lib/libssh2.a# -> ../Cellar/libssh2/1.10.0/lib/libssh2.a
lrwxr-xr-x 1 mnelson1 staff 42 Mar 3 15:01 /usr/local/lib/libssh2.dylib# -> ../Cellar/libssh2/1.10.0/lib/libssh2.dylib
(Although I'm concerned about that build-error - I'm weak here and don't know if this is a real problem or not.)
Anyway, I can work around this by setting DYLD_LIBRARY_PATH (currently undefined) to /usr/local/lib.
I'm not experienced at installation management on the Mac, so I'm wondering why a brew install of the library doesn't just work? Even more confusing, if I use 3.10.2 (or any other version) from pyeval, I don't have the problem. Why does the system install of Python apparently have a different dynamic library path from the pyeval builds?
I don't have any python modules installed in the global or local locations, so I don't think it's anything else I've done:
❯ pip3 list installed
Package Version
---------- -------
pip 22.0.3
setuptools 58.1.0
wheel 0.37.1
I thought that it's possible that old cached pip installs might need to be rebuilt, so I've tested by running my install after completely deleting the pip3 cache, to no avail.
The good news is that most of my target installs are on Linux systems, and they don't seem to have this fickleness about libssh2, so the problem is limited to my development environment. But I'd like to have a better idea of what I'm doing wrong. And there are a few app users who are likely vulnerable to this, and I'd like to be able to give a coherent explanation of any necessary workarounds.
Searching for info on this problem I realize it's not an uncommon problem, discussions like this are scattered around, but the resolutions I've found don't enlighten things much for me.
libssh2 is installed, but Apple has depreciated its use in newer MacOS versions in favor of its own libraries, hence why it cannot be found. In your error, the package is looking for libssh2 in /usr/lib/libssh2.1.dylib, which does not contain the dylibs. You will need to find where they were installed (with brew 3.6.19 the default install path is /opt/homebrew/Cellar/ on Monterey 12.6.2)
The following command worked for me:
export DYLD_LIBRARY_PATH=/path to libssh2.1.dylib, 1.1, 1.0 etc/
For my system homebrew installed libssh2 and the .dylib files in the following path...
export DYLD_LIBRARY_PATH=/opt/homebrew/Cellar/libssh2/1.10.0/lib/
You can also place this export statement in your .bashrc or .zshrc so that you won't have to define it each time you restart the shell.
I found many of the solutions on other forums for this issue are outdated/do no work, it is possible this may not work in a future version.

No matching distribution found for sqlite3 [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 1 year ago.
Improve this question
Guys every time I try to install sqlite3 with pip I get the error:
ERROR: Could not find a version that satisfies the requirement sqlite3 (from versions:none)
ERROR: No matching distribution found for sqlite3
My python version: 3.10.0
My pip version: 21.3
How can I solve this? I believe it's regarding my version of python so how can i update the pip to fix this? I've already tried this pip --upgrade pip
Edited:
Guys I installed python 3.7.0 and it's still the same thing.
sqlite3 is part of the standard library, meaning it is already installed with Python.
You can write a script following the documentation, and notice it says nothing about installation procedures.
The error is self-explanatory. For anything that can be installed with pip, you should refer to the source - PyPi. Search for sqlite3 and notice that you get no exact match
Many languages have built-in modules, for example, you seem to have maybe some NodeJS experience, so you can import things like os, readline, net, http modules without needing to npm install. You simply require them.
Python/Pip is no different with a simple import.
this error I mentioned in the question doesn't show up on Linux when I try to install the same things
Is that so? Seems to work for me (Using Docker because I'm on a Mac)
$ docker run --rm -ti --entrypoint=ash python:3.10-alpine
Unable to find image 'python:3.10-alpine' locally
3.10-alpine: Pulling from library/python
Digest: sha256:78604a29496b7a1bd5ea5c985d69a0928db7ea32fcfbf71bbde3e317fdd9ac5e
Status: Downloaded newer image for python:3.10-alpine
/ # pip install sqlite3
ERROR: Could not find a version that satisfies the requirement sqlite3 (from versions: none)
ERROR: No matching distribution found for sqlite3

Error when installing django on windows using `pip install django`

I get an error when installing django using pip command
ERROR: After October 2020 you may experience errors when installing or updating
packages. This is because pip will change the way that it resolves dependency conflicts.
We recommend you use --use-feature=2020-resolver to test your packages with the
new resolver before it becomes the default.
drf-yasg 1.17.0 requires six>=1.10.0, but you'll have six 1.9.0 which is incompatible.
can anyone help?
Thanks in advance
According to this announcement, pip will introduce a new dependency resolver in October 2020, which will be more robust but might break some existing setups. Therefore they are suggesting users to try running their pip install scripts at least once (in dev mode) with this option: --use-feature=2020-resolver to anticipate any potential issue before the new resolver becomes the default in October 2020 with pip version 20.3.
On behalf of the PyPA, I am pleased to announce that we have just
released pip 20.2, a new version of pip. You can install it by running
python -m pip install --upgrade pip.
The highlights for this release are:
The beta of the next-generation dependency resolver is available
Faster installations from wheel files Improved handling of wheels
containing non-ASCII file contents Faster pip list using parallelized
network operations Installed packages now contain metadata about
whether they were directly requested by the user (PEP 376’s REQUESTED
file) The new dependency resolver is off by default because it is not
yet ready for everyday use. The new dependency resolver is
significantly stricter and more consistent when it receives
incompatible instructions, and reduces support for certain kinds of
constraints files, so some workarounds and workflows may break. Please
test it with the --use-feature=2020-resolver flag. Please see our
guide on how to test and migrate, and how to report issues. We are
preparing to change the default dependency resolution behaviour and
make the new resolver the default in pip 20.3 (in October 2020).

Using "pip install --platform" to install .so on windows [duplicate]

This question already has answers here:
What are the valid values for --platform, --abi, and --implementation for pip download?
(3 answers)
Closed 3 years ago.
In the help for pip -install I noticed the install option --platform -> "Only use wheels compatible with platform. Defaults to the platform of the running system."
I was thinking I could use this option to get the Linux binaries on my windows machine however I cannot seem to get it to work as expected.
What is the proper syntax for this option, and what exactly is a "Wheel"?
pip install --platform ubuntu --only-binary=:all: cryptography
Returns Errors:
ERROR: Could not find a version that satisfies the requirement cryptography (from versions: none)
ERROR: No matching distribution found for cryptography
Edit:
Thanks for the initial responses. When trying to install the linux .so files on a windows machine I am getting the same errors when using various versions of the command
pip install --platform linux_x86_64 --only-binary=:all: cryptography
In the cryptography document it identifies various linux supported distributions. https://cryptography.io/en/latest/installation/
Does anyone know how to get cryptography .so files using a windows machine?
A Wheel is a pre-built distribution format that provides faster installation compared to Source Distributions (sdist), especially when a project contains compiled extensions[2].
I don't think ubuntu is a possible value for the --platform option. Try with something like linux_x86_64 or linux_i386

pytorch for gpu installation error on ubuntu 14.04(cuda 8.0, python2.7.6, pip 19.0.1) - wheel not supported

I follow the tutorial command on pytorch site, but such errors came out.
error: torch-1.0.0-cp27m-linux_x86_64.whl is not a valid wheel filename.
I used following commands for installation.
pip install https://download.pytorch.org/whl/cu80/torch-1.0.0-cp27-cp27m-linux_x86_64.whl
The wheel is a ZIP archive with the .whl extension that should have a specially formatted file name and contain a relocatable Python package to be recognized on your platform.
Please use your web browser such as Firefox to obtain manylinux1 wheels directly from PyPI website:
torch-1.0.1.post2-cp27-cp27m-manylinux1_x86_64.whl (582.6 MB)
torch-1.0.1.post2-cp27-cp27mu-manylinux1_x86_64.whl (582.5 MB) <= try this one
Please make sure to choose one appropriate for your specific OS/platform. In your case, the mu-manylinux1 is the most likely choice. You could use this shell command to ensure:
$ python -c "import sys; print 'UCS4/UTF-32: mu-manylinux1' if sys.maxunicode > 65535 else 'UCS2/UTF-16: m-manylinux1'"
Python 3 version:
$ python3 -c "import sys; print('UCS4/UTF-32: mu-manylinux1' if sys.maxunicode > 65535 else 'UCS2/UTF-16: m-manylinux1')"
mu is more common and means that your Python stores Unicode data in UCS-4 (UTF-32) format.
cp27 stands for Python 2.7; likewise cp36 is for Python 3.6
x86_64 is for 64-bit platform. Pytorch doesn't support 32-bit..
All manylinux1 wheels require pip v8.1 or later to be pip install'ed (you have v19.0.1 - ok).
Regarding the SSLError...sslv3 alert handshake failure you've mentioned in the comment, it's caused by the fact that pip doesn't use old SSL/TLS protocols to connect to PyPI since about a year ago, but your system's underlying OpenSSL library is outdated, and Python 2.7.6 ssl module doesn't support the required TLS 1.2 protocol anyway. I will address this issue in your another posting.

Categories