Trouble installing nmrglue on Linux

36 views
Skip to first unread message

Carsten Friedrich

unread,
Feb 17, 2017, 12:32:57 AM2/17/17
to nmrglue-discuss
I tried to install nrmglue on Linux. Installation seems to work, but nmrglue itself does not.
E.g. running the first 2 lines from the tutorial (with test.fid in the same directory):

import nmrglue as ng
dic,data = ng.pipe.read("test.fid")

results in:

ubuntu@nmr3:~$ python
Python 2.7.6 (default, Oct 26 2016, 20:30:19)
[GCC 4.8.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import nmrglue as ng
>>> dic,data = ng.pipe.read("test.fid")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/nmrglue/fileio/pipe.py", line 531, in read
    return read_2D(filename)
  File "/usr/local/lib/python2.7/dist-packages/nmrglue/fileio/pipe.py", line 625, in read_2D
    data = unappend_data(data)
  File "/usr/local/lib/python2.7/dist-packages/nmrglue/fileio/pipe.py", line 1497, in unappend_data
    return np.array(data[..., :h] + data[..., h:] * 1.j, dtype="complex64")
TypeError: slice indices must be integers or None or have an __index__ method

Trying other things results in similar errors, e.g:


Traceback (most recent call last):

  File "nmr.py", line 14, in <module>

    dic, data = ng.fileio.bruker.read(bruker_dir)

  File "/usr/local/lib/python2.7/dist-packages/nmrglue/fileio/bruker.py", line 327                                                             , in read

    null, data = read_binary(f, shape=shape, cplex=cplex, big=big)

  File "/usr/local/lib/python2.7/dist-packages/nmrglue/fileio/bruker.py", line 996                                                             , in read_binary

    return dic, data.reshape(shape)

TypeError: 'float' object cannot be interpreted as an index


My environment:
Ubuntu 14.04
Python 2.7.6
Scipy installed with: sudo apt-get install python-numpy python-scipy python-matplotlib ipython ipython-notebook python-pandas python-sympy python-nose

Cheers,
Carsten

Jonathan Helmus

unread,
Feb 17, 2017, 4:51:35 PM2/17/17
to nmrglue...@googlegroups.com
Carsten,

    Sorry to hear you are having issue with nmrglue.  I believe the cause of the issue is the version of NumPy you have installed.  The newest version of NumPy (1.12) no longer allows floats to be used to index arrays.  This was allowed in previous versions of NumPy and nmrglue allows some indices to be expressed as floats where they should be integers.  I'll add this to the GitHub issue tracker and try to fix it the next time I have some free time to work on nmrglue.

    In the mean time if you can downgrade to NumPy 1.11, nmrglue should work, although you will see some DeprecationWarnings about the use of non-integers. 
   
    If you used pip to install numpy it should be possible to downgrade using the following:

    pip uninstall numpy
    pip install numpy=1.11

Cheers,

    - Jonathan Helmus
--
You received this message because you are subscribed to the Google Groups "nmrglue-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nmrglue-discu...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Carsten Friedrich

unread,
Feb 19, 2017, 6:19:20 PM2/19/17
to nmrglue...@googlegroups.com
Hi Jonathan,

thanks for your fast reply. The workaround downgrading to numpy 1.11 seems to work.

Cheers,
Carsten

You received this message because you are subscribed to a topic in the Google Groups "nmrglue-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/nmrglue-discuss/N4BplBR90QQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to nmrglue-discu...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages