Input:
tr = str1[0]
tr.times("matplotlib")
Error message:
Traceback (most recent call last):
File "<ipython-input-16-587655343cda>", line 1, in <module>
b = tr.times('matplotlib')
TypeError: times() takes exactly 1 argument (2 given)
Documentation:
link
Other documentation without the inputs:
link
Examples of what should happen given in:
link
Setup:
Obspy version: 0.10.2
Python version: 2.7
Platform: Linux, Ubuntu 15.10
Installation: Anaconda
You need to update to the latest ObsPy master - this feature is not yet part of the latest released version (beside you are also using an outdated version).
Doc for 1.0.1: http://docs.obspy.org/packages/autogen/obspy.core.trace.Trace.times.html
Doc for master: http://docs.obspy.org/master/packages/autogen/obspy.core.trace.Trace.times.html
Could you guide me how to do that? I tried an update through Anaconda:
conda update obspy
and that told me I didn't need to update.
I then followed the method here with:
conda config --add channels obspy
conda create -n obspy1.01 python=2.7
Which downloads some stuff but after restarting Spyder, the function still fails and it still tells me the version is 0.10.2. Is there some other way to update it / what version am I looking for?
Thanks in advance
You'll have to uninstall obspy and install from git:
$ conda uninstall obspy
$ cd /place/to/where/you/put/code
$ git clone https://github.com/obspy/obspy.git
$ cd obspy
$ conda install pip
$ pip install -v -e .
This worked great, thanks!
For others who comes across this, the /place/to/where/you/put/code, if you're using anaconda, is likely to be:
~/anaconda2/lib/python2.7/site-packages
I actually intended this to be the place where you keep around source codes. If you want to install to the site-packages directory you can just do pip install -v . without the -e. The -e will create an editable installation meaning it will only place a file pointer to site-packages. Thus any time you git pull in the repository, it will also update your ObsPy installation.
Ahh okay - I wondered how people did that! Thanks again for the clear explanations (it's a rare thing when it come to linux module installations)