python speech recognition not getting install [duplicate] - python

This question already has answers here:
I can't install pyaudio on Windows? How to solve "error: Microsoft Visual C++ 14.0 is required."?
(17 answers)
Closed 8 months ago.
I have being tiring to install python speech recognition for a long time but getting the same problem on running
pip install pyaudio
Output:
Collecting pyaudio
Using cached PyAudio-0.2.11.tar.gz (37 kB)
Preparing metadata (setup.py) ... done
Building wheels for collected packages: pyaudio
Building wheel for pyaudio (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [9 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.10
copying src\pyaudio.py -> build\lib.win-amd64-3.10
running build_ext
building '_portaudio' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pyaudio
Running setup.py clean for pyaudio
Failed to build pyaudio
Installing collected packages: pyaudio
Running setup.py install for pyaudio ... error
error: subprocess-exited-with-error
× Running setup.py install for pyaudio did not run successfully.
│ exit code: 1
╰─> [9 lines of output]
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.10
copying src\pyaudio.py -> build\lib.win-amd64-3.10
running build_ext
building '_portaudio' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> pyaudio
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
As I understand from:
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
I had to install 'Microsoft Visual C++ 14.0 or greater' so I did. But same result even after
that!
What am I supposes to do.

You can try this
pip install pipwin
then
pipwin install pyaudio

This is not a problem with just you, everyone faces this.
Here's a fix I hope will work for you:
pip install pipwin
pipwin install pyaudio
to install pyaudio via pipwin, sometimes the command doesn't work so try
pipwin refresh and run pipwin install pyaudio again
If the above steps do not work, try going to Python Packages and install your system-specific version of pyaudio.
then opening a cmd instance in the directory you installed the package and run
pip install package
replace 'package' with the name of the file you downloaded.

Related

Install C++ extension for Python

I'm quite a noob in Python, but I'm using PyCharm as my IDE and I want to install and use TLSH: https://pypi.org/project/python-tlsh/
So what I did (in order to use TLSH, I have to install python-tlsh, so I run this command in the windows command prompt (run as an administrator):
C:\Users\myname\AppData\Local\Programs\Python\Python310\Scripts>pip install python-tlsh
but then I get this error:
`Collecting python-tlsh
Using cached python-tlsh-4.5.0.tar.gz (40 kB)
Preparing metadata (setup.py) ... done
Building wheels for collected packages: python-tlsh
Building wheel for python-tlsh (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [5 lines of output]
running bdist_wheel
running build
running build_ext
building 'tlsh' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for python-tlsh
Running setup.py clean for python-tlsh
Failed to build python-tlsh
Installing collected packages: python-tlsh
Running setup.py install for python-tlsh ... error
error: subprocess-exited-with-error
× Running setup.py install for python-tlsh did not run successfully.
│ exit code: 1
╰─> [7 lines of output]
running install
C:\Users\myname\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_ext
building 'tlsh' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> python-tlsh
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.`
so I installed Microsoft Visual C++ x64 (at least I think I did): https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170, I continued without code (maybe I need an account or so..?), but it still doesn't work. I tried it via the terminal of PyCharm, doesn't work either.
#tyfon-e Thank you, but then I get a similar error, also when I execute it in the terminal of Pycharm. it keeps saying that I need Visual Studio, while I already installed Build Tools and Community and also enabled C++ Build Tools
Also, Stackoverflow rejects my edit because "I should have posted it as a comment", not considering the fact that I can't post comments because it's a relatively new account and I need to have 50 points.
Try to install it from Pycharm Settings.
Head to File --> Settings --> Project then Python Interpreter.
down you will have "+" button, click it and search for it there.
Look at this Image

Unable to install mysqlclient in django

I am using the latest python version 3.11 in django framework, for that I need to install mysqlclient . But there was error when I try to install
pip install mysqlclient
Output like this as error:
Building wheels for collected packages: mysqlclient
Building wheel for mysqlclient (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [23 lines of output]
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools
/
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for mysqlclient
Running setup.py clean for mysqlclient
Failed to build mysqlclient
Installing collected packages: mysqlclient
Running setup.py install for mysqlclient ... error
error: subprocess-exited-with-error
× Running setup.py install for mysqlclient did not run successfully.
│ exit code: 1
╰─> [25 lines of output]
running install
C:\Users\dsema\PycharmProjects\stock\venv\Lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated.
Use build and pip and other standards-based tools.
warnings.warn(
running build_ext
building 'MySQLdb._mysql' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools
/
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> mysqlclient
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
Any idea can solve it?
You're evidently on Windows, so you'd want to make sure pip attempts to use binary packages of mysqlclient rather than even attempting to build one from scratch:
pip install mysqlclient --only-binary=mysqlclient
However, this may install an older version of mysqlclient since there are no binary packages for the 32-bit Python 3.11 you're using. If your machine is capable of running the 64-bit version, I would strongly recommend you switch to it instead, since it's likely 32-bit support will be waning more and more in the near future.

pytrec library not able to install on my system raising error

I am trying to install the pytrec_eval library in python and is throwing me the following error
`
pip install pytrec_eval
Collecting pytrec_eval
Using cached pytrec_eval-0.5.tar.gz (15 kB)
Preparing metadata (setup.py) ... done
Installing collected packages: pytrec_eval
DEPRECATION: pytrec_eval is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
Running setup.py install for pytrec_eval ... error
error: subprocess-exited-with-error
× Running setup.py install for pytrec_eval did not run successfully.
│ exit code: 1
╰─> [15 lines of output]
Fetching trec_eval from https://github.com/usnistgov/trec_eval/archive/v9.0.8.tar.gz.
C:\Users\c\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\dist.py:771: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead
warnings.warn(
running install
C:\Users\c\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-311
creating build\lib.win-amd64-cpython-311\pytrec_eval
copying py\__init__.py -> build\lib.win-amd64-cpython-311\pytrec_eval
running build_ext
building 'pytrec_eval_ext' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> pytrec_eval
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
`
I have tried installing the following and rerun the command to no success.
cmake
Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
pip install trectools --user
My system:
Windows 10
Python 3.8.11 and Python 3.11.0 (two different envs failure)
Visual Studio Code
Accoring to this line:
error: Microsoft Visual C++ 14.0 or greater is required. Get it with
"Microsoft C++ Build Tools":
https://visualstudio.microsoft.com/visual-cpp-build-tools/
You need to install Microsoft Visual C++ 14.0.

How I cam fix error in installing pyminzip

When I try to install pyminzip I see this
C:\Users\User>pip install pyminizip
Collecting pyminizip
Downloading pyminizip-0.2.4.tar.gz (258 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 258.7/258.7 kB 155.4 kB/s eta 0:00:00
Preparing metadata (setup.py) ... done
Building wheels for collected packages: pyminizip
Building wheel for pyminizip (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [5 lines of output]
running bdist_wheel
running build
running build_ext
building 'pyminizip' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pyminizip
Running setup.py clean for pyminizip
Failed to build pyminizip
Installing collected packages: pyminizip
Running setup.py install for pyminizip ... error
error: subprocess-exited-with-error
× Running setup.py install for pyminizip did not run successfully.
│ exit code: 1
╰─> [7 lines of output]
running install
C:\Users\User\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_ext
building 'pyminizip' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> pyminizip
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
It's explicitly said :
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
Please install Microsoft Visual C++ compiler to make it work

Failed building wheel for minepy

I'm using windows 10 and Python 3.8.10. When I try to install minepy module via "pip install minepy", I get an error as following:
pip install minepy
C:\Users\sotka>pip install minepy
Collecting minepy
Using cached minepy-1.2.6.tar.gz (496 kB)
Preparing metadata (setup.py) ... done
Requirement already satisfied: numpy>=1.3.0 in c:\users\sotka\appdata\local\packages\pythonsoftwarefoundation.python.3.8_qbz5n2kfra8p0\localcache\local-packages\python38\site-packages (from minepy) (1.18.1)
Building wheels for collected packages: minepy
Building wheel for minepy (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [10 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-38
creating build\lib.win-amd64-cpython-38\minepy
copying minepy\__init__.py -> build\lib.win-amd64-cpython-38\minepy
running build_ext
building 'minepy.mine' extension
error: [WinError 2] The system cannot find the file specified
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for minepy
Running setup.py clean for minepy
Failed to build minepy
Installing collected packages: minepy
Running setup.py install for minepy ... error
error: subprocess-exited-with-error
× Running setup.py install for minepy did not run successfully.
│ exit code: 1
╰─> [12 lines of output]
running install
C:\Users\sotka\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-38
creating build\lib.win-amd64-cpython-38\minepy
copying minepy\__init__.py -> build\lib.win-amd64-cpython-38\minepy
running build_ext
building 'minepy.mine' extension
error: [WinError 2] The system cannot find the file specified
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> minepy
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
What I have already tried:
updated pip, python
updated visual studio build tools
manually installed the module by copying the files to where the other modules are
manually downloaded unofficial minepy module and installed
No luck so far. I'd use some help. Thanks in advance

Categories