Sofware dependencies version broken
robin-cls opened this issue · 0 comments
When launching the latest version of swot_simulator (1.2.4), I have the following error message :
AssertionError: /data/usrcto/ctoh/restricted/modules/anaconda3_robin/envs/swotsim_20220411/lib/python3.10/distutils/core.py
It seems that the error comes from launcher.py, where the software dependencies version are extracted (they are added to the parameters file to remember the config used for simulation). In the software_dependencies() method, setuptools is imported after pip and it seems that it is the source of the error. In my environment (python 3.10, pip 22.0.4, setuptool 62.1.0) :
>>> import pip
>>> import setuptools
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/data/usrcto/ctoh/restricted/modules/anaconda3_robin/envs/swotsim_20220411/lib/python3.10/site-packages/setuptools/__init__.py", line 8, in <module>
import _distutils_hack.override # noqa: F401
File "/data/usrcto/ctoh/restricted/modules/anaconda3_robin/envs/swotsim_20220411/lib/python3.10/site-packages/_distutils_hack/override.py", line 1, in <module>
__import__('_distutils_hack').do_override()
File "/data/usrcto/ctoh/restricted/modules/anaconda3_robin/envs/swotsim_20220411/lib/python3.10/site-packages/_distutils_hack/__init__.py", line 72, in do_override
ensure_local_distutils()
File "/data/usrcto/ctoh/restricted/modules/anaconda3_robin/envs/swotsim_20220411/lib/python3.10/site-packages/_distutils_hack/__init__.py", line 59, in ensure_local_distutils
assert '_distutils' in core.__file__, core.__file__
AssertionError: /data/usrcto/ctoh/restricted/modules/anaconda3_robin/envs/swotsim_20220411/lib/python3.10/distutils/core.py
setuptools seems to override the distutils library, which pip is using, so pip should be imported after setuptools. I haven't looked further into this but it seems simply changing the order of the dependencies fixes the issue.