Algorithm.Initialize() Error: During the algorithm initialization, the following exception has occurred: Loader.TryCreatePythonAlgorithm(): Unable to import python module ./cache/algorithm/project/main.pyc. AlgorithmPythonWrapper(): No module named 'data_api'
2025-09-30 13:01:46 : at
2025-09-30 13:01:46 : from data_api import ApiClient
2025-09-30 13:01:46 : in news_module.py: line 9
2025-09-30 13:01:46 : at
2025-09-30 13:01:46 : from news_module import NewsModule
2025-09-30 13:01:46 : in main.py: line 12
2025-09-30 13:01:46 : No module named 'data_api' Stack Trace: During the algorithm initialization, the following exception has occurred: Loader.TryCreatePythonAlgorithm(): Unable to import python module ./cache/algorithm/project/main.pyc. AlgorithmPythonWrapper(): No module named 'data_api'
2025-09-30 13:01:46 : at
2025-09-30 13:01:46 : from data_api import ApiClient
2025-09-30 13:01:46 : in news_module.py: line 9
2025-09-30 13:01:46 : at
2025-09-30 13:01:46 : from news_module import NewsModule
2025-09-30 13:01:46 : in main.py: line 12
2025-09-30 13:01:46 : No module named 'data_api': StackTrace: During the algorithm initialization, the following exception has occurred: Loader.TryCreatePythonAlgorithm(): Unable to import python module ./cache/algorithm/project/main.pyc. AlgorithmPythonWrapper(): No module named 'data_api'
2025-09-30 13:01:46 : at
2025-09-30 13:01:46 : from data_api import ApiClient
2025-09-30 13:01:46 : in news_module.py: line 9
2025-09-30 13:01:46 : at
2025-09-30 13:01:46 : from news_module import NewsModule
2025-09-30 13:01:46 : in main.py: line 12
2025-09-30 13:01:46 : No module named 'data_api'
2025-09-30 13:12:02 : Launching analysis for L-0eed435fda20bb34a92c0942e7db0813 with LEAN Engine v2.5.0.0.17306
2025-09-30 13:12:16 : Paper Brokerage account base currency: USD
2025-09-30 13:12:16 : Accurate daily end-times now enabled by default. See more at https://qnt.co/3YHaWHL. To disable it and use legacy daily bars set self.settings.daily_precise_end_time = False.
2025-09-30 13:12:16 : Warning: No cash balances or holdings were found in the brokerage account.
2025-09-30 13:12:16 : تم إعداد الخوارزمية بنجاح.
2025-09-30 13:12:16 : Telegram credentials are not set. Please update config.py
2025-09-30 13:12:16 : تغييرات في الكون: SecurityChanges: Added: ABP WUEZ1UW1PZDX,ACP UTMUH2HW4DB9,AEYE WXL6WPBMLI05,AGH YPY1SP1SMQN9,AGMH WTSBRPH5YMP1,AGRI XPZ8XR0U0MLH,AII YS9QSN554VAD,AIQ S6P5SJT0JN8L,AKAN XW2TMLLH2VDX,ALLY VPLW2D47KBXH,AMBQ YUJGWEI5HHLX,AMSF TDRYVSXV1X0L,APDN VVNHV0YIH2ED,APEI TXHW77OK7VQD,APVOV WCD405GN81GL,AQMS W2NKAYLQ27HH,AREB XVTYLRAYE2XX,ARQQ XRNB7GC4ONDX,ASA R735QTJ8XC9X,ASYS R735QTJ8XC9X,AUID XR9IY57RM351,BBV R735QTJ8XC9X,BHB R735QTJ8XC9X,BIAF Y0U5EV8UE5B9,CAZA UQZC400IP6QT,BMRC RQW1EIDGBKH1,BNGO WY1XIAJHWBQD,BQ XIAKBH8EIMHX,BRCB YVQSKILKUOO5,BREA Y5IIUUSPH5R9,BTAI WSNYFVH8TP45,BWFG VQIDTG6S3885,BWMN XO97RUZ773HH,CAC R735QTJ8XC9X,CASS R735QTJ8XC9X,CBNK WY6UQRDCA3J9,CCBG R735QTJ8XC9X,CCSI XSHU2COD21D1,CCTG YF92050SPQW5,CEP YKXUZL3WMO9X,CETX W1O47LFNB1PH,CJET Y8YL6MVZ47Z9,APAT R735QTJ8XC9X,ALVR XGLILOJXRUJP,AMCI XS41T1JZZH45,AQXP VONFF3BAVXB9,AKER VNI2N5Y7O8KL,AGFY XLIR2IEBJNFP,AVRO WVJCDOVYUWYT,CARA VNPY7WVKA9UT
2025-09-30 13:12:16 : Telegram credentials are not set. Please update config.py
2025-09-30 13:12:16 : Telegram credentials are not set. Please update config.py
2025-09-30 13:12:16 : Telegram credentials are not set. Please update config.py
2025-09-30 13:12:16 : Telegram credentials are not set. Please update config.py
2025-09-30 13:12:16 : Telegram credentials are not set. Please update config.py
2025-09-30 13:12:16 : Telegram credentials are not set. Please update config.py
2025-09-30 13:12:16 : Telegram credentials are not set. Please update config.py
2025-09-30 13:12:16 : Telegram credentials are not set. Please update config.py
2025-09-30 13:12:16 : Telegram credentials are not set. Please update config.py
2025-09-30 13:12:16 : Telegram credentials are not set. Please update config.py
2025-09-30 13:12:16 : Telegram credentials are not set. Please update config.py
2025-09-30 13:12:16 : Telegram credentials are not set. Please update config.py
2025-09-30 13:12:16 : Telegram credentials are not set. Please update config.py
2025-09-30 13:12:16 : Telegram credentials are not set. Please update config.py
2025-09-30 13:12:16 : Telegram credentials are not set. Please update config.py
2025-09-30 13:12:16 : Telegram credentials are not set. Please update config.py
2025-09-30 13:12:16 : Telegram credentials are not set. Please update config.py
2025-09-30 13:12:16 : Telegram credentials are not set. Please update config.py
2025-09-30 13:12:16 : Telegram credentials are not set. Please update config.py
2025-09-30 13:12:16 : Telegram credentials are not set. Please update config.py
2025-09-30 13:12:16 : Telegram credentials are not set. Please update config.py
Mia Alissi
Here’s a checklist to help you, 'مطلق', resolve the "No module named data_api" import error on QuantConnect Cloud:
1. Verify file structure
main.py# main algorithm filenews_module.py# file that imports from data_apidata_api.py# (this must contain ApiClient)2. Place/upload data_api.py
data_api.py.3. Confirm presence
data_api.pyin your project’s file tree (besidemain.pyandnews_module.py).4. Import path inside news_module.py
from .data_api import ApiClientunless your files are inside an actual Python package directory with__init__.py.5. Multi-file project structure guideline
__init__.pyinside it and import using a dotted path (e.g.,from mylib.data_api import ApiClient).6. Use QuantConnect’s “Add Library” feature for reusable code
shared_lib).data_api.pyinto the library.7. After any import/file changes
data_api.py,news_module.py,main.py).8. If data_api.py is a third-party (PyPI) package
data_api.py.9. Still got errors?
__pycache__folders (if you see them).data_api.pyitself has no syntax errors.10. Celebrate 🎉
If you follow these steps and keep your import statements and file structure correct, QuantConnect should be able to find and import
data_apiwithout issues.The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
مطلق الشمري
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!