Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError: No module named '_testcapi' #11

Open
xxholyChalicexx opened this issue Jan 17, 2023 · 1 comment
Open

ModuleNotFoundError: No module named '_testcapi' #11

xxholyChalicexx opened this issue Jan 17, 2023 · 1 comment

Comments

@xxholyChalicexx
Copy link

xxholyChalicexx commented Jan 17, 2023

When i deploy my django app with
import py_vollib_vectorized in my views.py file
My site will be crashed and when i watch the log it says:

import py_vollib_vectorized
File "/venv/lib/python3.7/site-packages/py_vollib_vectorized/init.py", line 6, in
from .api import get_all_greeks, price_dataframe
File "/venv/lib/python3.7/site-packages/py_vollib_vectorized/api.py", line 7, in
from .models import vectorized_black, vectorized_black_scholes, vectorized_black_scholes_merton
File "venv/lib/python3.7/site-packages/py_vollib_vectorized/models.py", line 4, in
from ._model_calls import _black_scholes_merton_vectorized_call, _black_vectorized_call, _black_scholes_vectorized_call
File "venv/lib/python3.7/site-packages/py_vollib_vectorized/_model_calls.py", line 2, in
from py_lets_be_rational.constants import *
File "venv/lib/python3.7/site-packages/py_lets_be_rational/init.py", line 30, in
from py_lets_be_rational.lets_be_rational import black
File "venv/lib/python3.7/site-packages/py_lets_be_rational/lets_be_rational.py", line 35, in
from py_lets_be_rational.exceptions import BelowIntrinsicException, AboveMaximumException
File "venv/lib/python3.7/site-packages/py_lets_be_rational/exceptions.py", line 30, in
 from py_lets_be_rational import constants
File "venv/lib/python3.7/site-packages/py_lets_be_rational/constants.py", line 32, in
from _testcapi import DBL_MIN, DBL_MAX
 ModuleNotFoundError: No module named '_testcapi'

:
So this is after the installation of this "py_volib_vectorized" library. If i just comment out the importing of this library, it gets deployed successfully.
Python version: 3.7
Django version: 3.1.1

@xxholyChalicexx
Copy link
Author

OK, after checking on this error and comparing it with my system turns out in the python folder of "/usr/lib/python" have this folder called "lib-dynload" which consist of this file _testcapi......for some uknown(for now) reason its not available in my live server OS. Trying to figure out on that missing piece of folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant