Error while trying to install odoo15 requirements.txt on M1 - python

I am trying to install the requirements for odoo15 on my MBP M1 Pro running MacOS Ventura 13.0 in my virtual environment running python 3.10.8
but I keep getting the following error:
build/temp.macosx-12-arm64-cpython-310/_openssl.c:575:10: fatal error: 'openssl/opensslv.h' file not found
#include <openssl/opensslv.h>
^~~~~~~~~~~~~~~~~~~~
1 error generated.
error: command '/usr/bin/clang' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for cryptography
Building wheel for psycopg2 (setup.py) ... error
error: subprocess-exited-with-error
...
ld: warning: directory not found for option '-L/usr/local/opt/openssl/lib'
ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command '/usr/bin/clang' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for psycopg2
Running setup.py clean for psycopg2
...
Failed to build cryptography psycopg2
ERROR: Could not build wheels for cryptography, which is required to install pyproject.toml-based projects
Now, I have already spent a lot of time researching and it seems that openssl might be the problem here
I have already install openssl via brew, it is running the newest version, as suggested in this GitHub issue
I have installed the newest version of pip as suggested in this StackOverflow post
Edit: I have now also tried setting these flags as suggested in this StackOverflow post:
export LDFLAGS="-L/opt/homebrew/opt/openssl#1.1/lib"
export CPPFLAGS="-I/opt/homebrew/opt/openssl#1.1/include"
I have also retried everything in another venv using Python version 3.8

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

can't install pyaudio can't build weel error Mac

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
error: command '/usr/bin/gcc' failed with exit code 1
[end of output]
ERROR: Failed building wheel for PyAudio
Failed to build PyAudio
ERROR: Could not build wheels for PyAudio, which is required to install pyproject.toml-based projects
I get this error how to solve this ?
Mac user
it gives me can't build weel even tho I tired many Methods posted here

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.

Cannot install python-poppler

I am trying to install python-poppler by using pip install python-poppler. I am using a Jupyter Notebook on Windows.
When I run this, I receive the following errors:
RuntimeError: CMake must be installed to build the following extensions: poppler.cpp.modules
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for python-poppler
error: subprocess-exited-with-error
RuntimeError: CMake must be installed to build the following extensions: poppler.cpp.modules
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
I have Cmake installed. Any ideas on how to fix this?

Unable to install Aerospike pip package | Macbook M1 chip

I am trying to install aerospike in my virtualenv by using below command
pip install aerospike==5.0.0
but it is unable to install. It is throwing below error
Collecting aerospike==5.0.0
Using cached aerospike-5.0.0.tar.gz (182 kB)
Preparing metadata (setup.py) ... done
Building wheels for collected packages: aerospike
Building wheel for aerospike (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [150 lines of output]
info: Executing ./scripts/aerospike-client-c.sh
# ... very long output ... #
ld: warning: directory not found for option '-L/usr/local/opt/openssl#1.1/lib'
ld: warning: directory not found for option '-L/usr/local/opt/openssl/lib'
ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'clang' failed with exit status 1
[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.
╰─> aerospike
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
I have tried to install wheel and then install this package but it's not working.
I have also tried by installing rosetta2 on mac but it didn't work.
Also, if it requires whole output do let me know where I can share that publish the link here in my question.

Categories