nfsi-canada / OrientPy

Seismic station orientation tools
https://nfsi-canada.github.io/OrientPy/
44 stars 16 forks source link

ImportError: cannot import name 'arguments' from 'orientpy' #13

Closed Chu-Te-Ethan-Chen closed 3 years ago

Chu-Te-Ethan-Chen commented 3 years ago

Hi, I ran into an error when trying to run bng_calc_auto.py.

$ ./bng_calc_auto.py
Traceback (most recent call last):
  File "./bng_calc_auto.py", line 11, in <module>
    from orientpy import BNG, arguments
ImportError: cannot import name 'arguments' from 'orientpy' (/home/user/.conda/envs/orient/lib/python3.7/site-packages/orientpy/__init__.py)

reproduction:

conda create -n orient python=3.7 obspy -c conda-forge
conda activate orient
pip install stdb
pip install geographiclib
git clone https://github.com/nfsi-canada/OrientPy.git
cd OrientPy
pip install .

reference: OrientPy docs Installation p.s. https://github.com/paudetseis/OrientPy.git <- This link is no longer available.

system: 5.8.6-101.fc31.x86_64

conda list:

$ conda list
# packages in environment at /home/user/.conda/envs/orient:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       1_gnu    conda-forge
brotlipy                  0.7.0           py37h5e8e339_1001    conda-forge
ca-certificates           2020.12.5            ha878542_0    conda-forge
certifi                   2020.12.5        py37h89c1867_1    conda-forge
cffi                      1.14.5           py37hc58025e_0    conda-forge
chardet                   4.0.0            py37h89c1867_1    conda-forge
cryptography              3.4.6            py37h5d9358c_0    conda-forge
cycler                    0.10.0                     py_2    conda-forge
decorator                 4.4.2                      py_0    conda-forge
freetype                  2.10.4               h0708190_1    conda-forge
future                    0.18.2           py37h89c1867_3    conda-forge
geographiclib             1.50                     pypi_0    pypi
icu                       68.1                 h58526e2_0    conda-forge
idna                      2.10               pyh9f0ad1d_0    conda-forge
jpeg                      9d                   h36c2ea0_0    conda-forge
kiwisolver                1.3.1            py37h2527ec5_1    conda-forge
lcms2                     2.12                 hddcbb42_0    conda-forge
ld_impl_linux-64          2.35.1               hea4e1c9_2    conda-forge
libblas                   3.9.0                8_openblas    conda-forge
libcblas                  3.9.0                8_openblas    conda-forge
libffi                    3.3                  h58526e2_2    conda-forge
libgcc-ng                 9.3.0               h2828fa1_18    conda-forge
libgfortran-ng            9.3.0               hff62375_18    conda-forge
libgfortran5              9.3.0               hff62375_18    conda-forge
libgomp                   9.3.0               h2828fa1_18    conda-forge
libiconv                  1.16                 h516909a_0    conda-forge
liblapack                 3.9.0                8_openblas    conda-forge
libopenblas               0.3.12          pthreads_h4812303_1    conda-forge
libpng                    1.6.37               h21135ba_2    conda-forge
libstdcxx-ng              9.3.0               h6de172a_18    conda-forge
libtiff                   4.2.0                hdc55705_0    conda-forge
libwebp-base              1.2.0                h7f98852_0    conda-forge
libxml2                   2.9.10               h72842e0_3    conda-forge
libxslt                   1.1.33               h15afd5d_2    conda-forge
lxml                      4.6.2            py37h77fd288_1    conda-forge
lz4-c                     1.9.3                h9c3ff4c_0    conda-forge
matplotlib-base           3.3.4            py37h0c9df89_0    conda-forge
ncurses                   6.2                  h58526e2_4    conda-forge
numpy                     1.20.1           py37haa41c4c_0    conda-forge
obspy                     1.2.2            py37h03ebfcd_0    conda-forge
olefile                   0.46               pyh9f0ad1d_1    conda-forge
openssl                   1.1.1j               h7f98852_0    conda-forge
orientpy                  0.0.1                    pypi_0    pypi
pillow                    8.1.2            py37h4600e1f_0    conda-forge
pip                       21.0.1             pyhd8ed1ab_0    conda-forge
pycparser                 2.20               pyh9f0ad1d_2    conda-forge
pyopenssl                 20.0.1             pyhd8ed1ab_0    conda-forge
pyparsing                 2.4.7              pyh9f0ad1d_0    conda-forge
pyqt5                     5.15.4                   pypi_0    pypi
pyqt5-qt5                 5.15.2                   pypi_0    pypi
pyqt5-sip                 12.8.1                   pypi_0    pypi
pysocks                   1.7.1            py37h89c1867_3    conda-forge
python                    3.7.10          hffdb5ce_100_cpython    conda-forge
python-dateutil           2.8.1                      py_0    conda-forge
python_abi                3.7                     1_cp37m    conda-forge
readline                  8.0                  he28a2e2_2    conda-forge
requests                  2.25.1             pyhd3deb0d_0    conda-forge
scipy                     1.6.0            py37h14a347d_0    conda-forge
setuptools                49.6.0           py37h89c1867_3    conda-forge
six                       1.15.0             pyh9f0ad1d_0    conda-forge
sqlalchemy                1.3.23           py37h5e8e339_0    conda-forge
sqlite                    3.34.0               h74cdb3f_0    conda-forge
stdb                      0.2.0                    pypi_0    pypi
tk                        8.6.10               h21135ba_1    conda-forge
tornado                   6.1              py37h5e8e339_1    conda-forge
urllib3                   1.26.4             pyhd8ed1ab_0    conda-forge
wheel                     0.36.2             pyhd3deb0d_0    conda-forge
xz                        5.2.5                h516909a_1    conda-forge
zlib                      1.2.11            h516909a_1010    conda-forge
zstd                      1.4.9                ha95c52a_0    conda-forge

It seems that the arguments.py was deleted in 4723831.

paudetseis commented 3 years ago

Hi,

Yes, OrientPy was refactored and the module arguments.py has been removed and the functions were incorporated into each separate script.

I also fixed the incorrect reference in the docs.

try re-installing OrientPy and let me know if the problem persists.