[AstroPy] Moment maps, error

Rugved Pund rugved.pund at stonybrook.edu
Thu Mar 14 13:44:01 EDT 2024


Hi Giulia,

Chiming in to recommend the python debugger pdb [official docs
<https://docs.python.org/3/library/pdb.html>, neat tutorial
<https://realpython.com/python-debugging-pdb/>] if you have access to the
shell when you run the code. You can either add a line "breakpoint()" above
the function call, or simply run the code with an additional "python -m pdb
code.py" you should have access to post-mortem debugging when the code
fails.

Pdb would allow you to check the sys paths being searched for the module,
module versions and environments, step into and out of function calls, run
code line by line from breakpoint, etc. Happy to assist further if needed.

Rugved


On Thu, Mar 14, 2024 at 10:37 AM Giulia Majerczyk <giuliamajerczyk at gmail.com>
wrote:

> Yes, it fails as well.
> I, too, installed python via anaconda 3.
> I think it depends on the astropy version but I don't know how to find a
> solution.
>
> Giulia
>
> Il Gio 14 Mar 2024, 15:16 peter teuben <teuben at umd.edu> ha scritto:
>
>>
>> Giulia : you could try  "import astropy" and see if that fails as well.
>>
>> I am teaching a python class, with a mix of Mac and Win (and one Linux)
>> laptops, and they all installed python via anaconda3.   When I let them use
>> astropy, more than half had this problem. I was baffled as I was under the
>> impression that anaconda3 would always come with astropy, independent of
>> the architecture.
>>
>> I'll cherry pick a few cases to see why it's not there, it's quite
>> possible that they accidentally had another python version on their laptop
>> and executing that version. I must say this is one of those cases where a
>> full GUI environment still drives me nuts.
>>
>>  - peter
>> On 3/14/24 10:07, Eric LN Jensen wrote:
>>
>> Hi Giulia,
>>
>> Can you post some code that shows what you are trying to do when you get
>> that error?  We need more context here to see what you’re importing and
>> what function(s) you’re trying to call.
>>
>> Eric
>>
>> On Mar 14, 2024, at 10:00 AM, Giulia <giuliamajerczyk at gmail.com>
>> <giuliamajerczyk at gmail.com> wrote:
>>
>> I have difficulty with moment maps because the code gives me the
>> following error:
>> " ModuleNotFoundError: No module named
>> 'astropy.coordinates.angle_utilities' ".
>> How can I solve it?
>>
>> Cheers,
>> Giulia
>>
>>
>>
>> _______________________________________________
>> AstroPy mailing listAstroPy at python.orghttps://mail.python.org/mailman/listinfo/astropy
>>
>> _______________________________________________
>> AstroPy mailing list
>> AstroPy at python.org
>> https://mail.python.org/mailman/listinfo/astropy
>>
> _______________________________________________
> AstroPy mailing list
> AstroPy at python.org
> https://mail.python.org/mailman/listinfo/astropy
>


-- 
Rugved Pund
PhD Candidate
Cosmology Group | Brookhaven National Lab
Physics Department | Stony Brook University
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/astropy/attachments/20240314/7c40c3ac/attachment.html>


More information about the AstroPy mailing list