0

Installed BioPython 1.70 on a machine that has python 2.7.14. Want to validate setup by running tests.

$ python run_tests.py
Traceback (most recent call last):
  File "run_tests.py", line 148, in <module>
    if is_numpy():
  File "run_tests.py", line 63, in is_numpy
    if is_pypy():
  File "run_tests.py", line 54, in is_pypy
    if platform.python_implementation() == 'PyPy':
  File "/home/foo/python/lib/python2.7/platform.py", line 1460, in python_implementation
    return _sys_version()[0]
  File "/home/foo/python/lib/python2.7/platform.py", line 1422, in _sys_version
    repr(sys_version))
ValueError: failed to parse CPython sys.version: '2.7.14 |Anaconda, Inc.| (default, Dec  7 2017, 17:05:42) \n[GCC 7.2.0]'

Do I have to edit /home/foo/python/lib/python2.7/platform.py if I want to run any tests?

Greg Dougherty
  • 3,281
  • 8
  • 35
  • 58
  • 1
    You can change [this block](https://github.com/biopython/biopython/blob/master/Tests/run_tests.py#L53) instead to also trap the `ValueError` exception. Also see [this related](https://stackoverflow.com/questions/34145861/valueerror-failed-to-parse-cpython-sys-version-after-using-conda-command) question. – metatoaster Feb 17 '18 at 02:51

1 Answers1

0

Turns out the problem was my PYTHONPATH.

~/anaconda2/lib/python2.7 needs to be first. I had ~/lib/python before it, so it was using the wrong platform.py file.

Greg Dougherty
  • 3,281
  • 8
  • 35
  • 58