FCS-analysis / PyCorrFit

data analysis and fitting software for fluorescence correlation spectroscopy (FCS)
pycorrfit.craban.de
Other
45 stars 13 forks source link

ImportError: cannot import name 'MutableSet' from 'collections' #206

Closed GrantFoley closed 1 year ago

GrantFoley commented 1 year ago

I am attempting to install from PyCorrFit from source, but this error message keeps popping up. How should I got about fixing this issue?

paulmueller commented 1 year ago

Do you have the full traceback? Looks like some third-party module does not support the latest Python version. MutableSet is in collections.abc.

GrantFoley commented 1 year ago

Traceback (most recent call last): File "C:\Users\Baker Lab 432-A.conda\envs\PyCorrFit\lib\runpy.py", line 187, in _run_module_as_main mod_name, mod_spec, code = _get_module_details(mod_name, _Error) File "C:\Users\Baker Lab 432-A.conda\envs\PyCorrFit\lib\runpy.py", line 146, in _get_module_details return _get_module_details(pkg_main_name, error) File "C:\Users\Baker Lab 432-A.conda\envs\PyCorrFit\lib\runpy.py", line 110, in _get_module_details import(pkg_name) File "C:\Users\Baker Lab 432-A\PyCorrFit\pycorrfit__init.py", line 10, in from .correlation import Correlation File "C:\Users\Baker Lab 432-A\PyCorrFit\pycorrfit\correlation.py", line 8, in from . import fit File "C:\Users\Baker Lab 432-A\PyCorrFit\pycorrfit\fit.py", line 5, in import lmfit File "C:\Users\Baker Lab 432-A.conda\envs\PyCorrFit\lib\site-packages\lmfit\init.py", line 43, in from .model import Model, CompositeModel File "C:\Users\Baker Lab 432-A.conda\envs\PyCorrFit\lib\site-packages\lmfit\model.py", line 14, in from collections import MutableSet ImportError: cannot import name 'MutableSet' from 'collections' (C:\Users\Baker Lab 432-A.conda\envs\PyCorrFit\lib\collections\init__.py)

GrantFoley commented 1 year ago

Here is the most recent traceback when I try to run PyCorrFit using the python -m pycorrfit command

tsbischof commented 1 year ago

Right, I get the same error fresh in pip. As a short-term fix, change the import statements in those files to collections.abc.

paulmueller commented 1 year ago

Which version of lmfit do you have? In version 1.1.0, this import is not there anymore: https://github.com/lmfit/lmfit-py/blob/1.1.0/lmfit/model.py

GrantFoley commented 1 year ago

I currently have lmfit 0.9.2 installed.

paulmueller commented 1 year ago

OK, it's probably that. You have to upgrade lmfit.

GrantFoley commented 1 year ago

Ok I think that did it. PyCorrFit was able to open, and I was able to load my .cor file into it. Thanks to both of you for all of your help. I will let you know if any more issues arise.