sixty-north / segpy

A Python package for reading and writing SEG Y files.
Other
102 stars 54 forks source link

install fails on python 2 #28

Closed weiliu620 closed 8 years ago

weiliu620 commented 8 years ago

I git cloned the code and built it successfully. But when I 'python setup.py install --user', I got errors: ========= errors ==================== File "build/bdist.linux-x86_64/egg/segpy/binary_reel_header.py", line 5 class BinaryReelHeader(metaclass=FormatMeta): ^ SyntaxError: invalid syntax ...... byte-compiling build/bdist.linux-x86_64/egg/segpy/toolkit.py to toolkit.pyc File "build/bdist.linux-x86_64/egg/segpy/toolkit.py", line 93 raise ValueError("Could not decode data sample format {!r}".format(dsf)) from e ^ SyntaxError: invalid syntax

byte-compiling build/bdist.linux-x86_64/egg/segpy/datatypes.py to datatypes.pyc byte-compiling build/bdist.linux-x86_64/egg/segpy/reader.py to reader.pyc File "build/bdist.linux-x86_64/egg/segpy/reader.py", line 801 print(self._character * (required - existing), end='') ^ SyntaxError: invalid syntax

byte-compiling build/bdist.linux-x86_64/egg/segpy/init.py to init.pyc byte-compiling build/bdist.linux-x86_64/egg/segpy/textual_reel_header.py to textual_reel_header.pyc byte-compiling build/bdist.linux-x86_64/egg/segpy/util.py to util.pyc File "build/bdist.linux-x86_64/egg/segpy/util.py", line 24 yield from zip(a, b) ^ SyntaxError: invalid syntax

byte-compiling build/bdist.linux-x86_64/egg/segpy/trace_header.py to trace_header.pyc File "build/bdist.linux-x86_64/egg/segpy/trace_header.py", line 5 class TraceHeaderRev0(metaclass=FormatMeta): ^ SyntaxError: invalid syntax

byte-compiling build/bdist.linux-x86_64/egg/segpy/header.py to header.pyc File "build/bdist.linux-x86_64/egg/segpy/header.py", line 36 .format(keyword, self.class.name)) from e ^ SyntaxError: invalid syntax

byte-compiling build/bdist.linux-x86_64/egg/segpy/types.py to types.pyc byte-compiling build/bdist.linux-x86_64/egg/segpy/catalog.py to catalog.pyc File "build/bdist.linux-x86_64/egg/segpy/catalog.py", line 271 yield from ((i, j) for i in self._i_range for j in self._j_range) ^ SyntaxError: invalid syntax

byte-compiling build/bdist.linux-x86_64/egg/segpy/dataset.py to dataset.pyc File "build/bdist.linux-x86_64/egg/segpy/dataset.py", line 4 class Dataset(metaclass=ABCMeta): ^ SyntaxError: invalid syntax

byte-compiling build/bdist.linux-x86_64/egg/segpy/writer.py to writer.pyc creating build/bdist.linux-x86_64/egg/EGG-INFO copying segpy.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO copying segpy.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying segpy.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying segpy.egg-info/entry_points.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying segpy.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying segpy.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO zip_safe flag not set; analyzing archive contents... creating 'dist/segpy-2.0.0a3-py2.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it removing 'build/bdist.linux-x86_64/egg' (and everything under it) Processing segpy-2.0.0a3-py2.7.egg Removing /home/weiliu/.local/lib/python2.7/site-packages/segpy-2.0.0a3-py2.7.egg Copying segpy-2.0.0a3-py2.7.egg to /home/weiliu/.local/lib/python2.7/site-packages segpy 2.0.0a3 is already the active version in easy-install.pth ============ end of errors ================ I'm using python 2.7.6 on Ubuntu 14.04 64 bit. Anything I can try?

Would be great to have a working python library for segy data.

rob-smallshire commented 8 years ago

Segpy does not support legacy Python 2. Segpy is only supported on Python 3.3+.

If Python 2 support is important to you you can consider contracting the developers of Segpy, Sixty North AS http://sixty-north.com, to backport Segpy to Python 2.7. Otherwise, we recommend you use a more modern Python version with Segpy.