Issues with installing
Python 3.9 and 3.10 gives the following issues
Collecting git+https://gitlab.leibniz-kis.de/sdc/gris/grisinv.git
Cloning https://gitlab.leibniz-kis.de/sdc/gris/grisinv.git to /tmp/pip-req-build-upqq03gq
Running command git clone --filter=blob:none --quiet https://gitlab.leibniz-kis.de/sdc/gris/grisinv.git /tmp/pip-req-build-upqq03gq
Resolved https://gitlab.leibniz-kis.de/sdc/gris/grisinv.git to commit 73dc710cea198d57ac931f38907d75df3fb9ccb9
Preparing metadata (setup.py) ... done
Collecting astropy<5.0,>=4.2 (from grisinv==0.6.1)
Using cached astropy-4.3.1.tar.gz (7.6 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [31 lines of output]
Traceback (most recent call last):
File "/home/vigeesh/conda/envs/gris_inv_test/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
main()
File "/home/vigeesh/conda/envs/gris_inv_test/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/home/vigeesh/conda/envs/gris_inv_test/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
File "/tmp/pip-build-env-p_0cr0eh/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 327, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=[])
File "/tmp/pip-build-env-p_0cr0eh/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 297, in _get_build_requires
self.run_setup()
File "/tmp/pip-build-env-p_0cr0eh/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 313, in run_setup
exec(code, locals())
File "<string>", line 70, in <module>
File "/tmp/pip-build-env-p_0cr0eh/overlay/lib/python3.10/site-packages/extension_helpers/_setup_helpers.py", line 63, in get_extensions
for setuppkg in iter_setup_packages(srcdir, packages):
File "/tmp/pip-build-env-p_0cr0eh/overlay/lib/python3.10/site-packages/extension_helpers/_setup_helpers.py", line 159, in iter_setup_packages
module = import_file(setup_package, name=packagename + ".setup_package")
File "/tmp/pip-build-env-p_0cr0eh/overlay/lib/python3.10/site-packages/extension_helpers/_utils.py", line 136, in import_file
loader.exec_module(mod)
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "./astropy/modeling/setup_package.py", line 11, in <module>
wcs_setup_package = import_file(join('astropy', 'wcs', 'setup_package.py'))
File "/tmp/pip-build-env-p_0cr0eh/overlay/lib/python3.10/site-packages/extension_helpers/_utils.py", line 136, in import_file
loader.exec_module(mod)
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "astropy/wcs/setup_package.py", line 12, in <module>
from setuptools.dep_util import newer_group
ModuleNotFoundError: No module named 'setuptools.dep_util'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
It seems to occur due to the astropy version
Tried installing astropy-4.3.1
, and installation works
Collecting git+https://gitlab.leibniz-kis.de/sdc/gris/grisinv.git
Cloning https://gitlab.leibniz-kis.de/sdc/gris/grisinv.git to /tmp/pip-req-build-wi4tj9g4
Running command git clone --filter=blob:none --quiet https://gitlab.leibniz-kis.de/sdc/gris/grisinv.git /tmp/pip-req-build-wi4tj9g4
Resolved https://gitlab.leibniz-kis.de/sdc/gris/grisinv.git to commit 73dc710cea198d57ac931f38907d75df3fb9ccb9
Preparing metadata (setup.py) ... done
Requirement already satisfied: astropy<5.0,>=4.2 in ./conda/envs/gris_inv_test/lib/python3.10/site-packages (from grisinv==0.6.1) (4.3.1)
Collecting click<8.0.0,>=7.1.2 (from grisinv==0.6.1)
Downloading click-7.1.2-py2.py3-none-any.whl.metadata (2.9 kB)
Collecting mpi4py<4.0.0,>=3.0.3 (from grisinv==0.6.1)
Downloading mpi4py-3.1.6.tar.gz (2.4 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.4/2.4 MB 17.2 MB/s eta 0:00:00
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy<2.0.0,>=1.20.0 in ./conda/envs/gris_inv_test/lib/python3.10/site-packages (from grisinv==0.6.1) (1.26.4)
Collecting tqdm<5.0.0,>=4.56.0 (from grisinv==0.6.1)
Downloading tqdm-4.66.4-py3-none-any.whl.metadata (57 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 57.6/57.6 kB 1.6 MB/s eta 0:00:00
Requirement already satisfied: scipy>=1.6.0 in ./conda/envs/gris_inv_test/lib/python3.10/site-packages (from grisinv==0.6.1) (1.14.0)
Requirement already satisfied: pyerfa>=1.7.3 in ./conda/envs/gris_inv_test/lib/python3.10/site-packages (from astropy<5.0,>=4.2->grisinv==0.6.1) (2.0.1.4)
Downloading click-7.1.2-py2.py3-none-any.whl (82 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 82.8/82.8 kB 3.1 MB/s eta 0:00:00
Downloading tqdm-4.66.4-py3-none-any.whl (78 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 78.3/78.3 kB 2.6 MB/s eta 0:00:00
Building wheels for collected packages: grisinv, mpi4py
Building wheel for grisinv (setup.py) ... done
Created wheel for grisinv: filename=grisinv-0.6.1-py3-none-any.whl size=1191646 sha256=d246bd7c13ab5e72bac07ca369731be740e59b262dcba220e5a0217eb7bff45c
Stored in directory: /tmp/pip-ephem-wheel-cache-9r8st8o6/wheels/d2/8a/7b/b95a54c3008dd7c343a0c0dc2ffbb9b5aeda18fc18488aa9cc
Building wheel for mpi4py (pyproject.toml) ... done
Created wheel for mpi4py: filename=mpi4py-3.1.6-cp310-cp310-linux_x86_64.whl size=649487 sha256=513a81824c5c226235668551d1d213bbb96df2866b030b75da28c4bfa562c054
Stored in directory: /home/vigeesh/.cache/pip/wheels/4c/ca/89/8fc1fb1c620afca13bb41c630b1f948bbf446e0aaa4b762e10
Successfully built grisinv mpi4py
Installing collected packages: tqdm, mpi4py, click, grisinv
Attempting uninstall: mpi4py
Found existing installation: mpi4py 4.0.0
Uninstalling mpi4py-4.0.0:
Successfully uninstalled mpi4py-4.0.0
Successfully installed click-7.1.2 grisinv-0.6.1 mpi4py-3.1.6 tqdm-4.66.4
But, when I try to execute vfisv
, it gives me the following error:
Traceback (most recent call last):
File "/home/vigeesh/conda/envs/gris_inv_test/bin/vfisv", line 5, in <module>
from grisinv import main
File "/home/vigeesh/conda/envs/gris_inv_test/lib/python3.10/site-packages/grisinv/__init__.py", line 1, in <module>
from .invert import *
File "/home/vigeesh/conda/envs/gris_inv_test/lib/python3.10/site-packages/grisinv/invert.py", line 11, in <module>
import astropy.units as Unit
File "/home/vigeesh/conda/envs/gris_inv_test/lib/python3.10/site-packages/astropy/units/__init__.py", line 17, in <module>
from .quantity import *
File "/home/vigeesh/conda/envs/gris_inv_test/lib/python3.10/site-packages/astropy/units/quantity.py", line 28, in <module>
from .quantity_helper import (converters_and_unit, can_have_arbitrary_unit,
File "/home/vigeesh/conda/envs/gris_inv_test/lib/python3.10/site-packages/astropy/units/quantity_helper/__init__.py", line 10, in <module>
from . import helpers, function_helpers
File "/home/vigeesh/conda/envs/gris_inv_test/lib/python3.10/site-packages/astropy/units/quantity_helper/function_helpers.py", line 119, in <module>
np.asscalar,
File "/home/vigeesh/conda/envs/gris_inv_test/lib/python3.10/site-packages/numpy/__init__.py", line 333, in __getattr__
raise AttributeError("module {!r} has no attribute "
AttributeError: module 'numpy' has no attribute 'asscalar'. Did you mean: 'isscalar'?
(gris_inv_test) vigeesh@legs ~ $ vfisv -h
Traceback (most recent call last):
File "/home/vigeesh/conda/envs/gris_inv_test/bin/vfisv", line 5, in <module>
from grisinv import main
File "/home/vigeesh/conda/envs/gris_inv_test/lib/python3.10/site-packages/grisinv/__init__.py", line 1, in <module>
from .invert import *
File "/home/vigeesh/conda/envs/gris_inv_test/lib/python3.10/site-packages/grisinv/invert.py", line 11, in <module>
import astropy.units as Unit
File "/home/vigeesh/conda/envs/gris_inv_test/lib/python3.10/site-packages/astropy/units/__init__.py", line 17, in <module>
from .quantity import *
File "/home/vigeesh/conda/envs/gris_inv_test/lib/python3.10/site-packages/astropy/units/quantity.py", line 28, in <module>
from .quantity_helper import (converters_and_unit, can_have_arbitrary_unit,
File "/home/vigeesh/conda/envs/gris_inv_test/lib/python3.10/site-packages/astropy/units/quantity_helper/__init__.py", line 10, in <module>
from . import helpers, function_helpers
File "/home/vigeesh/conda/envs/gris_inv_test/lib/python3.10/site-packages/astropy/units/quantity_helper/function_helpers.py", line 119, in <module>
np.asscalar,
File "/home/vigeesh/conda/envs/gris_inv_test/lib/python3.10/site-packages/numpy/__init__.py", line 333, in __getattr__
raise AttributeError("module {!r} has no attribute "
AttributeError: module 'numpy' has no attribute 'asscalar'. Did you mean: 'isscalar'?
This is due to the numpy
version removing asscalar
in 1.23
. So, tried downgrading to numpy-1.22.4
. But scipy is not now compatabile
vfisv -h
/home/vigeesh/conda/envs/gris_inv_test/lib/python3.10/site-packages/grisinv/invert.py:21: UserWarning: A NumPy version >=1.23.5 and <2.3.0 is required for this version of SciPy (detected version 1.22.4)
from scipy import interpolate
Usage: vfisv [OPTIONS]
SDC:GRIS Inversion Pipeline code
Options:
-p, --path TEXT Path to the fits files
-d, --id INTEGER Observation ID
-o, --out TEXT Output fits file
-n, --numproc INTEGER Number of processors to run on
-l, --line FLOAT Wavelength of the line Angstrom
-w, --width FLOAT Wavelength range in Angstrom
--weights INTEGER... Weights (e.g --weights 1 2 2 2
--preview TEXT Filename to save the plot
--errors TEXT Filename to save the uncertainties
--diagnose TEXT Filename to write the inversion fits
--log TEXT Filename to write the log file
--version Show the version and exit.
-h, --help Show this message and exit.
It seems this combination works for python=3.10.14
mpi4py=3.1.6
matplotlib=3.9.1
numpy=2.0.1
scipy=1.14.0
astropy=6.1.2
libblas=3.9.0
libgfortran5=14.1.0
liblapack=3.9.0
matplotlib gives me the following error
Traceback (most recent call last):
File "/home/vigeesh/conda/envs/gris_inv_test/bin/vfisv", line 8, in <module>
sys.exit(main())
File "/home/vigeesh/conda/envs/gris_inv_test/lib/python3.10/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/home/vigeesh/conda/envs/gris_inv_test/lib/python3.10/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/home/vigeesh/conda/envs/gris_inv_test/lib/python3.10/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/vigeesh/conda/envs/gris_inv_test/lib/python3.10/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/home/vigeesh/conda/envs/gris_inv_test/lib/python3.10/site-packages/grisinv/invert.py", line 2213, in main
create_preview(data, header, preview)
File "/home/vigeesh/conda/envs/gris_inv_test/lib/python3.10/site-packages/grisinv/invert.py", line 1509, in create_preview
plot_image(
File "/home/vigeesh/conda/envs/gris_inv_test/lib/python3.10/site-packages/grisinv/invert.py", line 1253, in plot_image
bbox = create_map(
File "/home/vigeesh/conda/envs/gris_inv_test/lib/python3.10/site-packages/grisinv/invert.py", line 1174, in create_map
cbar.set_ticks(cticks)
File "/home/vigeesh/conda/envs/gris_inv_test/lib/python3.10/site-packages/matplotlib/colorbar.py", line 879, in set_ticks
self._long_axis().set_major_locator(self._locator)
File "/home/vigeesh/conda/envs/gris_inv_test/lib/python3.10/site-packages/matplotlib/axis.py", line 1936, in set_major_locator
_api.check_isinstance(mticker.Locator, locator=locator)
File "/home/vigeesh/conda/envs/gris_inv_test/lib/python3.10/site-packages/matplotlib/_api/__init__.py", line 91, in check_isinstance
raise TypeError(
TypeError: 'locator' must be an instance of matplotlib.ticker.Locator, not a None
(gris_inv_test) vigeesh@legs test_grisinv $