I have written api using python 3.6. The code is encrypted via cython module. So the file is in .so format.
I have converted python file into a .so format using this command:
python3.6 compile.py build_ext --inplace
My python files structure is in the following format:
WORKING DIR = /opt/pdm
- PD
- deployment_utils
- init.py
- start_deployment_utils.py
- deployment_utils.cpython-36m-x86_64-linux-gnu.so
- api.cpython-36m-x86_64-linux-gnu.so
- deployment_utils
init.py
from flask import Flask
app = Flask(__name__)
from .api import *
import logging
logging.basicConfig(level=logging.INFO)
start_deployment_utils.py
from PD.deployment_utils import app
import os
if __name__ == '__main__':
app_host = os.environ.get('HOST', '0.0.0.0')
app_port = os.environ.get('PORT', 5000)
app.run(host=app_host, port=int(app_port))
When I try to run
/usr/bin/python3.6 -m PD.deployment_utils.start_deployment_utils &
It shows me
File "/usr/lib/python3.6/runpy.py", line 183, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/usr/lib/python3.6/runpy.py", line 109, in _get_module_details
__import__(pkg_name)
File "/opt/pdm/PD/deployment_utils/init.py", line 17, in <module>
from .api import *
File "PD/deployment_utils/api.py", line 12, in init PDBuild.PD.deployment_utils.api
ImportError: /opt/pdm/PD/deployment_utils/deployment_utils.cpython-36m-x86_64-linux-gnu.so: undefined symbol: PyFPE_jbuf
I changed my cython version also. But it not worked. What I am doing wrong here?