Installing and using obspy from source

I want to install obspy from source but not aware of what I have to do. There needs to be some detailed information on how to install the latest version without use of Anaconda.

Have installed Python3 and Numpy. And also have tho Gnu C compiler.

Have got the obspy source from github.

Had a look at README.md which does not specify the version number. Rather than calling it master, having the version number would be more useful.

The fundamental question is how to install obspy from terminal once I go to the obspy directory.

I actually ran the following command in the obspy source directory, which did finish

pip3 install obspy

Then in Jupyter I called

from obspy.core import read

But the aforementioned returned


ModuleNotFoundError Traceback (most recent call last)
in ()
----> 1 from obspy.core import read

ModuleNotFoundError: No module named β€˜obspy’

Have you seen this page on installation on the github wiki and associated links for installing on different systems?

It might be helpful if we link to this wiki page from the main docs page as well.

I want to avoid Anaconda, and for Debian the build is broken. What a mess.

there is no need for anaconda - pip should work out of the box as prebuild packages for Win, MacOS and Linux are provided - I just tested that on a Win10 and Debian11 box:

Win10:

C:\Program Files\Python38\Scripts>virtualenv D:\Python\virtualenv\obspy
created virtual environment CPython3.8.10.final.0-64 in 403ms
  creator CPython3Windows(dest=D:\Python\virtualenv\obspy, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=C:\Users\barsch\AppData\Local\pypa\virtualenv)
    added seed packages: pip==21.2.4, setuptools==58.1.0, wheel==0.37.0
  activators BashActivator,BatchActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator

C:\Program Files\Python38\Scripts>D:

D:\>cd D:\Python\virtualenv\obspy\Scripts

D:\Python\virtualenv\obspy\Scripts>activate.bat

(obspy) D:\Python\virtualenv\obspy\Scripts>pip install obspy
Collecting obspy
  Downloading obspy-1.4.0-cp38-cp38-win_amd64.whl (14.1 MB)
     |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 14.1 MB 285 kB/s
Collecting decorator
  Using cached decorator-5.1.1-py3-none-any.whl (9.1 kB)
Collecting numpy>=1.20
  Downloading numpy-1.24.3-cp38-cp38-win_amd64.whl (14.9 MB)
     |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 14.9 MB ...
Requirement already satisfied: setuptools in d:\python\virtualenv\obspy\lib\site-packages (from obspy) (58.1.0)
Collecting matplotlib>=3.3
  Downloading matplotlib-3.7.1-cp38-cp38-win_amd64.whl (7.6 MB)
     |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 7.6 MB ...
Collecting scipy>=1.7
  Downloading scipy-1.10.1-cp38-cp38-win_amd64.whl (42.2 MB)
     |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 42.2 MB 6.4 MB/s
Collecting requests
  Downloading requests-2.31.0-py3-none-any.whl (62 kB)
     |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 62 kB 4.5 MB/s
Collecting sqlalchemy
  Downloading SQLAlchemy-2.0.15-cp38-cp38-win_amd64.whl (2.0 MB)
     |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 2.0 MB ...
Collecting lxml
  Using cached lxml-4.9.2-cp38-cp38-win_amd64.whl (3.9 MB)
Collecting cycler>=0.10
  Downloading cycler-0.11.0-py3-none-any.whl (6.4 kB)
Collecting fonttools>=4.22.0
  Downloading fonttools-4.39.4-py3-none-any.whl (1.0 MB)
     |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1.0 MB ...
Collecting python-dateutil>=2.7
  Using cached python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
Collecting packaging>=20.0
  Using cached packaging-23.1-py3-none-any.whl (48 kB)
Collecting pyparsing>=2.3.1
  Using cached pyparsing-3.0.9-py3-none-any.whl (98 kB)
Collecting importlib-resources>=3.2.0
  Downloading importlib_resources-5.12.0-py3-none-any.whl (36 kB)
Collecting kiwisolver>=1.0.1
  Downloading kiwisolver-1.4.4-cp38-cp38-win_amd64.whl (55 kB)
     |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 55 kB ...
Collecting contourpy>=1.0.1
  Downloading contourpy-1.0.7-cp38-cp38-win_amd64.whl (162 kB)
     |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 162 kB 6.4 MB/s
Collecting pillow>=6.2.0
  Using cached Pillow-9.5.0-cp38-cp38-win_amd64.whl (2.5 MB)
Collecting zipp>=3.1.0
  Downloading zipp-3.15.0-py3-none-any.whl (6.8 kB)
Collecting six>=1.5
  Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting urllib3<3,>=1.21.1
  Using cached urllib3-2.0.2-py3-none-any.whl (123 kB)
Collecting charset-normalizer<4,>=2
  Using cached charset_normalizer-3.1.0-cp38-cp38-win_amd64.whl (96 kB)
Collecting certifi>=2017.4.17
  Using cached certifi-2023.5.7-py3-none-any.whl (156 kB)
Collecting idna<4,>=2.5
  Using cached idna-3.4-py3-none-any.whl (61 kB)
Collecting typing-extensions>=4.2.0
  Downloading typing_extensions-4.6.3-py3-none-any.whl (31 kB)
Collecting greenlet!=0.4.17
  Using cached greenlet-2.0.2-cp38-cp38-win_amd64.whl (192 kB)
Installing collected packages: zipp, six, numpy, urllib3, typing-extensions, python-dateutil, pyparsing, pillow, packaging, kiwisolver, importlib-resources, idna, greenlet, fonttools, cycler, contourpy, charset-normalizer, certifi, sqlalchemy, scipy, requests, matplotlib, lxml, decorator, obspy
Successfully installed certifi-2023.5.7 charset-normalizer-3.1.0 contourpy-1.0.7 cycler-0.11.0 decorator-5.1.1 fonttools-4.39.4 greenlet-2.0.2 idna-3.4 importlib-resources-5.12.0 kiwisolver-1.4.4 lxml-4.9.2 matplotlib-3.7.1 numpy-1.24.3 obspy-1.4.0 packaging-23.1 pillow-9.5.0 pyparsing-3.0.9 python-dateutil-2.8.2 requests-2.31.0 scipy-1.10.1 six-1.16.0 sqlalchemy-2.0.15 typing-extensions-4.6.3 urllib3-2.0.2 zipp-3.15.0
WARNING: You are using pip version 21.2.4; however, version 23.1.2 is available.
You should consider upgrading via the 'D:\Python\virtualenv\obspy\Scripts\python.exe -m pip install --upgrade pip' command.

(obspy) D:\Python\virtualenv\obspy\Scripts>python
Python 3.8.10 (tags/v3.8.10:3d8993a, May  3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from obspy.core import read
>>> read()
<obspy.core.stream.Stream object at 0x0000027B9BE16130>
>>>

Debian:

barsch@hpb ~ $ uname -a
Linux hpb 5.10.0-23-amd64 #1 SMP Debian 5.10.179-1 (2023-05-12) x86_64 GNU/Linux
barsch@hpb ~ $ python3 -m venv /home/barsch/obspy
barsch@hpb ~ $ source obspy/bin/activate
(obspy) barsch@hpb ~ $ pip install obspy
Collecting obspy
  Downloading obspy-1.4.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (14.5 MB)
     |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 14.5 MB 10.3 MB/s
Collecting lxml
  Downloading lxml-4.9.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (7.1 MB)
     |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 7.1 MB 119.4 MB/s
Collecting scipy>=1.7
  Downloading scipy-1.10.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (34.5 MB)
     |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 34.5 MB 100.2 MB/s
Collecting numpy>=1.20
  Downloading numpy-1.24.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.3 MB)
     |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 17.3 MB 111.7 MB/s
Collecting sqlalchemy
  Downloading SQLAlchemy-2.0.15-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.7 MB)
     |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 2.7 MB 115.4 MB/s
Collecting requests
  Downloading requests-2.31.0-py3-none-any.whl (62 kB)
     |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 62 kB 1.9 MB/s
Collecting matplotlib>=3.3
  Downloading matplotlib-3.7.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.6 MB)
     |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 11.6 MB 115.4 MB/s
Requirement already satisfied: setuptools in ./obspy/lib/python3.9/site-packages (from obspy) (44.1.1)
Collecting decorator
  Downloading decorator-5.1.1-py3-none-any.whl (9.1 kB)
Collecting contourpy>=1.0.1
  Downloading contourpy-1.0.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (299 kB)
     |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 299 kB 112.7 MB/s
Collecting pyparsing>=2.3.1
  Downloading pyparsing-3.0.9-py3-none-any.whl (98 kB)
     |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 98 kB 12.7 MB/s
Collecting kiwisolver>=1.0.1
  Downloading kiwisolver-1.4.4-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (1.6 MB)
     |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1.6 MB 108.2 MB/s
Collecting importlib-resources>=3.2.0
  Downloading importlib_resources-5.12.0-py3-none-any.whl (36 kB)
Collecting fonttools>=4.22.0
  Downloading fonttools-4.39.4-py3-none-any.whl (1.0 MB)
     |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1.0 MB 115.4 MB/s
Collecting packaging>=20.0
  Downloading packaging-23.1-py3-none-any.whl (48 kB)
     |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 48 kB 9.2 MB/s
Collecting cycler>=0.10
  Downloading cycler-0.11.0-py3-none-any.whl (6.4 kB)
Collecting python-dateutil>=2.7
  Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
     |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 247 kB 116.5 MB/s
Collecting pillow>=6.2.0
  Downloading Pillow-9.5.0-cp39-cp39-manylinux_2_28_x86_64.whl (3.4 MB)
     |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 3.4 MB 115.0 MB/s
Collecting zipp>=3.1.0
  Downloading zipp-3.15.0-py3-none-any.whl (6.8 kB)
Collecting six>=1.5
  Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting urllib3<3,>=1.21.1
  Downloading urllib3-2.0.2-py3-none-any.whl (123 kB)
     |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 123 kB 120.1 MB/s
Collecting idna<4,>=2.5
  Downloading idna-3.4-py3-none-any.whl (61 kB)
     |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 61 kB 137 kB/s
Collecting certifi>=2017.4.17
  Downloading certifi-2023.5.7-py3-none-any.whl (156 kB)
     |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 156 kB 117.0 MB/s
Collecting charset-normalizer<4,>=2
  Downloading charset_normalizer-3.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (199 kB)
     |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 199 kB 118.2 MB/s
Collecting typing-extensions>=4.2.0
  Downloading typing_extensions-4.6.3-py3-none-any.whl (31 kB)
Collecting greenlet!=0.4.17
  Downloading greenlet-2.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (610 kB)
     |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 610 kB 112.9 MB/s
Installing collected packages: zipp, six, numpy, urllib3, typing-extensions, python-dateutil, pyparsing, pillow, packaging, kiwisolver, importlib-resources, idna, greenlet, fonttools, cycler, contourpy, charset-normalizer, certifi, sqlalchemy, scipy, requests, matplotlib, lxml, decorator, obspy
Successfully installed certifi-2023.5.7 charset-normalizer-3.1.0 contourpy-1.0.7 cycler-0.11.0 decorator-5.1.1 fonttools-4.39.4 greenlet-2.0.2 idna-3.4 importlib-resources-5.12.0 kiwisolver-1.4.4 lxml-4.9.2 matplotlib-3.7.1 numpy-1.24.3 obspy-1.4.0 packaging-23.1 pillow-9.5.0 pyparsing-3.0.9 python-dateutil-2.8.2 requests-2.31.0 scipy-1.10.1 six-1.16.0 sqlalchemy-2.0.15 typing-extensions-4.6.3 urllib3-2.0.2 zipp-3.15.0
(obspy) barsch@hpb ~ $ python3
Python 3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from obspy.core import read
>>> read()
<obspy.core.stream.Stream object at 0x7f8ed86b25b0>
>>>

If you ran pip3 install obspy then this will download and install the package from pypi. If you want to build a python package form source you should run pip3 install . from the source directory.

Based on the commands you said you ran it looks like you installed the pypi package, then ran jupyter from within the (unbuilt) obspy source directory. This will likely have resulted in a path conflict: the first path searched for a given module is the current directory when running jupyter. Your python interpreter will likely have attempted to load the unbuilt obspy module on your path resulting in the error you experienced.

Another common issue that people run into with jupyter is that (unless doing fancy stuff), jupyter and your obspy installation (or whatever other packages need to be in the same Python environment.
Inside your Jupyter session you could do something like this to confirm what Python you are currently running and then confirm it is the same you installed obspy into.

import sys
print(sys.executable, sys.prefix)

We recommend Anaconda because for 99% of our users it is the easiest way to get ObsPy up and running. When it comes to installing from source, as pointed out before like with 99% of Python packages out there, you would simply do pip install . in the source directory and if compilers are set up properly that’s all you need to do.
Certainly docs can always be improved but the same goes for the choice of tone when asking people for help that do not get paid for giving support.

1 Like

Also, if you take the time to search our issue tracker for β€œdebian”, you can easily find some tips for an installation that augments the Python installed through Debian packages as the first and very detailed comment in the first issue that pop up in the search. You’re welcome.