question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: __init__() got an unexpected keyword argument 'metric'

See original GitHub issue

🐞 Problem

Here it is not understanding the word metric.

init()

🖥 Please paste the output of following commands

  • conda info -a (only if you have conda)
  • conda list (only if you have conda)
  • pip freeze
# Paste your output here:
     active environment : /home/jovyan/.conda-envs/einsteinpy
    active env location : /home/jovyan/.conda-envs/einsteinpy
            shell level : 1
       user config file : /home/jovyan/.condarc
 populated config files : /opt/conda/.condarc
          conda version : 4.7.12
    conda-build version : not installed
         python version : 3.7.4.final.0
       virtual packages : 
       base environment : /opt/conda  (writable)
           channel URLs : https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /opt/conda/pkgs
                          /home/jovyan/.conda/pkgs
       envs directories : /opt/conda/envs
                          /home/jovyan/.conda/envs
               platform : linux-64
             user-agent : conda/4.7.12 requests/2.24.0 CPython/3.7.4 Linux/4.19.150+ ubuntu/18.04.3 glibc/2.27
                UID:GID : 1000:0
             netrc file : None
           offline mode : False

# conda environments:
#
                      *  /home/jovyan/.conda-envs/einsteinpy
base                     /opt/conda

sys.version: 3.7.4 (default, Aug 13 2019, 20:35:49) 
...
sys.prefix: /opt/conda
sys.executable: /opt/conda/bin/python
conda location: /opt/conda/lib/python3.7/site-packages/conda
conda-build: None
conda-env: /opt/conda/bin/conda-env
user site dirs: 

CIO_TEST: <not set>
CONDA_DEFAULT_ENV: /home/jovyan/.conda-envs/einsteinpy
CONDA_DIR: /opt/conda
CONDA_EXE: /opt/conda/bin/conda
CONDA_PREFIX: /home/jovyan/.conda-envs/einsteinpy
CONDA_PROMPT_MODIFIER: (/home/jovyan/.conda-envs/einsteinpy) 
CONDA_PYTHON_EXE: /opt/conda/bin/python
CONDA_ROOT: /opt/conda
CONDA_SHLVL: 1
CONDA_VERSION: 4.7.12
PATH: /opt/conda/bin:/home/jovyan/.conda-envs/einsteinpy/bin:/opt/conda/bin:/opt/conda/condabin:/opt/conda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
REQUESTS_CA_BUNDLE: <not set>
SSL_CERT_FILE: <not set>

(/home/jovyan/.conda-envs/einsteinpy) jovyan@jupyter-paulob14:~/temp/einsteinpy-0.3.1$ conda list
# packages in environment at /home/jovyan/.conda-envs/einsteinpy:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       1_gnu    conda-forge
argon2-cffi               20.1.0           py38h497a2fe_2    conda-forge
astropy                   4.2              py38h497a2fe_2    conda-forge
astroquery                0.4.1              pyh9f0ad1d_0    conda-forge
async_generator           1.10                       py_0    conda-forge
attrs                     20.3.0             pyhd3deb0d_0    conda-forge
backcall                  0.2.0              pyh9f0ad1d_0    conda-forge
backports                 1.0                        py_2    conda-forge
backports.functools_lru_cache 1.6.1                      py_0    conda-forge
beautifulsoup4            4.9.3              pyhb0f4dca_0    conda-forge
bleach                    3.3.0              pyh44b312d_0    conda-forge
brotlipy                  0.7.0           py38h497a2fe_1001    conda-forge
ca-certificates           2020.12.5            ha878542_0    conda-forge
certifi                   2020.12.5        py38h578d9bd_1    conda-forge
cffi                      1.14.5           py38ha65f79e_0    conda-forge
chardet                   4.0.0            py38h578d9bd_1    conda-forge
cryptography              3.4.4            py38h3e25421_0    conda-forge
cycler                    0.10.0                     py_2    conda-forge
dbus                      1.13.6               hfdff14a_1    conda-forge
decorator                 4.4.2                      py_0    conda-forge
defusedxml                0.6.0                      py_0    conda-forge
einsteinpy                0.4.dev0                 pypi_0    pypi
einsteinpy-geodesics      0.1.0                    pypi_0    pypi
entrypoints               0.3             pyhd8ed1ab_1003    conda-forge
expat                     2.2.10               h9c3ff4c_0    conda-forge
freetype                  2.10.4               h0708190_1    conda-forge
gettext                   0.19.8.1          h0b5b191_1005    conda-forge
glib                      2.66.7               h9c3ff4c_1    conda-forge
glib-tools                2.66.7               h9c3ff4c_1    conda-forge
gmp                       6.2.1                h58526e2_0    conda-forge
gmpy2                     2.1.0b1          py38hd744826_1    conda-forge
html5lib                  1.1                pyh9f0ad1d_0    conda-forge
idna                      2.10               pyh9f0ad1d_0    conda-forge
importlib-metadata        3.7.0            py38h578d9bd_0    conda-forge
ipykernel                 5.5.0            py38h81c977d_1    conda-forge
ipython                   7.21.0           py38h81c977d_0    conda-forge
ipython_genutils          0.2.0                      py_1    conda-forge
ipywidgets                7.6.3              pyhd3deb0d_0    conda-forge
jedi                      0.18.0           py38h578d9bd_2    conda-forge
jeepney                   0.6.0              pyhd8ed1ab_0    conda-forge
jinja2                    2.11.3             pyh44b312d_0    conda-forge
jpeg                      9d                   h36c2ea0_0    conda-forge
jsonschema                3.2.0              pyhd8ed1ab_3    conda-forge
jupyter_client            6.1.11             pyhd8ed1ab_1    conda-forge
jupyter_core              4.7.1            py38h578d9bd_0    conda-forge
jupyterlab_pygments       0.1.2              pyh9f0ad1d_0    conda-forge
jupyterlab_widgets        1.0.0              pyhd8ed1ab_1    conda-forge
keyring                   22.3.0           py38h578d9bd_0    conda-forge
kiwisolver                1.3.1            py38h1fd1430_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
libglib                   2.66.7               h3e27bee_1    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
libllvm10                 10.0.1               he513fc3_3    conda-forge
libopenblas               0.3.12          pthreads_h4812303_1    conda-forge
libpng                    1.6.37               h21135ba_2    conda-forge
libsodium                 1.0.18               h36c2ea0_1    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
llvmlite                  0.35.0           py38h4630a5e_1    conda-forge
lz4-c                     1.9.3                h9c3ff4c_0    conda-forge
markupsafe                1.1.1            py38h497a2fe_3    conda-forge
matplotlib-base           3.3.4            py38h0efea84_0    conda-forge
mistune                   0.8.4           py38h497a2fe_1003    conda-forge
mpc                       1.1.0             h04dde30_1009    conda-forge
mpfr                      4.0.2                he80fd80_1    conda-forge
mpmath                    1.2.1              pyhd8ed1ab_0    conda-forge
nbclient                  0.5.3              pyhd8ed1ab_0    conda-forge
nbconvert                 6.0.7            py38h578d9bd_3    conda-forge
nbformat                  5.1.2              pyhd8ed1ab_1    conda-forge
ncurses                   6.2                  h58526e2_4    conda-forge
nest-asyncio              1.4.3              pyhd8ed1ab_0    conda-forge
notebook                  6.2.0            py38h578d9bd_0    conda-forge
numba                     0.52.0           py38h51da96c_0    conda-forge
numpy                     1.20.1           py38h18fd61f_0    conda-forge
olefile                   0.46               pyh9f0ad1d_1    conda-forge
openssl                   1.1.1j               h7f98852_0    conda-forge
packaging                 20.9               pyh44b312d_0    conda-forge
pandas                    1.2.3            py38h51da96c_0    conda-forge
pandoc                    2.11.4               h7f98852_0    conda-forge
pandocfilters             1.4.2                      py_1    conda-forge
parso                     0.8.1              pyhd8ed1ab_0    conda-forge
pcre                      8.44                 he1b5a44_0    conda-forge
pexpect                   4.8.0              pyh9f0ad1d_2    conda-forge
pickleshare               0.7.5                   py_1003    conda-forge
pillow                    8.1.1            py38ha0e1e83_0    conda-forge
pip                       21.0.1             pyhd8ed1ab_0    conda-forge
plotly                    4.14.3             pyh44b312d_0    conda-forge
prometheus_client         0.9.0              pyhd3deb0d_0    conda-forge
prompt-toolkit            3.0.16             pyha770c72_0    conda-forge
ptyprocess                0.7.0              pyhd3deb0d_0    conda-forge
pycparser                 2.20               pyh9f0ad1d_2    conda-forge
pyerfa                    1.7.2            py38h497a2fe_0    conda-forge
pygments                  2.8.0              pyhd8ed1ab_0    conda-forge
pyopenssl                 20.0.1             pyhd8ed1ab_0    conda-forge
pyparsing                 2.4.7              pyh9f0ad1d_0    conda-forge
pyrsistent                0.17.3           py38h497a2fe_2    conda-forge
pysocks                   1.7.1            py38h578d9bd_3    conda-forge
python                    3.8.8           hffdb5ce_0_cpython    conda-forge
python-dateutil           2.8.1                      py_0    conda-forge
python_abi                3.8                      1_cp38    conda-forge
pytz                      2021.1             pyhd8ed1ab_0    conda-forge
pyzmq                     22.0.3           py38h2035c66_1    conda-forge
readline                  8.0                  he28a2e2_2    conda-forge
requests                  2.25.1             pyhd3deb0d_0    conda-forge
retrying                  1.3.3                      py_2    conda-forge
scipy                     1.6.0            py38hb2138dd_0    conda-forge
secretstorage             3.3.1            py38h578d9bd_0    conda-forge
send2trash                1.5.0                      py_0    conda-forge
setuptools                49.6.0           py38h578d9bd_3    conda-forge
six                       1.15.0             pyh9f0ad1d_0    conda-forge
soupsieve                 2.0.1                      py_1    conda-forge
sqlite                    3.34.0               h74cdb3f_0    conda-forge
sympy                     1.7.1            py38h578d9bd_1    conda-forge
terminado                 0.9.2            py38h578d9bd_0    conda-forge
testpath                  0.4.4                      py_0    conda-forge
tk                        8.6.10               h21135ba_1    conda-forge
tornado                   6.1              py38h497a2fe_1    conda-forge
traitlets                 5.0.5                      py_0    conda-forge
urllib3                   1.26.3             pyhd8ed1ab_0    conda-forge
wcwidth                   0.2.5              pyh9f0ad1d_2    conda-forge
webencodings              0.5.1                      py_1    conda-forge
wheel                     0.36.2             pyhd3deb0d_0    conda-forge
widgetsnbextension        3.5.1            py38h578d9bd_4    conda-forge
xz                        5.2.5                h516909a_1    conda-forge
zeromq                    4.3.4                h9c3ff4c_0    conda-forge
zipp                      3.4.0                      py_0    conda-forge
zlib                      1.2.11            h516909a_1010    conda-forge
zstd                      1.4.8                ha95c52a_1    conda-forge
(/home/jovyan/.conda-envs/einsteinpy) jovyan@jupyter-paulob14:~/temp/einsteinpy-0.3.1$ pip freeze
argon2-cffi @ file:///home/conda/feedstock_root/build_artifacts/argon2-cffi_1610522574055/work
astropy @ file:///home/conda/feedstock_root/build_artifacts/astropy_1612734307982/work
astroquery==0.4.1
async-generator==1.10
attrs @ file:///home/conda/feedstock_root/build_artifacts/attrs_1605083924122/work
backcall @ file:///home/conda/feedstock_root/build_artifacts/backcall_1592338393461/work
backports.functools-lru-cache==1.6.1
beautifulsoup4 @ file:///home/conda/feedstock_root/build_artifacts/beautifulsoup4_1601745390275/work
bleach @ file:///home/conda/feedstock_root/build_artifacts/bleach_1612213472466/work
brotlipy==0.7.0
certifi==2020.12.5
cffi @ file:///home/conda/feedstock_root/build_artifacts/cffi_1613413861439/work
chardet @ file:///home/conda/feedstock_root/build_artifacts/chardet_1610093490430/work
cryptography @ file:///home/conda/feedstock_root/build_artifacts/cryptography_1612993729974/work
cycler==0.10.0
decorator==4.4.2
defusedxml==0.6.0
einsteinpy @ file:///home/jovyan/temp/einsteinpy-0.3.1
einsteinpy-geodesics==0.1.0
entrypoints @ file:///home/conda/feedstock_root/build_artifacts/entrypoints_1605121927639/work/dist/entrypoints-0.3-py2.py3-none-any.whl
gmpy2==2.1.0b1
html5lib @ file:///home/conda/feedstock_root/build_artifacts/html5lib_1592930327044/work
idna @ file:///home/conda/feedstock_root/build_artifacts/idna_1593328102638/work
importlib-metadata @ file:///home/conda/feedstock_root/build_artifacts/importlib-metadata_1614193722981/work
ipykernel @ file:///home/conda/feedstock_root/build_artifacts/ipykernel_1613852938555/work/dist/ipykernel-5.5.0-py3-none-any.whl
ipython @ file:///home/conda/feedstock_root/build_artifacts/ipython_1614393573755/work
ipython-genutils==0.2.0
ipywidgets @ file:///home/conda/feedstock_root/build_artifacts/ipywidgets_1609995587151/work
jedi @ file:///home/conda/feedstock_root/build_artifacts/jedi_1610146791023/work
jeepney @ file:///home/conda/feedstock_root/build_artifacts/jeepney_1605811727098/work
Jinja2 @ file:///home/conda/feedstock_root/build_artifacts/jinja2_1612119311452/work
jsonschema @ file:///home/conda/feedstock_root/build_artifacts/jsonschema_1614815863336/work
jupyter-client @ file:///home/conda/feedstock_root/build_artifacts/jupyter_client_1610375432619/work
jupyter-core @ file:///home/conda/feedstock_root/build_artifacts/jupyter_core_1612125275706/work
jupyterlab-pygments @ file:///home/conda/feedstock_root/build_artifacts/jupyterlab_pygments_1601375948261/work
jupyterlab-widgets @ file:///home/conda/feedstock_root/build_artifacts/jupyterlab_widgets_1609173350931/work
keyring @ file:///home/conda/feedstock_root/build_artifacts/keyring_1614462110536/work
kiwisolver @ file:///home/conda/feedstock_root/build_artifacts/kiwisolver_1610099769230/work
llvmlite==0.35.0
MarkupSafe @ file:///home/conda/feedstock_root/build_artifacts/markupsafe_1610127565888/work
matplotlib @ file:///home/conda/feedstock_root/build_artifacts/matplotlib-suite_1611858708474/work
mistune @ file:///home/conda/feedstock_root/build_artifacts/mistune_1610112875388/work
mpmath @ file:///home/conda/feedstock_root/build_artifacts/mpmath_1612895720168/work
nbclient @ file:///home/conda/feedstock_root/build_artifacts/nbclient_1614336084111/work
nbconvert @ file:///home/conda/feedstock_root/build_artifacts/nbconvert_1605401836768/work
nbformat @ file:///home/conda/feedstock_root/build_artifacts/nbformat_1611005694671/work
nest-asyncio @ file:///home/conda/feedstock_root/build_artifacts/nest-asyncio_1605195931949/work
notebook @ file:///home/conda/feedstock_root/build_artifacts/notebook_1610575313697/work
numba @ file:///home/conda/feedstock_root/build_artifacts/numba_1607010260266/work
numpy @ file:///home/conda/feedstock_root/build_artifacts/numpy_1612953005674/work
olefile @ file:///home/conda/feedstock_root/build_artifacts/olefile_1602866521163/work
packaging @ file:///home/conda/feedstock_root/build_artifacts/packaging_1612459636436/work
pandas==1.2.3
pandocfilters==1.4.2
parso @ file:///home/conda/feedstock_root/build_artifacts/parso_1607618318316/work
pexpect @ file:///home/conda/feedstock_root/build_artifacts/pexpect_1602535608087/work
pickleshare @ file:///home/conda/feedstock_root/build_artifacts/pickleshare_1602536217715/work
Pillow @ file:///home/conda/feedstock_root/build_artifacts/pillow_1614689684518/work
plotly @ file:///home/conda/feedstock_root/build_artifacts/plotly_1610471242275/work
prometheus-client @ file:///home/conda/feedstock_root/build_artifacts/prometheus_client_1605543085815/work
prompt-toolkit @ file:///home/conda/feedstock_root/build_artifacts/prompt-toolkit_1613068548426/work
ptyprocess @ file:///home/conda/feedstock_root/build_artifacts/ptyprocess_1609419310487/work/dist/ptyprocess-0.7.0-py2.py3-none-any.whl
pycparser @ file:///home/conda/feedstock_root/build_artifacts/pycparser_1593275161868/work
pyerfa @ file:///home/conda/feedstock_root/build_artifacts/pyerfa_1612741075960/work
Pygments @ file:///home/conda/feedstock_root/build_artifacts/pygments_1613412098605/work
pyOpenSSL @ file:///home/conda/feedstock_root/build_artifacts/pyopenssl_1608055815057/work
pyparsing==2.4.7
pyrsistent @ file:///home/conda/feedstock_root/build_artifacts/pyrsistent_1610146798212/work
PySocks @ file:///home/conda/feedstock_root/build_artifacts/pysocks_1610291447907/work
python-dateutil==2.8.1
pytz @ file:///home/conda/feedstock_root/build_artifacts/pytz_1612179539967/work
pyzmq @ file:///home/conda/feedstock_root/build_artifacts/pyzmq_1614611703677/work
requests @ file:///home/conda/feedstock_root/build_artifacts/requests_1608156231189/work
retrying==1.3.3
scipy @ file:///home/conda/feedstock_root/build_artifacts/scipy_1609457852787/work
SecretStorage @ file:///home/conda/feedstock_root/build_artifacts/secretstorage_1612911537506/work
Send2Trash==1.5.0
six @ file:///home/conda/feedstock_root/build_artifacts/six_1590081179328/work
soupsieve @ file:///home/conda/feedstock_root/build_artifacts/soupsieve_1597680516047/work
sympy @ file:///home/conda/feedstock_root/build_artifacts/sympy_1610127369423/work
terminado @ file:///home/conda/feedstock_root/build_artifacts/terminado_1609794172745/work
testpath==0.4.4
tornado @ file:///home/conda/feedstock_root/build_artifacts/tornado_1610094706440/work
traitlets @ file:///home/conda/feedstock_root/build_artifacts/traitlets_1602771532708/work
urllib3 @ file:///home/conda/feedstock_root/build_artifacts/urllib3_1611695416663/work
wcwidth @ file:///home/conda/feedstock_root/build_artifacts/wcwidth_1600965781394/work
webencodings==0.5.1
widgetsnbextension @ file:///home/conda/feedstock_root/build_artifacts/widgetsnbextension_1605475534911/work
zipp @ file:///home/conda/feedstock_root/build_artifacts/zipp_1603668650351/work
  • python -c "import einsteinpy.testing; einsteinpy.testing.test()"
# Paste your output here:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'einsteinpy.testing'

🎯 Goal

I'm trying to make the notebooks more interactive with ipywidgets so that it is more clear what is going on and how the output changes with a change in variable. Other people will be able to use these to learn these abstract topics

💡 Possible solutions

📋 Steps to solve the problem

  • Comment below about what you’ve started working on.
  • Add, commit, push your changes
  • Submit a pull request and add this in comments - Addresses #<put issue number here>
  • Ask for a review in comments section of pull request
  • Celebrate your contribution to this project 🎉

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:65 (35 by maintainers)

github_iconTop GitHub Comments

1reaction
paulobarrera14commented, Mar 17, 2021

My professor got it up and running. I did have another question with your geodesic command. I’m currently using ipywidgets to make a slider for spin precession on the frame dragging notebook but whenever I put in an a that isn’t .99 it gives me a plot that looks like this

image

1reaction
paulobarrera14commented, Mar 16, 2021

Just tried the “Visualizing Event Horizon and Ergosphere (Singularities) of Kerr Metric or Black Hole” and it worked

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: __init__() got an unexpected keyword argument 'i'
Instead of using i parameter, use n_neighbors instead. for i in n_s: clf = KNeighborsClassifier(n_neighbors=i).
Read more >
init__() got an unexpected keyword argument 'max_iter'?
TypeError : init() got an unexpected keyword argument 'max_iter'. I m running the linear regression code in Community edition. Google says reinstall --....
Read more >
TypeError: __init__() got an unexpected keyword argument ...
Hello, I'm getting an error when the model gets evaluated and it try to export. I believe the only thing I changed since...
Read more >
Flask got an unexpected keyword argument path
8', TypeError: init() got an unexpected keyword argument 'websocket'` if try ... For our purposes, a metric is an observed value of a...
Read more >
typeerror: __init__() got an unexpected keyword ... - You.com
from django import forms from .models import MyModel class MyForm(forms.ModelForm): class Meta: model = MyModel def __init__(self, user_id, *args, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found