Grasshopper

algorithmic modeling for Rhino

Hi everyone,

I could use some help here.

No problem with that :

###############
import clr
clr.AddReference("mtrand")

###############

import numpy as np
import scipy

print(scipy.__version__)

But with that :

###############
import clr
clr.AddReference("mtrand")

###############


import numpy as np
import scipy

print(scipy.__version__)

from scipy.optimize import minimize
import pylab as py

I have a problem of importation. I get this message :

Message: cannot import optimize from scipy

I saw on several forum that it could be a problem of version but when I get the scipy version I have the 1.0.0. 

I saw this old answer (2012) so I guess it is not a question of version anymore. 

http://stackoverflow.com/questions/11128070/cannot-import-minimize-...

I also did that to avoid an other problem (loading modules and so) explained here. 

http://www.researchgate.net/post/Why_am_I_getting_an_error_message_...

So if you have any idea, tell me please

Have a nice day,

Tristan

Views: 824

Replies to This Discussion

UPDATE  ------

I found that maybe optimize is not implemented totally. I can do this for instance :

from scipy.optimize import fmin

def rosen(x):
return sum(100.0*(x[1:]-x[:-1]**2.0)**2.0 + (1-x[:-1])**2.0)

x0 = [1.3, 0.7, 0.8, 1.9, 1.2]
xopt = fmin(rosen, x0, xtol=1e-8)

print xopt

no problem but when in try the minimize function, i get the error message :

from scipy.optimize import optimize

Message: cannot import minimize from scipy.optimize

To make it work in the first step (describe in an other post) 

>>> http://www.grasshopper3d.com/forum/topics/scipy-and-numpy

I edit the script in order to install all the eggs. they don't have all the package and you have to install the scipy-1.0.0-2.egg instead of scipy-1.0.0-1.egg. Optimize is missing in the first version.

>>> The script

         https://gist.github.com/blondegeek/2dbc22360422d0c4b637

So is it possible that in scipy.optimise minimize is not operational?

 

Hi Tristan

>>So is it possible that in scipy.optimise minimize is not operational?

This is possible; but I would really just ask Enthought to make sure. They are the developers of that library.
Thanks!

Giulio
--
Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com

Hi, 

I got exactly the same problem.

from scipy.optimize import optimize

Message: cannot import minimize from scipy.optimize

If you have any update on this, please let us know.

Thanks, 

Florian


I import fmin simply with:

from scipy import fmin

However, if I try:

from scipy.optimize import fmin

I get "cannot import optimize from scipy"

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service