Skip to content

python setup.py build_ext error: Cython.Compiler.Errors.CompileError: parse_bed.pyx #81

@bensutherland

Description

@bensutherland

I am having trouble installing fastStructure (cloned today) on a MacOS (Ventura 13.5). I've followed all instructions from the README, and have installed all necessary dependencies. I can give details if needed, or if that would help please let me know.

The crash occurs when trying to compile the main cython scripts.
Error message:

$ python setup.py build_ext --inplace
running build_ext
Compiling parse_bed.pyx because it changed.
[1/1] Cythonizing parse_bed.pyx
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Compiler/Main.py:381:
FutureWarning: Cython directive 'language_level' not set, using '3str' for now
(Py3). This has changed from earlier releases! File:
/Users/bens/programs/fastStructure/parse_bed.pyx
  tree = Parsing.p_module(s, pxd, full_module_name)

Error compiling Cython file:
------------------------------------------------------------
...
    checkB = bin(struct.unpack('<B', line)[0])[2:].zfill(8)[::-1]
    line = handle.read(1)
    checkC = bin(struct.unpack('<B', line)[0])[2:].zfill(8)[::-1]

    if checkA!="00110110" or checkB!="11011000":
        print "This is not a valid bed file"
              ^
------------------------------------------------------------

parse_bed.pyx:47:14: Syntax error in simple statement list
Traceback (most recent call last):
  File "setup.py", line 15, in <module>
    ext_modules = ext_modules
  File
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py",
line 151, in setup
    dist.run_commands()
  File
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py",
line 953, in run_commands
    self.run_command(cmd)
  File
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py",
line 972, in run_command
    cmd_obj.run()
  File
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/build_ext.py",
line 340, in run
    self.build_extensions()
  File
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/build_ext.py",
line 449, in build_extensions
    self.build_extension(ext)
  File
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Distutils/build_ext.py",
line 131, in build_extension
    ext,force=self.force, quiet=self.verbose == 0, **options
  File
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Build/Dependencies.py",
line 1154, in cythonize
    cythonize_one(*args)
  File
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Cython/Build/Dependencies.py",
line 1321, in cythonize_one
    raise CompileError(None, pyx_file)
Cython.Compiler.Errors.CompileError: parse_bed.pyx

Some details:
python
/Library/Frameworks/Python.framework/Versions/2.7/bin/python2
GSL-2.7 installed from gnu.org
numpy installed by pip
Cython installed by pip
/Library/Frameworks/Python.framework/Versions/2.7/bin/Cython

Thank you for any help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions