You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because the curvesim.logging module has the same name as the python logging module, an error is reported when importing curvesim. I recommend renaming it.
Motivation / Use-case
When developing based on curvesim, I found that import curvesim will report an error and cannot be run. The reason is that curvesim.logging has the same name as the python logging module. After experiments, it was found that modifying the logging module name can solve this problem.
Python 3.10.10 (main, Jun 8 2023, 14:33:30) [Clang 14.0.3 (clang-1403.0.22.14.1)] on darwin
Type "help", "copyright", "credits" or "license"for more information.
>>> import curvesim
Traceback (most recent call last):
File "<stdin>", line 1, in<module>
File "/Users/stan/Library/Caches/pypoetry/virtualenvs/crvusdsim-pUi1XxWR-py3.10/lib/python3.10/site-packages/curvesim/__init__.py", line 4, in<module>
from ._order_book import order_book
File "/Users/stan/Library/Caches/pypoetry/virtualenvs/crvusdsim-pUi1XxWR-py3.10/lib/python3.10/site-packages/curvesim/_order_book/__init__.py", line 6, in<module>
import matplotlib.pyplot as plt
File "/Users/stan/Library/Caches/pypoetry/virtualenvs/crvusdsim-pUi1XxWR-py3.10/lib/python3.10/site-packages/matplotlib/__init__.py", line 145, in<module>
import logging
File "/Users/stan/workcode/curve/curvesim/curvesim/logging.py", line 7, in<module>
import logging.config
ModuleNotFoundError: No module named 'logging.config';'logging' is not a package
Detailed Summary
Rename curvesim.logging module.
The text was updated successfully, but these errors were encountered:
btw, the way python namespacing works, having a module named logging in a package should not create an issue with import logging in any other module or dependent package. The name would only create a conflict if you already did something previously in your interpreter instance to import curvesim.logging as logging (setting sys.modules['logging']) or your sys.path starts looking from inside the package.
Thanks Reply! I can not reproduce this error today. I think you are right. Maybe it was caused by an internal conflict in my sys.path. Will close this issue.
Simple Summary
Because the
curvesim.logging
module has the same name as the python logging module, an error is reported when importingcurvesim
. I recommend renaming it.Motivation / Use-case
When developing based on curvesim, I found that import curvesim will report an error and cannot be run. The reason is that curvesim.logging has the same name as the python logging module. After experiments, it was found that modifying the logging module name can solve this problem.
Detailed Summary
Rename
curvesim.logging
module.The text was updated successfully, but these errors were encountered: