0 votes
33 views
Hello,

Trying to install lmfit, because I didn't find the pip install in the shell, I wrote in the notebook:

!pip install lmfit

But pip failed because the lmfit package already exists. (But when I tried to import lmfit I had an error due to absence of the lmfit package).

So I forced with:

!pip install --ignore-installed --no-cache-dir lmfit

But during installation, were installed also dependencies (numpy), and these changes broke the Rubin_sim.maf.

So now in the notebook I have the lmfit working but not the Rubin_sim.maf.

It is possible to clean this error and can you explain me how to safely import lmfit in my notebook?

Sorry for the inconvenience.

Best reegards,

Silvio Leccia
by montag (130 points) | 33 views

1 Answer

0 votes

Hi Silvio, 

As you said the lmfit packaged is already installed in the python3 kernel. Make sure your notebook is using that kernel.

to verify you are using the correct kernel, in a cell in your notebook do:

!which python

which should return

/data0/sw/anaconda3/bin/python

if that's not what you get go the the top right of your notebook and select the "python 3" kernel. 

an 

import lmfit

should work under that kernel

and if you do:

print(lmfit.__file__)

it should point to:

/data0/sw/anaconda3/lib/python3.8/site-packages/lmfit/__init__.py

Let me know if any of that helps or if you still encounter any issues.

Thanks,

Igor

by isuarezsola (690 points)
Dear Igor, thank you for your answer.
I'm using LSST-2001.10.13.py3 kernel, and I have as answer
to !which python
/data0/sw/anaconda3/bin/python
So seems its everything ok, but now when I try to import rubin_sim.maf I have an error due to my forced installation because I have:
AttributeError: module 'numpy' has no attribute 'asscalar'
This because numpy was reinstalled during my !pip install --ignore-installed --no-cache-dir lmfit.
Now I don't know how to solve the problem...
Thanks for your help!
Best regards,
Silvio

409 questions

426 answers

434 comments

630 users

Welcome to Data Lab Help Desk, where you can ask questions and receive answers from other members of the community.

Categories