Back to Community
ImportError: No module named quantopian.optimize.experimental

I was trying to setup constraint for the RiskModelExposure and got this error. Has anything changed recently moving away from experimental?

4 responses

This happens when I run debuger into this block:

import quantopian.optimize as opt  
........
    constrain_sector_style_risk = opt.experimental.RiskModelExposure(  
        context.risk_loading_pipeline,  
        min_momentum=-0.1, max_momentum=0.1,  
        min_size=-0.1,max_size=0.1,  
        min_value=-0.1, max_value=0.1,  
        #min_short_term_reversal=None,  
        #max_short_term_reversal=None,  
        min_volatility=-0.1, max_volatility=0.1,  
        version=opt.Newest,  
    )  

Aged bug in the debugger, like fine wine.

Really? No fix for so long?

Since at least Feb 2018. Graciously I was thanked for the report back then, saying it will be filed. I gathered that people are not using the debugger very much, sad because it is so useful.

If they might be inclined to fix it at some point:

Steps:
1. Clone the first algo at https://www.quantopian.com/posts/quantopian-risk-model-in-algorithms
2. No changes
3. Set a breakpoint on line 101
4. 'Build Algorithm'
5. When the debugger breaks in, press the triangle icon to resume, 5 times

Result:
ImportError: No module named quantopian.optimize.experimental

Ignore the warning about QTradableStocksUS which was not occurring at that time.