Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: cannot import name 'Mapping' from 'collections' #2

Open
orlandogr15 opened this issue Oct 27, 2022 · 1 comment
Open

Comments

@orlandogr15
Copy link

I get the following error when trying to run fastrometry from the terminal. I'm on Ubuntu 18 and installed Python 3.10 to run this, so I'm not sure if the problem is on my end. I also tried to run it inside a conda environment but get the same result.

Traceback (most recent call last): File "/home/orlando/.local/bin/fastrometry", line 5, in <module> from fastrometry.fastrometry import callFromCommandLine File "/home/orlando/.local/lib/python3.10/site-packages/fastrometry/__init__.py", line 1, in <module> from fastrometry.fastrometry import findWCS File "/home/orlando/.local/lib/python3.10/site-packages/fastrometry/fastrometry.py", line 7, in <module> from .catalogue import getIntermediateCoords File "/home/orlando/.local/lib/python3.10/site-packages/fastrometry/catalogue.py", line 4, in <module> from AstraCarta import astracarta File "/home/orlando/.local/lib/python3.10/site-packages/AstraCarta/__init__.py", line 1, in <module> from AstraCarta.AstraCarta import astracarta File "/home/orlando/.local/lib/python3.10/site-packages/AstraCarta/AstraCarta.py", line 1, in <module> from astroquery.simbad import Simbad File "/home/orlando/.local/lib/python3.10/site-packages/astroquery/simbad/__init__.py", line 34, in <module> from .core import Simbad, SimbadClass, SimbadBaseQuery File "/home/orlando/.local/lib/python3.10/site-packages/astroquery/simbad/core.py", line 8, in <module> import requests File "/usr/lib/python3/dist-packages/requests/__init__.py", line 43, in <module> import urllib3 File "/usr/lib/python3/dist-packages/urllib3/__init__.py", line 8, in <module> from .connectionpool import ( File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 29, in <module> from .connection import ( File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 40, in <module> from .util.ssl_ import ( File "/usr/lib/python3/dist-packages/urllib3/util/__init__.py", line 3, in <module> from .connection import is_connection_dropped File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 3, in <module> from .wait import wait_for_read File "/usr/lib/python3/dist-packages/urllib3/util/wait.py", line 1, in <module> from .selectors import ( File "/usr/lib/python3/dist-packages/urllib3/util/selectors.py", line 14, in <module> from collections import namedtuple, Mapping ImportError: cannot import name 'Mapping' from 'collections' (/usr/lib/python3.10/collections/__init__.py)

@user29A
Copy link
Owner

user29A commented Oct 27, 2022

Hello. I talked to the main developer, Cameron Leahy, and this was his response:

It looks like this is a common problem caused by python's default library "collections" changing the names of its packages in Python 3.10. We don't use collections in fastrometry, from the message output it looks like it's being called as part of astroquery's routine. I haven't tried running fastrometry on my linux yet (but I will do so when I have a little more time) but there are some suggestions on the stackexchange page that might help.

Cameron

https://stackoverflow.com/questions/69381312/in-vs-code-importerror-cannot-import-name-mapping-from-collections

Hope that helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants