installing lmfit after having installed python 2.7 and pip 7.1.2

320 views
Skip to first unread message

PeterD

unread,
May 29, 2016, 11:41:57 AM5/29/16
to lmfit-py
New to Python yesterday and today set out to transition  decades of exponential curve fitting from Wavemetrics IgorPro to Python lmfit. Just installed on Mac python 2.7 and pip 7.1.2. How do I best install lmfit?
Thank you in advance, PeterD

Matt Newville

unread,
May 29, 2016, 3:26:22 PM5/29/16
to lmfit-py
Hi PeterD,

On Sun, May 29, 2016 at 10:41 AM, PeterD <peter...@gmail.com> wrote:
New to Python yesterday and today set out to transition  decades of exponential curve fitting from Wavemetrics IgorPro to Python lmfit. Just installed on Mac python 2.7 and pip 7.1.2. How do I best install lmfit?

Using
   sudo pip install lmfit
from a Terminal Window ought to work.

If you're new to Python and are doing numerical work, I think the general consensus is to recommend Anaconda Python from ContinuumIO. This comes with a pretty complete set of numerical python tools, including Jupyter and an IDE called Spyder.   It also installs into a user-owned folder, so that you don't need to interfere with the system Python. 

But to install lmfit, using 'pip install lmfit' is still needed.  Well, Anaconda also has its own packaging system too, but pip works fine.

Hope that helps!

--Matt

Andrew Nelson

unread,
May 29, 2016, 7:41:21 PM5/29/16
to lmfit-py
It's not generally a good idea to install anything using "sudo pip" see: http://stackoverflow.com/questions/21055859/what-are-the-risks-of-running-sudo-pip
If you use that command before installing your own Python you run the risk of installing packages into the system Python that OS X uses, and you definitely don't want to mess with that.

I'm on OS X and I can highly recommend using miniconda (http://conda.pydata.org/miniconda.html) which enables you to create Python environments quickly and cheaply. You can use pip to install lmfit into one of those environments.

If you don't want to use miniconda then the alternative is to either install a pre-built Python for OS X (https://www.python.org/downloads/mac-osx/), or to compile Python yourself.

Let me know if you have more questions.

A.



--
You received this message because you are subscribed to the Google Groups "lmfit-py" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lmfit-py+u...@googlegroups.com.
To post to this group, send email to lmfi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lmfit-py/CA%2B7ESbpLZ%2BpsL_5BU-skQi59GVN%3DB%3DFw1ijKEGT_0JEq%3DpSTPw%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.



--
_____________________________________
Dr. Andrew Nelson


_____________________________________

PeterD

unread,
May 29, 2016, 11:22:37 PM5/29/16
to lmfit-py, newv...@cars.uchicago.edu
Hi Matt,

Thank you for the heads-up on Anaconda Python from ContinuumIO, which I will look into. I also have received similar guidance and have decided to trash what I have installed although the initial simple programming went well, in favor of what you suggest or the equivalent. Not that familiar and liking the idea of a separate user folder from Python for me in particular is a good way to go. 

Any thoughts on Canopy, or any other alternatives to Anaconda, before I make the initial plunge?

Thanks again for the guidance - it will save me tens if not hundreds of hours over the next year or two.

Regards,

Peter

Andrew Nelson

unread,
May 29, 2016, 11:27:28 PM5/29/16
to lmfit-py
*miniconda*

--
You received this message because you are subscribed to the Google Groups "lmfit-py" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lmfit-py+u...@googlegroups.com.
To post to this group, send email to lmfi...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

PeterD

unread,
May 29, 2016, 11:54:25 PM5/29/16
to lmfit-py
Hi Andrew,

Thank you - after reading your post I trashed what I have done the last day with Python 2.7 and pip 7.1.2 and began this evening looking into miniconda, Anaconda, Canopy, etc.

I am looking at a May 2016 updated Python wiki on IDEs and "too many choices" given my naivety of Python. 

My goal is focused on programs taking times series data and fitting with < 3 exponential components (compound growth and decay) with some exploratory and statical analysis (confidence limit analysis) would be good to be able to easily logarithmically transform the histograms, to peak the time constants in visual displays, etc., both the y-axis event counts, and the x-axis dwell time bins. It would be huge to be able to easily do this withSo, now re-directed from this user group to IDEs that install most if not all of the packages/modules for Scientific Python programming, that err on the side of easy to use rather than sophisticated analysis. The above is really it for now.

As I asked Matt, I will ask you or anyone else in the user group to suggest what they have used with good experience and some rationale why one IDE might be better than another.

Finally, since we are at it, for the simple programming I have in mind what would be better Python 2.x or 3.x, or does it matter, or do I have a choice or is it highly dependent on the IDE I choose. It appears that it is getting more and more reasonable to go with 3.x, or is it?

Okay. I will think through the posts in reply to my three posts, including the two good ones I have already received, and look into the suggestions an try out one or two or three IDEs this week and then be on with the science with Python.

Thank you all, much appreciated,

Peter 

Andrew Nelson

unread,
May 30, 2016, 12:09:33 AM5/30/16
to lmfit-py

I really like pycharm for an ide.

Jupyter notebooks are excellent, analogous to a packed experiment file.

I recommend python 3 for all new work.

Matt Newville

unread,
May 30, 2016, 8:17:49 AM5/30/16
to lmfit-py
Hi PeterD,

On Sun, May 29, 2016 at 10:22 PM, PeterD <peter...@gmail.com> wrote:

Hi Matt,

Thank you for the heads-up on Anaconda Python from ContinuumIO, which I will look into. I also have received similar guidance and have decided to trash what I have installed although the initial simple programming went well, in favor of what you suggest or the equivalent. Not that familiar and liking the idea of a separate user folder from Python for me in particular is a good way to go. 

Any thoughts on Canopy, or any other alternatives to Anaconda, before I make the initial plunge?
 
My first advice would be that if you have someone local-ish who can guide you through the transition to Python, start with what they recommend  / use.   At the user-interface level, Anaconda and Canopy are pretty similar.  I think miniconda may be a little to "bare-metal" to get started with, though virtual environments are very powerful for developers.

And there are many -- too many -- IDEs and environments for Python. I would not try to defend any one of them as "best".  

But: I've had very good luck getting scientists at many levels who are new to python (including transitioning from IgorPro, Matlab, or IDL) going with Anaconda.  It comes with all the packages needed to get started, and it's easy to add more packages.  The Spyder IDE that comes with Anaconda is pretty complete, and includes an IPython shell and object/doc viewer, which is very helpful for playing with the language.

--Matt

Reply all
Reply to author
Forward
0 new messages