Reputation: 51
My Python code is using a module that uses OpenSSL. I'm running on a shared FreeBSD server.
When I try to run my code, I'm getting the error below. After researching, I thought that it was due to openssl-devel not being installed.
However, I've been informed that FreeBSD does not separate libraries and headers into separate packages the way Linux does. The headers for OpenSSL are found in /usr/local/include/openssl and OPENSSL_no_config is defined in conf.h.
What do I need to do for my code to recognize that the headers are in this location?
Thank you!
...
File "<virtual environment path>/lib/python3.7/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 16, in <module>
from cryptography.hazmat.bindings._openssl import ffi, lib
ImportError: <virtual environment path>/lib/python3.7/site-packages/cryptography/hazmat/bindings/_openssl.abi3.so: Undefined symbol "OPENSSL_no_config"
Edit: After doing more digging, I thought rebuilding my virtual environment and specifying these additional parameters would help when installing the libraries, but I faced the same error.
pip install --global-option=build_ext --global-option="-I/usr/local/include/openssl" -r requirements.txt
Upvotes: 1
Views: 812
Reputation: 51
This pip install command ended up working (in my original post I had included /openssl in the include directory and it was not needed):
pip install --global-option=build_ext --global-option="-I/usr/local/include/" -r requirements.txt
Upvotes: 1