Closed IsabellaLorenzen closed 1 month ago
How did you install pybert and which version do you have?
I installed it using pip install pybert and its the 0.0.2 version.
It is a folder i my site packages in the pygimli environment.
You probably installed some other pybert. Up to now, there is no pip installation of OUR pybert (but there should be one as now pyGIMLi can also be installed by pip). Please use conda install -c gimli pybert
or just clone pyBERT by git.
I am not able to run conda install -c gimli pybert
with my current python version (3.11), but to be able to run it i have made a new environment, that will allow be to run the install. The envionment is made with this code:
conda create -n pg_newness -c gimli -c conda-forge python=3.8 "pygimli<=1.4.0"
But in spyder when i run only import pygimli as pg
and import pybert as pb
it yields the following error:
AttributeError: module 'numpy' has no attribute 'float'.
np.float
was a deprecated alias for the builtin float
. To avoid this error in existing code, use float
by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.float64
here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
(In addition i would like to use the newest version of pygimli as possible. I was succesful in running my code with pygimli 1.3.1 version, but i am using the dataframe .copy() command, and that is not accessable in the 1.3.1 version)
Why would you want pygimli <= 1.4.0 ? Can you please try with >= 1.5.0 ?
I didnt think i was able to, but I have now created an environment with conda create -n pg_newness -c gimli -c conda-forge python=3.8 "pygimli<=1.5.0"
When i run each of these import: import pygimli as pg import pybert as pb from pybert.importer.exportData import exportRes2dInv
I still get the error:
AttributeError: module 'numpy' has no attribute 'float'.
np.float
was a deprecated alias for the builtin float
. To avoid this error in existing code, use float
by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.float64
here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
I suspected it had something to do with my numpy version, but i have tried different version from 1.19 to 1.24, and i keep getting the same issue, and i am not even calling any .np commands with just importing pg and pd.
Hallo again, and sorry for all of the back and forth!
I finally created an environment with conda create -n pg_newness -c gimli -c conda-forge python=3.9 "pygimli<=1.5.0"
And it apprears to all be working now, thank you!
In this case the <= does not make much sense, did you now install 1.5.0 or 1.4.x?
In any case, we stopped supporting Python<3.9 so fixing to 3.8 was the source of the problem.
Problem description¨
I wish to export my ERT data into res2dinv. In a previous issue you recommended the following code:
from pybert.importer.exportData import exportRes2dInv exportRes2dInv(data, "filename.dat")
But i struggle to import the exportRed2dInv
Your environment
OS : Windows CPU(s) : 8 Machine : AMD64 Architecture : 64bit RAM : 7.8 GiB Environment : IPython
Python 3.9.18 | packaged by conda-forge | (main, Dec 23 2023, 16:29:04) [MSC v.1929 64 bit (AMD64)]
Steps to reproduce
I have tried these commands: