megies / obspyck

ObsPyck is a GUI application that is intended to cover the tasks in a standard analysis workflow for seismic events in seismological observatory practice.
https://github.com/megies/obspyck/wiki
GNU General Public License v2.0
61 stars 32 forks source link

ModuleNotFoundError when using ObsPyck: 'obspy.clients.arclink' not found #105

Closed davidn182 closed 1 year ago

davidn182 commented 1 year ago

Immediately after installation, when attempting to use obspyck, I'm encountering a "ModuleNotFoundError" related to 'obspy.clients.arclink'.

To Reproduce

Here's how I installed obspyck and the command I ran when I encountered the error:

% conda config --add channels conda-forge
% conda create -n obspyck python=3 'obspyck>=0.8' pyproj
% conda activate obspyck
(obspyck) ~ % obspyck -h
Traceback (most recent call last):
  File "/Users/.../opt/anaconda3/envs/obspyck/bin/obspyck", line 6, in <module>
    from obspyck.obspyck import main
  File "/Users/.../opt/anaconda3/envs/obspyck/lib/python3.11/site-packages/obspyck/obspyck.py", line 54, in <module>
    from .qt_designer import Ui_qMainWindow_obsPyck
  File "/Users/.../opt/anaconda3/envs/obspyck/lib/python3.11/site-packages/obspyck/qt_designer.py", line 958, in <module>
    from .util import QMplCanvas
  File "/Users/.../opt/anaconda3/envs/obspyck/lib/python3.11/site-packages/obspyck/util.py", line 33, in <module>
    import obspy.clients.arclink
ModuleNotFoundError: No module named 'obspy.clients.arclink'

Desktop

Additional context

It seems that the 'arclink' module has been deprecated and removed in recent obspy versions. I'm unsure of how to resolve this issue and would appreciate any guidance.

megies commented 1 year ago

Easiest would be to swap to recent development version, in your environment you could do:

% conda activate obspyck
(obspyck) ~ % conda remove --force --offline obspyck  # this should ONLY remove obspyck nothing else
(obspyck) ~ % pip install https://github.com/megies/obspyck/archive/refs/heads/master.zip
davidn182 commented 1 year ago

Yes, that works! It is a really great package :)

In case anyone else has the same issue as me, these are the complete steps I did to have it running:

  1. Clone the repository

    git clone https://github.com/megies/obspyck.git
  2. Create a virtual environment.

    (base) $ python -m venv obspyck_env
  3. Activate the virtual env

    source obspyck_env/bin/activate
  4. Install packages using pip

    pip install -e .
    pip install pyproj
    pip install PyQt5