gempy-project / gempy

GemPy is an open-source, Python-based 3-D structural geological modeling software, which allows the implicit (i.e. automatic) creation of complex geological models from interface and orientation data. It also offers support for stochastic modeling to address parameter and model uncertainties.
https://gempy.org
European Union Public License 1.2
941 stars 232 forks source link

Not able to import gempy #881

Closed Varun019140 closed 2 months ago

Varun019140 commented 2 months ago

AFTER RUNNING THE CODE IMPORT GEMPY AS GP ITS SHOWIG ME THIS ERROR >> PLEASE HELP ME OUT ASAP ....THIS IS SO IMORTANT FOR ME

Setting Backend To: AvailableBackends.numpy

ValueError Traceback (most recent call last) Cell In[1], line 1 ----> 1 import gempy as gp

File ~\AppData\Roaming\Python\Python311\site-packages\gempy__init__.py:10 7 import sys 9 # =================== CORE =================== ---> 10 from .core import data 11 from .core.color_generator import ColorsGenerator 13 # =================== API ===================

File ~\AppData\Roaming\Python\Python311\site-packages\gempy\core\data__init__.py:1 ----> 1 from .geo_model import GeoModel 2 from .structural_frame import StructuralFrame 3 from .structural_group import StructuralGroup

File ~\AppData\Roaming\Python\Python311\site-packages\gempy\core\data\geo_model.py:8 4 from typing import Sequence, Optional 6 import numpy as np ----> 8 import gempy_engine.core.data.engine_grid 9 from gempy_engine.core.data import Solutions 10 from gempy_engine.core.data.geophysics_input import GeophysicsInput

File ~\AppData\Roaming\Python\Python311\site-packages\gempy_engine__init__.py:1 ----> 1 from gempy_engine.API.model.model_api import compute_model

File ~\AppData\Roaming\Python\Python311\site-packages\gempy_engine\API\model\model_api.py:6 4 from ...core.backend_tensor import BackendTensor 5 from ...config import NOT_MAKE_INPUT_DEEP_COPY, AvailableBackends ----> 6 from ...core.data.interp_output import InterpOutput 7 from ...core.data.geophysics_input import GeophysicsInput 8 from ...modules.geophysics.fw_gravity import compute_gravity

File ~\AppData\Roaming\Python\Python311\site-packages\gempy_engine\core\data__init__.py:3 1 from .tensors_structure import TensorsStructure 2 from .kernel_classes.orientations import Orientations, OrientationsInternals ----> 3 from .kernel_classes.surface_points import SurfacePoints, SurfacePointsInternals 4 from .options import InterpolationOptions 5 from .solutions import Solutions

File ~\AppData\Roaming\Python\Python311\site-packages\gempy_engine\core\data\kernel_classes\surface_points.py:13 9 from ...backend_tensor import BackendTensor 10 from gempy_engine.modules.kernel_constructor._structs import tensor_types ---> 13 @dataclass(frozen=False) 14 class SurfacePoints: 15 sp_coords: np.ndarray 16 nugget_effect_scalar: Union[np.ndarray, float] = 0.000001

File C:\ProgramData\anaconda3\Lib\dataclasses.py:1220, in dataclass..wrap(cls) 1219 def wrap(cls): -> 1220 return _process_class(cls, init, repr, eq, order, unsafe_hash, 1221 frozen, match_args, kw_only, slots, 1222 weakref_slot)

File C:\ProgramData\anaconda3\Lib\dataclasses.py:958, in _process_class(cls, init, repr, eq, order, unsafe_hash, frozen, match_args, kw_only, slots, weakref_slot) 955 kw_only = True 956 else: 957 # Otherwise it's a field of some type. --> 958 cls_fields.append(_get_field(cls, name, type, kw_only)) 960 for f in cls_fields: 961 fields[f.name] = f

File C:\ProgramData\anaconda3\Lib\dataclasses.py:815, in _get_field(cls, a_name, a_type, default_kw_only) 811 # For real fields, disallow mutable defaults. Use unhashable as a proxy 812 # indicator for mutability. Read the hash attribute from the class, 813 # not the instance. 814 if f._field_type is _FIELD and f.default.class.hash is None: --> 815 raise ValueError(f'mutable default {type(f.default)} for field ' 816 f'{f.name} is not allowed: use default_factory') 818 return f

ValueError: mutable default <class 'slice'> for field slice_feature is not allowed: use default_factory

flohorovicic commented 2 months ago

Can you provide some more details on how you installed GemPy? Did you install it in a virtual environment or conda environment (and with which Python version)?

Varun019140 commented 2 months ago

Can you provide some more details on how you installed GemPy? Did you install it in a virtual environment or conda environment (and with which Python version)?

i am using with anaconda and saw some video i hv tried in different ways some are following ...

  1. i direct put pip install gempy in the cmd ...and the its showed command already satisfied ..but when i am using in jupyter is shows error which i mentioned above

  2. second way is i created a conda enviroment then i put conda install theano..... but its not successfully done ..it showing some unsuccessful frozen solve error.....

  3. then i reinstall anaconda old version which using python 3.9 but same error

  4. i also tried with google colab and its running but on google colab i think its not fully functional ..i tried the same code which you mentioned in the website tutorial but some code is running some is not working ...

i really need help please some one explain me how to use gempy and its coordinates....

Also i want to know what kind of data i can import for 3d visualization ....and how to import data into my code ....plz help

javoha commented 2 months ago

Hello @Varun019140, first of all, great to see that you are using gempy. You opened multiple issues over a very short period of time and as we are trying to keep this area strcutured I would suggest a couple of things:

With this in mind, how much experience in this area do you have? Gempy is an open source modeling tool. We aim to make it accessible to people with little coding experience, but you will still need to invest some time and effort. And while we are trying our best to create a smooth experience, we will not be able to help with all problems - especially if they are not based in gempy.

Regarding your issues: I will close all your other issues for now and would like you to ask your questions here. As a starting point: Following the current installation guide, I would suggest installing gempy using pip in a fresh environment with python 3.12. Theano is not required anymore so you were maybe following an old guide (also videos on youtube do not cover the new version that was just released).

Please try this installation and let us now exactly where you encounter problems.

Good luck and cheers

javoha commented 2 months ago

I will close this for now, please feel free to reopen if you still have specific questions.