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

Cannot import name Mapping from collections #16

Open
hellorp1990 opened this issue Jul 26, 2022 · 4 comments
Open

Cannot import name Mapping from collections #16

hellorp1990 opened this issue Jul 26, 2022 · 4 comments

Comments

@hellorp1990
Copy link

Hi,

I am having little difficulty in running "from tmap.tda import mapper, Filter" on python 3.10.

In Python 3.6 the code works perfectly fine.

I believe the problem is happening due to collections package as the Mapping is moved to collections.abc from collections. I changed that in my code.

Still the error is happening:

Importerror: cannot import name Mapping from collections (...../lib/python3.10/collections/init.py

Any idea how to fix it? Does Tmap run on python 3.10?

@444thLiao
Copy link
Collaborator

I apologise for the stalled tmap version. This problem is similar to issue #15

You can see that this error was generated by the "networkx" rather than the "tmap" if you read the traceback. Because the requirement file has fixed the version of networkx ==2.2 that would generate this error when you use other versions of Python.

The file $PYTHON/lib/python3.10/site-packages/networkx/classes/graph.py is where this problem originated. I would not change the requirement file at this time because different versions of networkx may produce different issues.

I will advise you to create a virtual environment using conda and install the python==3.8 instead of python==3.10.

If you encounter other issues, please let me know.

@meddwl
Copy link

meddwl commented Jul 30, 2022

Hi,

I have problem with using tmap. I installed tmap in a CentOS cluster. I used conda to install in a conda environment, where there are python==3.8 and networkx ==2.2. And I tried to install by pip in the same conditions. In both cases, tmap has no modules except 'name'.

For example, when I import fearun==0.4.1, I get this error

ModuleNotFoundError: No module named 'tmap.core'
How can I solve this issue?

@444thLiao
Copy link
Collaborator

@meddwl It sounds like it is a different issue and I believe it would be useful if you could give a screenshot or outputs from the installation.
And I am not sure why you import fearun? Maybe you should check again what you have typed in.

I don't think we have core under the tmap library. Maybe you are talking about the other package also named tmap?

@meddwl
Copy link

meddwl commented Jul 31, 2022

Sorry, my mistake. I mixed up the packages because they have the same name. I apologize for the distraction. And thank you for the answer.

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

3 participants