I am getting the following error in python 3.8.3 build machine.
Error log is as follows :
SLS_DEBUG=* serverless package --stage dev --package sls-package-output --region ap-south-1
Serverless: Generated requirements from /tmp/seed/source/requirements.txt in /tmp/seed/source/.serverless/requirements.txt...
Serverless: Installing requirements from /root/.cache/serverless-python-requirements/7ee0c6b93f1a77ee04668649db1f76708e8320f38ef3110c096a84229dacdf2c_slspyc/requirements.txt ...
Serverless: Using download cache directory /root/.cache/serverless-python-requirements/downloadCacheslspyc
Serverless: Running ...
Error ---------------------------------------------------
Error: STDOUT:
STDERR: Traceback (most recent call last):
File "/root/.pyenv/versions/3.8.3/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/root/.pyenv/versions/3.8.3/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/root/.pyenv/versions/3.8.3/lib/python3.8/site-packages/pip/__main__.py", line 19, in <module>
sys.exit(_main())
File "/root/.pyenv/versions/3.8.3/lib/python3.8/site-packages/pip/_internal/main.py", line 45, in main
command = create_command(cmd_name, isolated=("--isolated" in cmd_args))
File "/root/.pyenv/versions/3.8.3/lib/python3.8/site-packages/pip/_internal/commands/__init__.py", line 96, in create_command
module = importlib.import_module(module_path)
File "/root/.pyenv/versions/3.8.3/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/root/.pyenv/versions/3.8.3/lib/python3.8/site-packages/pip/_internal/commands/install.py", line 23, in <module>
from pip._internal.cli.req_command import RequirementCommand
File "/root/.pyenv/versions/3.8.3/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 20, in <module>
from pip._internal.network.session import PipSession
File "/root/.pyenv/versions/3.8.3/lib/python3.8/site-packages/pip/_internal/network/session.py", line 17, in <module>
from pip._vendor import requests, six, urllib3
File "/root/.pyenv/versions/3.8.3/lib/python3.8/site-packages/pip/_vendor/requests/__init__.py", line 97, in <module>
from pip._vendor.urllib3.contrib import pyopenssl
File "/root/.pyenv/versions/3.8.3/lib/python3.8/site-packages/pip/_vendor/urllib3/contrib/pyopenssl.py", line 46, in <module>
import OpenSSL.SSL
File "/root/.pyenv/versions/3.8.3/lib/python3.8/site-packages/OpenSSL/__init__.py", line 8, in <module>
from OpenSSL import crypto, SSL
File "/root/.pyenv/versions/3.8.3/lib/python3.8/site-packages/OpenSSL/crypto.py", line 1550, in <module>
class X509StoreFlags(object):
File "/root/.pyenv/versions/3.8.3/lib/python3.8/site-packages/OpenSSL/crypto.py", line 1570, in X509StoreFlags
CB_ISSUER_CHECK = _lib.X509_V_FLAG_CB_ISSUER_CHECK
AttributeError: module 'lib' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK'
at /tmp/seed/source/node_modules/serverless-python-requirements/lib/pip.js:325:13
at Array.forEach (<anonymous>)
at installRequirements (/tmp/seed/source/node_modules/serverless-python-requirements/lib/pip.js:312:28)
at installRequirementsIfNeeded (/tmp/seed/source/node_modules/serverless-python-requirements/lib/pip.js:556:3)
at ServerlessPythonRequirements.installAllRequirements (/tmp/seed/source/node_modules/serverless-python-requirements/lib/pip.js:635:29)
at ServerlessPythonRequirements.tryCatcher (/tmp/seed/source/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/tmp/seed/source/node_modules/bluebird/js/release/promise.js:547:31)
at Promise._settlePromise (/tmp/seed/source/node_modules/bluebird/js/release/promise.js:604:18)
at Promise._settlePromise0 (/tmp/seed/source/node_modules/bluebird/js/release/promise.js:649:10)
at Promise._settlePromises (/tmp/seed/source/node_modules/bluebird/js/release/promise.js:729:18)
at _drainQueueStep (/tmp/seed/source/node_modules/bluebird/js/release/async.js:93:12)
at _drainQueue (/tmp/seed/source/node_modules/bluebird/js/release/async.js:86:9)
at Async._drainQueues (/tmp/seed/source/node_modules/bluebird/js/release/async.js:102:5)
at Immediate.Async.drainQueues [as _onImmediate] (/tmp/seed/source/node_modules/bluebird/js/release/async.js:15:14)
at processImmediate (internal/timers.js:456:21)
at process.topLevelDomainCallback (domain.js:137:15)
Get Support --------------------------------------------
Docs: docs.serverless.com
Bugs: github.com/serverless/serverless/issues
Issues: forum.serverless.com
Your Environment Information ---------------------------
Operating System: linux
Node Version: 12.18.0
Framework Version: 2.66.2
Plugin Version: 5.5.4
SDK Version: 4.3.2
Components Version: 3.18.2
ERROR: STDOUT: