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

Not able to import gempy #881

Closed
Varun019140 opened this issue Apr 26, 2024 · 4 comments
Closed

Not able to import gempy #881

Varun019140 opened this issue Apr 26, 2024 · 4 comments

Comments

@Varun019140
Copy link

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
Copy link
Contributor

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
Copy link
Author

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
Copy link
Contributor

javoha commented Apr 28, 2024

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:

  • Please make sure to wait for a response until you open new issues, and close your issues if they are resolved
  • While printed error messages are often useful, a clear written description of the problem is most important to us. Please also make sure to use a well readible style and we also appreciate a little effort on spell checking etc.

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
Copy link
Contributor

javoha commented May 16, 2024

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

@javoha javoha closed this as completed May 16, 2024
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