Error to install RichDem using python pip [duplicate] - python

This question already has answers here:
Error "Microsoft Visual C++ 14.0 is required (Unable to find vcvarsall.bat)"
(36 answers)
Error while installing lxml through pip: Microsoft Visual C++ 14.0 is required
(8 answers)
Pip error: Microsoft Visual C++ 14.0 is required
(13 answers)
Pip error even Microsoft Visual C++ 14.0 is installed
(4 answers)
How to solve "error: Microsoft Visual C++ 14.0 or greater is required" when installing Python packages?
(9 answers)
Closed last month.
I tried to install the module RichDem using the code bellow
$ pip install richdem
i got the error:
Installing collected packages: richdem
Running setup.py install for richdem ... error
error: subprocess-exited-with-error
× Running setup.py install for richdem did not run successfully.
│ exit code: 1
╰─> [19 lines of output]
Warning! Could not find RichDEM version. Software will still work, but reproducibility will be compromised.
Using RichDEM hash=Unknown, time=Unknown
C:\Users\engfl\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\engfl\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\richdem
copying richdem\cli.py -> build\lib.win-amd64-cpython-311\richdem
copying richdem\__init__.py -> build\lib.win-amd64-cpython-311\richdem
running build_ext
COMPILER msvc
COMPILER ARGUMENTS ['-std=c++11', '-g', '-fvisibility=hidden', '-O3']
building '_richdem' 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.
× Encountered error while trying to install package.
╰─> richdem
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
I've tried to solve it by installing for conda, but it didn't work. Someone could help me?
i tried to install richdem

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 Microsoft Visual C++ 14.0.
Check out this solution.

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

ERROR: Failed building wheel for twisted-iocpsupport [duplicate]

This question already has answers here:
How to solve "error: Microsoft Visual C++ 14.0 or greater is required" when installing Python packages?
(9 answers)
Error "Microsoft Visual C++ 14.0 is required (Unable to find vcvarsall.bat)"
(36 answers)
Closed 20 days ago.
I was trying to install daphne===4.0.0 but I keep getting this error,
ERROR: Failed building wheel for twisted-iocpsupport
Building wheels for collected packages: twisted-iocpsupport
Building wheel for twisted-iocpsupport (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for twisted-iocpsupport (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [5 lines of output]
running bdist_wheel
running build
running build_ext
building 'twisted_iocpsupport.iocpsupport' 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 twisted-iocpsupport
Failed to build twisted-iocpsupport
ERROR: Could not build wheels for twisted-iocpsupport, which is required to install pyproject.toml-based projects
This error occurs because twisted-iocpsupport is not supported by python 3.11
Consider going back to any versions between 3.6 and 3.10
that fixed the problem for me.
Go to twisted-iocpsupport documentation and see the versions of python it supports
According to the docs,
Applications must not import names from the twisted_iocpsupport package directly.
So, if you're using any file with package versioning (requirements.txt, project.toml, etc.), you should remove-it manually.

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.

python speech recognition not getting install [duplicate]

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.

Categories