theochem / horton

HORTON: Helpful Open-source Research TOol for N-fermion systems
http://theochem.github.io/horton/
GNU General Public License v3.0
94 stars 40 forks source link

Conda install on Travis #284

Closed erikkjellgren closed 6 years ago

erikkjellgren commented 6 years ago

I have a project were I utilize Horton, but when I try to use automated testing with Travis CI on github, it seem to fail. I set up my travis as:

language: python
python:
  - 2.7

os: linux

install:
  - sudo apt-get update
  - wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh;
  - bash miniconda.sh -b -p $HOME/miniconda
  - export PATH="$HOME/miniconda/bin:$PATH"
  - hash -r
  - conda config --set always_yes yes --set changeps1 no
  - conda update -q conda
  - conda info -a
  - conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION
  - source activate test-environment
  - conda install numpy scipy pytest numba dill sh
  - conda install -c pyqc horton
  - pip install python-coveralls pytest-cov

script:
  - if [[ $TRAVIS_PYTHON_VERSION == 2.7 ]];
    then pytest -vv data/testfiles/test_*.py --cov;
    else pytest -vv data/testfiles/test_*.py;
    fi

after_success:
  - if [[ $TRAVIS_PYTHON_VERSION == 2.7 ]];
    then coveralls;
    fi

notifications:
   email: false

When I run test that imports Horton I get the following error:

_______________ ERROR collecting data/testfiles/test_program.py ________________

ImportError while importing test module '/home/travis/build/Melisius/propertyfit/data/testfiles/test_program.py'.

Hint: make sure your test modules/packages have valid Python names.

Traceback:

../../../miniconda/envs/test-environment/lib/python2.7/site-packages/_pytest/python.py:403: in _importtestmodule

    mod = self.fspath.pyimport(ensuresyspath=importmode)

../../../miniconda/envs/test-environment/lib/python2.7/site-packages/py/_path/local.py:668: in pyimport

    __import__(modname)

../../../miniconda/envs/test-environment/lib/python2.7/site-packages/_pytest/assertion/rewrite.py:212: in load_module

    py.builtin.exec_(co, mod.__dict__)

data/testfiles/test_program.py:11: in <module>

    from propertyfit.structures import structure, constraints

propertyfit/structures.py:4: in <module>

    import horton

../../../miniconda/envs/test-environment/lib/python2.7/site-packages/horton/__init__.py:33: in <module>

    from horton.part import *

../../../miniconda/envs/test-environment/lib/python2.7/site-packages/horton/part/__init__.py:30: in <module>

    from horton.part.mulliken import *

../../../miniconda/envs/test-environment/lib/python2.7/site-packages/horton/part/mulliken.py:26: in <module>

    from horton.gbasis.cext import get_shell_nbasis

../../../miniconda/envs/test-environment/lib/python2.7/site-packages/horton/gbasis/__init__.py:24: in <module>

    from horton.gbasis.cext import *

E   ImportError: /home/travis/miniconda/envs/test-environment/lib/python2.7/site-packages/horton/gbasis/cext.so: undefined symbol: cblas_daxpy

It seems like it can import "most" Horton, but not the file "cext.so". Is there a requirement for Horton that does not get install by the "conda install -c pyqc horton"?

matt-chan commented 6 years ago

Ah the version of Horton in the pyqc channel is pretty old. Try using the one in the theochem channel. That should be up to date. There shouldn't be anything broken in the pyqc one, but it's been at least a year since we tested that one. On Tue, Dec 19, 2017 at 2:51 PM Erik Kjellgren notifications@github.com wrote:

I have a project were I utilize Horton, but when I try to use automated testing with Travis CI on github, it seem to fail. I set up my travis as:

language: python python:

  • 2.7

os: linux

install:

  • sudo apt-get update
  • wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh;
  • bash miniconda.sh -b -p $HOME/miniconda
  • export PATH="$HOME/miniconda/bin:$PATH"
  • hash -r
  • conda config --set always_yes yes --set changeps1 no
  • conda update -q conda
  • conda info -a
  • conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION
  • source activate test-environment
  • conda install numpy scipy pytest numba dill sh
  • conda install -c pyqc horton
  • pip install python-coveralls pytest-cov

script:

  • if [[ $TRAVIS_PYTHONVERSION == 2.7 ]]; then pytest -vv data/testfiles/test.py --cov; else pytest -vv data/testfiles/test_.py; fi

after_success:

  • if [[ $TRAVIS_PYTHON_VERSION == 2.7 ]]; then coveralls; fi

notifications: email: false

When I run test that imports Horton I get the following error:

_ ERROR collecting data/testfiles/test_program.py __

ImportError while importing test module '/home/travis/build/Melisius/propertyfit/data/testfiles/test_program.py'.

Hint: make sure your test modules/packages have valid Python names.

Traceback:

../../../miniconda/envs/test-environment/lib/python2.7/site-packages/_pytest/python.py:403: in _importtestmodule

mod = self.fspath.pyimport(ensuresyspath=importmode)

../../../miniconda/envs/test-environment/lib/python2.7/site-packages/py/_path/local.py:668: in pyimport

__import__(modname)

../../../miniconda/envs/test-environment/lib/python2.7/site-packages/_pytest/assertion/rewrite.py:212: in load_module

py.builtin.exec_(co, mod.__dict__)

data/testfiles/test_program.py:11: in

from propertyfit.structures import structure, constraints

propertyfit/structures.py:4: in

import horton

../../../miniconda/envs/test-environment/lib/python2.7/site-packages/horton/init.py:33: in

from horton.part import *

../../../miniconda/envs/test-environment/lib/python2.7/site-packages/horton/part/init.py:30: in

from horton.part.mulliken import *

../../../miniconda/envs/test-environment/lib/python2.7/site-packages/horton/part/mulliken.py:26: in

from horton.gbasis.cext import get_shell_nbasis

../../../miniconda/envs/test-environment/lib/python2.7/site-packages/horton/gbasis/init.py:24: in

from horton.gbasis.cext import *

E ImportError: /home/travis/miniconda/envs/test-environment/lib/python2.7/site-packages/horton/gbasis/cext.so: undefined symbol: cblas_daxpy

It seems like it can import "most" Horton, but not the file "cext.so". Is there a requirement for Horton that does not get install by the "conda install -c pyqc horton"?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/theochem/horton/issues/284, or mute the thread https://github.com/notifications/unsubscribe-auth/AA_-NZ6H1Qp3VUxBdCgQE2nZV880_o9aks5tCBPKgaJpZM4RHeLd .

-- Matt

Sent from my phone

erikkjellgren commented 6 years ago

It is working now. I noticed that it downgraded cython. Might have to do with this.

Thanks for your assistance