alnurali / cvxstoc

Disciplined convex stochastic programming. For the cvxstoc home page, please see:
http://alnurali.github.io/cvxstoc/
31 stars 11 forks source link

ModuleNotFoundError: No module named 'pymc.Model' #12

Open Sanchitamallickroy opened 2 years ago

Sanchitamallickroy commented 2 years ago

Hello,

I am trying to run portfolio optimization example.
from cvxstoc import NormalRandomVariable, expectation, prob
from cvxpy import Maximize, Problem
from cvxpy.expressions.variable import Variable
import numpy

###### Create problem data.
n = 10
mu = numpy.zeros(n)
Sigma = 0.1*numpy.eye(n)
p = NormalRandomVariable(mu, Sigma)
alpha = -1
beta = 0.05

x = Variable(n)
p = Problem(Maximize(expectation(x.T*p, num_samples=100)),
            [x >= 0, x.T*numpy.ones(n) == 1,
             prob(x.T*p <= alpha, num_samples=100) <= beta])
p.solve(verbose=True)
but following error is coming
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_17832\4082492399.py in <cell line: 1>()
----> 1 from cvxstoc import NormalRandomVariable, expectation, prob
      2 from cvxpy import Maximize, Problem
      3 from cvxpy.expressions.variable import Variable
      4 import numpy
      5 

~\anaconda3\lib\site-packages\cvxstoc\__init__.py in <module>
----> 1 from cvxstoc.expectation import expectation
      2 from cvxstoc.random_variable import (
      3     RandomVariable,
      4     RandomVariableFactory,
      5     NormalRandomVariable,

~\anaconda3\lib\site-packages\cvxstoc\expectation.py in <module>
      4 from cvxpy.transforms.partial_optimize import PartialProblem
      5 
----> 6 from cvxstoc.random_variable import RandomVariable
      7 from cvxstoc.utils import replace_rand_vars
      8 

~\anaconda3\lib\site-packages\cvxstoc\random_variable.py in <module>
      1 import copy
      2 
----> 3 import pymc.Model, pymc.MCMC
      4 
      5 import numpy

ModuleNotFoundError: No module named 'pymc.Model'

How to solve this issue? I have installed pymc separately. Still the problem is coming. My OS is windows 10.

adityask1992 commented 1 year ago

Is there any available solution yet?

adam-bauer-34 commented 11 months ago

I am having the same issue... any updates?

adityask1992 commented 11 months ago

I am having the same issue... any updates?

Not yet,