[SciPy-User] curve_fit missing from scipy.optimize

165 views
Skip to first unread message

Benedikt Riedel

unread,
Jul 16, 2010, 1:08:21 AM7/16/10
to SciPy Users List
Hello all,

I was setting up my new server at the moment and wanted to install scipy on it. I got it all setup thanks to a couple online tutorials. When I tried to run one of my scripts, I got a segmentation fault when it came to importing scipy.optimize. I then used the software manager to install another version of scipy (0.7.0-2 instead of 0.7.2). I then could at least import scipy.optimize, but scipy.optimize.curve_fit could not be found. So I installed 0.7.2 again and now scipy.optimize could be found, but curve_fit was still missing. I looked on google and could only find one solution by replacing the minpack.py file. I tried that and does not seem to work either. Any other ideas or hints?

Thanks a lot in advance.

Cheers,

Ben

Charles R Harris

unread,
Jul 16, 2010, 1:23:32 AM7/16/10
to SciPy Users List
On Thu, Jul 15, 2010 at 11:08 PM, Benedikt Riedel <bri...@wisc.edu> wrote:
Hello all,

I was setting up my new server at the moment and wanted to install scipy on it. I got it all setup thanks to a couple online tutorials. When I tried to run one of my scripts, I got a segmentation fault when it came to importing scipy.optimize. I then used the software manager to install another version of scipy (0.7.0-2 instead of 0.7.2). I then could at least import scipy.optimize, but scipy.optimize.curve_fit could not be found. So I installed 0.7.2 again and now scipy.optimize could be found, but curve_fit was still missing. I looked on google and could only find one solution by replacing the minpack.py file. I tried that and does not seem to work either. Any other ideas or hints?


What operating system/distribution is this on? What software manager? This definitely looks like an installation problem.

Chuck

josef...@gmail.com

unread,
Jul 16, 2010, 1:43:31 AM7/16/10
to SciPy Users List

optimize.curve_fit was added to scipy after 0.7.x (if I remember correctly)

curve_fit is a standalone function (plus two helper functions) and can
be copied anywhere.

Josef

>
> Chuck
>
>
> _______________________________________________
> SciPy-User mailing list
> SciPy...@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>
>
_______________________________________________
SciPy-User mailing list
SciPy...@scipy.org
http://mail.scipy.org/mailman/listinfo/scipy-user

Benedikt Riedel

unread,
Jul 16, 2010, 1:52:03 AM7/16/10
to SciPy Users List
Hey,

It is Ubuntu 10.04 on an AMD-64 from the alternative install CD. I first installed


build-essential gfortran libatlas-sse2-dev 
python-all-dev ipython
subversion
via apt-get. Then I installed nose, numpy and finally scipy using the package from the website

http://python-nose.googlecode.com/files
http://superb-east.dl.sourceforge.net/sourceforge/numpy
http://voxel.dl.sourceforge.net/sourceforge/scipy/
 When I first installed it. Nose and numpy went through fine, but scipy installation had some g++ problems, so I had to install a new g++. I tried it out and optimize was screwed.

When that did not work, I installed 0.7.0 via the Ubuntu software center. After that optimize worked, but curve_fit was gone. So back to 0.7.2 I went to and optimize now worked, but curve_fit still did not.

Cheers,

Ben

_______________________________________________
SciPy-User mailing list
SciPy...@scipy.org
http://mail.scipy.org/mailman/listinfo/scipy-user




--
Benedikt Riedel
Graduate Student University of Wisconsin-Madison
Department of Physics
Office: 2304 Chamberlin Hall
Lab: 6247 Chamberlin Hall
Tel:  (608) 301-5736
Cell: (213) 519-1771
Lab: (608) 262-5916

Charles R Harris

unread,
Jul 16, 2010, 2:10:44 AM7/16/10
to SciPy Users List
On Thu, Jul 15, 2010 at 11:52 PM, Benedikt Riedel <bri...@wisc.edu> wrote:
Hey,

It is Ubuntu 10.04 on an AMD-64 from the alternative install CD. I first installed


Same here except AMD Phenom.
build-essential gfortran libatlas-sse2-dev 

Special SSE2 packages are a 32 bit thing, are you running the 32 bit version of Ubuntu?

python-all-dev ipython
subversion
via apt-get. Then I installed nose, numpy and finally scipy using the package from the website


Usually I apt-get numpy and scipy for the dependencies, then install from svn. If you do install from source in addition to the ubuntu packages you might want to modify the path so the proper package is used. I use

$charris@ubuntu ~$ cat ~/.local/lib/python2.6/site-packages/install.pth
/usr/local/lib/python2.6/dist-packages

Although I suspect /usr/local/lib/python2.6/site-packages would work as well.
http://python-nose.googlecode.com/files
http://superb-east.dl.sourceforge.net/sourceforge/numpy
http://voxel.dl.sourceforge.net/sourceforge/scipy/
 When I first installed it. Nose and numpy went through fine, but scipy installation had some g++ problems, so I had to install a new g++. I tried it out and optimize was screwed.

When that did not work, I installed 0.7.0 via the Ubuntu software center. After that optimize worked, but curve_fit was gone. So back to 0.7.2 I went to and optimize now worked, but curve_fit still did not.


Chuck

Benedikt Riedel

unread,
Jul 16, 2010, 9:22:51 AM7/16/10
to SciPy Users List
On Fri, Jul 16, 2010 at 01:10, Charles R Harris <charles...@gmail.com> wrote:


On Thu, Jul 15, 2010 at 11:52 PM, Benedikt Riedel <bri...@wisc.edu> wrote:
Hey,

It is Ubuntu 10.04 on an AMD-64 from the alternative install CD. I first installed


Same here except AMD Phenom.
build-essential gfortran libatlas-sse2-dev 

Special SSE2 packages are a 32 bit thing, are you running the 32 bit version of Ubuntu?


Running a 64-bit version

python-all-dev ipython
subversion
via apt-get. Then I installed nose, numpy and finally scipy using the package from the website


Usually I apt-get numpy and scipy for the dependencies, then install from svn. If you do install from source in addition to the ubuntu packages you might want to modify the path so the proper package is used. I use

$charris@ubuntu ~$ cat ~/.local/lib/python2.6/site-packages/install.pth
/usr/local/lib/python2.6/dist-packages

Although I suspect /usr/local/lib/python2.6/site-packages would work as well.


I tried the apt-get path but it tells me that numpy and scipy is installed therefore I cant reinstall it.

I dont seem to have /usr/local/lib/python2.6/site-packages but instead only have a /usr/local/lib/python2.6/dist-packages.

I checked out the minpack.py in the dist-packages folder (/usr/local/lib/python2.6/dist-packages) and found that it did have a reference to curve_fit, but when I checked /usr/lib/python2.6/dist-packages and the minpack.py did not have a reference to curve_fit.

http://python-nose.googlecode.com/files
http://superb-east.dl.sourceforge.net/sourceforge/numpy
http://voxel.dl.sourceforge.net/sourceforge/scipy/
 When I first installed it. Nose and numpy went through fine, but scipy installation had some g++ problems, so I had to install a new g++. I tried it out and optimize was screwed.

When that did not work, I installed 0.7.0 via the Ubuntu software center. After that optimize worked, but curve_fit was gone. So back to 0.7.2 I went to and optimize now worked, but curve_fit still did not.


Chuck


_______________________________________________
SciPy-User mailing list
SciPy...@scipy.org
http://mail.scipy.org/mailman/listinfo/scipy-user



Cheers,

Ben

Charles R Harris

unread,
Jul 16, 2010, 10:02:34 AM7/16/10
to SciPy Users List
On Fri, Jul 16, 2010 at 7:22 AM, Benedikt Riedel <bri...@wisc.edu> wrote:


On Fri, Jul 16, 2010 at 01:10, Charles R Harris <charles...@gmail.com> wrote:


On Thu, Jul 15, 2010 at 11:52 PM, Benedikt Riedel <bri...@wisc.edu> wrote:
Hey,

It is Ubuntu 10.04 on an AMD-64 from the alternative install CD. I first installed


Same here except AMD Phenom.
build-essential gfortran libatlas-sse2-dev 

Special SSE2 packages are a 32 bit thing, are you running the 32 bit version of Ubuntu?


Running a 64-bit version

python-all-dev ipython
subversion
via apt-get. Then I installed nose, numpy and finally scipy using the package from the website


Usually I apt-get numpy and scipy for the dependencies, then install from svn. If you do install from source in addition to the ubuntu packages you might want to modify the path so the proper package is used. I use

$charris@ubuntu ~$ cat ~/.local/lib/python2.6/site-packages/install.pth
/usr/local/lib/python2.6/dist-packages

Although I suspect /usr/local/lib/python2.6/site-packages would work as well.


I tried the apt-get path but it tells me that numpy and scipy is installed therefore I cant reinstall it.

I dont seem to have /usr/local/lib/python2.6/site-packages but instead only have a /usr/local/lib/python2.6/dist-packages.

I checked out the minpack.py in the dist-packages folder (/usr/local/lib/python2.6/dist-packages) and found that it did have a reference to curve_fit, but when I checked /usr/lib/python2.6/dist-packages and the minpack.py did not have a reference to curve_fit.


So are things working for you now? You need to make
~/.local/lib/python2.6/site-packages/install.pth yourself as it isn't there out of the box.

<snip>

Chuck

Benedikt Riedel

unread,
Jul 19, 2010, 12:30:53 AM7/19/10
to SciPy Users List
Hi

Sorry for the late reply. I was out for a couple days.

I was trying to create the install.pth file and noticed that there is no ~/.local/lib/ directory. This might the problem here, but i am not sure.

Cheers,

Ben

_______________________________________________
SciPy-User mailing list
SciPy...@scipy.org
http://mail.scipy.org/mailman/listinfo/scipy-user

Benedikt Riedel

unread,
Jul 16, 2010, 12:53:19 AM7/16/10
to SciPy Users List
Hello all,

I was setting up my new server at the moment and wanted to install scipy on it. I got it all setup thanks to a couple online tutorials. When I tried to run one of my scripts, I got a segmentation fault when it came to importing scipy.optimize. I then used the software manager to install another version of scipy (0.7.0-2 instead of 0.7.2). I then could at least import scipy.optimize, but scipy.optimize.curve_fit could not be found. So I installed 0.7.2 again and now scipy.optimize could be found, but curve_fit was still missing. I looked on google and could only find one solution by replacing the minpack.py file. I tried that and does not seem to work either. Any other ideas or hints?

Reply all
Reply to author
Forward
0 new messages