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

Importing library in PyCharm Python Console raises ModuleNotFoundError #20

Closed
guruappa opened this issue Oct 6, 2022 · 1 comment
Closed

Comments

@guruappa
Copy link

guruappa commented Oct 6, 2022

Hi guys,

I was trying the library out in the PyCharm IDE. Whenever I try to import libraries, it is throwing the ModuleNotFoundError for _testcapi. I did read in one of the closed issues that this is no longer an issue. But I could not find a working solution to the issue on my computer. I tried reinstalling the library multiple times. Any help would be much appreciated.

I am trying the library on Python 3.10 on Fedora box.

from py_vollib import black_scholes
Traceback (most recent call last):
File "/usr/lib64/python3.10/code.py", line 90, in runcode
exec(code, self.locals)
File "", line 1, in
File "/home/guruappa/.local/share/JetBrains/Toolbox/apps/PyCharm-P/ch-0/222.4167.33/plugins/python/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/run/media/guruappa/programs/projects/trade_station/venv/lib/python3.10/site-packages/py_vollib/black_scholes/init.py", line 44, in
from py_vollib.black import undiscounted_black
File "/home/guruappa/.local/share/JetBrains/Toolbox/apps/PyCharm-P/ch-0/222.4167.33/plugins/python/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/run/media/guruappa/programs/projects/trade_station/venv/lib/python3.10/site-packages/py_vollib/black/init.py", line 44, in
import py_lets_be_rational as lets_be_rational
File "/home/guruappa/.local/share/JetBrains/Toolbox/apps/PyCharm-P/ch-0/222.4167.33/plugins/python/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/run/media/guruappa/programs/projects/trade_station/venv/lib/python3.10/site-packages/py_lets_be_rational/init.py", line 30, in
from py_lets_be_rational.lets_be_rational import black
File "/home/guruappa/.local/share/JetBrains/Toolbox/apps/PyCharm-P/ch-0/222.4167.33/plugins/python/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/run/media/guruappa/programs/projects/trade_station/venv/lib/python3.10/site-packages/py_lets_be_rational/lets_be_rational.py", line 35, in
from py_lets_be_rational.exceptions import BelowIntrinsicException, AboveMaximumException
File "/home/guruappa/.local/share/JetBrains/Toolbox/apps/PyCharm-P/ch-0/222.4167.33/plugins/python/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/run/media/guruappa/programs/projects/trade_station/venv/lib/python3.10/site-packages/py_lets_be_rational/exceptions.py", line 30, in
from py_lets_be_rational import constants
File "/home/guruappa/.local/share/JetBrains/Toolbox/apps/PyCharm-P/ch-0/222.4167.33/plugins/python/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/run/media/guruappa/programs/projects/trade_station/venv/lib/python3.10/site-packages/py_lets_be_rational/constants.py", line 32, in
from _testcapi import DBL_MIN, DBL_MAX
File "/home/guruappa/.local/share/JetBrains/Toolbox/apps/PyCharm-P/ch-0/222.4167.33/plugins/python/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
ModuleNotFoundError: No module named '_testcapi'

@lbrichards
Copy link
Contributor

fixed in github repository (not yet in PyPI)

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

2 participants