eqcorrscan / EQcorrscan

Earthquake detection and analysis in Python.
https://eqcorrscan.readthedocs.io/en/latest/
Other
166 stars 86 forks source link

[HELP] Error numpy.int32 after installation #483

Closed tonino0013 closed 2 years ago

tonino0013 commented 2 years ago

What do you need help with?

New Installation Problems

Provide an example so that we can reproduce your problem

After installing on a new PC Windows 10 under Anaconda enviorement I am not able to run eqcorrscan I tried the procedure described on https://eqcorrscan.readthedocs.io/en/latest/installation.html with CONDA procedure and no CONDA procedure, until then seems to be perfect, however while I try to test my codes I got an error, for example, if I just typre:

from eqcorrscan.core.match_filter import Tribe The ouput is:


Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "D:\Inves\Pdoc\EQcorrscan\eqcorrscan\__init__.py", line 15, in <module>
    from eqcorrscan.core.match_filter.party import Party  # NOQA
  File "D:\Inves\Pdoc\EQcorrscan\eqcorrscan\core\match_filter\__init__.py", line 11, in <module>
    from eqcorrscan.core.match_filter.party import Party, read_party  # NOQA
  File "D:\Inves\Pdoc\EQcorrscan\eqcorrscan\core\match_filter\party.py", line 24, in <module>
    from obspy import Catalog, read_events, Stream
  File "C:\Users\Director\anaconda3\envs\eqcorrscan\lib\site-packages\obspy\__init__.py", line 39, in <module>
    from obspy.core.utcdatetime import UTCDateTime  # NOQA
  File "C:\Users\Director\anaconda3\envs\eqcorrscan\lib\site-packages\obspy\core\__init__.py", line 124, in <module>
    from obspy.core.utcdatetime import UTCDateTime  # NOQA
  File "C:\Users\Director\anaconda3\envs\eqcorrscan\lib\site-packages\obspy\core\utcdatetime.py", line 27, in <module>
    from obspy.core.util.deprecation_helpers import ObsPyDeprecationWarning
  File "C:\Users\Director\anaconda3\envs\eqcorrscan\lib\site-packages\obspy\core\util\__init__.py", line 27, in <module>
    from obspy.core.util.base import (ALL_MODULES, DEFAULT_MODULES,
  File "C:\Users\Director\anaconda3\envs\eqcorrscan\lib\site-packages\obspy\core\util\base.py", line 36, in <module>
    from obspy.core.util.misc import to_int_or_zero, buffered_load_entry_point
  File "C:\Users\Director\anaconda3\envs\eqcorrscan\lib\site-packages\obspy\core\util\misc.py", line 214, in <module>
    loadtxt(np.array([0]), ndmin=1)
  File "C:\Users\Director\anaconda3\envs\eqcorrscan\lib\site-packages\numpy\lib\npyio.py", line 1086, in loadtxt
    ncols = len(usecols or split_line(first_line))
  File "C:\Users\Director\anaconda3\envs\eqcorrscan\lib\site-packages\numpy\lib\npyio.py", line 977, in split_line
    line = line.split(comment, 1)[0]
AttributeError: 'numpy.int32' object has no attribute 'split'

I also installed the FFTW library with CONDA commands from https://anaconda.org/conda-forge/fftw

Does anyone is experimenting this issue?

What help would you like?

Do I need to install a numpy for 32 bits? Did someone have this issue before?

What is your setup? (please complete the following information):**

flixha commented 2 years ago

Hi, this issue is caused somewhere during the import of Obspy. I actually got a very similar problem (just with int64) just now when importing obspy. I think it's related to the Obspy-developers preparing a lot of changes right now for a new release; and there may have been an issue with some numpy-related bug making it into the stable release.

Maybe easiest to wait 1-2 days and try again if it's not urgent for you right now. Alternatively, you can install Obspy from Obspy's master branch rather than the stable release; that worked for me at least.

tonino0013 commented 2 years ago

Dear @flixha , Ok, let's wait some days to see if the Obspy was the problem, I hope it will be fixed. Stay safe, best regards

tonino0013 commented 2 years ago

Dear @flixha , I installed version Obpsy1.2.0, seems ok, I will test with my scripts. Stay safe and best regards, Tonino

calum-chamberlain commented 2 years ago

Thanks for reporting this @tonino0013 and thanks for the obspy notes @flixha - if your scripts are running with obspy 1.2.0 (I think the issue is with the numpy version if you need things in obspy 1.2.2 you could try downgrading numpy) then we won't change anything here yet.

I will leave this open and test things once the new obspy release gets out in the wild.

Sorry for the slow response, holiday time!

tonino0013 commented 2 years ago

Dear @calum-chamberlain, Thank you for the suggestion, downgranding numpy also works. I am testing the scripts and no problem.

Stay safe and best regards Tonino