Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests fail: No module named ext #27

Closed
yurivict opened this issue Sep 14, 2018 · 6 comments
Closed

Tests fail: No module named ext #27

yurivict opened this issue Sep 14, 2018 · 6 comments

Comments

@yurivict
Copy link

Tests fail in the FreeBSD port:

$ nosetests molmod
E
======================================================================
ERROR: Failure: ImportError (No module named ext)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/nose/loader.py", line 418, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/local/lib/python2.7/site-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/local/lib/python2.7/site-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/usr/ports/science/py-molmod/work-py27/molmod-1.4.4/molmod/__init__.py", line 67, in <module>
    from molmod.similarity import *
  File "/usr/ports/science/py-molmod/work-py27/molmod-1.4.4/molmod/similarity.py", line 45, in <module>
    from molmod.ext import similarity_table_labels, similarity_table_distances, \
ImportError: No module named ext

----------------------------------------------------------------------
Ran 1 test in 0.002s

@tovrstra
Copy link
Member

Thanks for the bug report. This probably means the Cython extension failed to build properly. I will need some more info to help you:

  • Which version of molmod do you use?
  • Can you paste the output of your python setup.py install ... command?

@yurivict
Copy link
Author

Which version of molmod do you use?

1.4.4

Can you paste the output of your python setup.py install ... command?

https://people.freebsd.org/~yuri/py-molmod-install.log

@tovrstra
Copy link
Member

Can you try running nosetests outside the source tree? E.g. as follows in bash

(cd; nosetests molmod)

@yurivict
Copy link
Author

When tun in other directories they print this:

$ nosetests molmod
.............../usr/local/lib/python2.7/site-packages/molmod/utils.py:228: FutureWarning: Conversion of the second argument of issubdtype from `int` to `np.signedinteger` is deprecated. In future, it will be treated as `np.int64 == np.dtype(int).type`.
  if not np.issubdtype(value.dtype, self.npdtype):
/usr/local/lib/python2.7/site-packages/molmod/utils.py:228: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  if not np.issubdtype(value.dtype, self.npdtype):
/usr/local/lib/python2.7/site-packages/molmod/utils.py:228: FutureWarning: Conversion of the second argument of issubdtype from `bool` to `np.generic` is deprecated. In future, it will be treated as `np.bool_ == np.dtype(bool).type`.
  if not np.issubdtype(value.dtype, self.npdtype):
................................S.S.S.....EEEEEEEEEEEEEEEEEE..................................................S......................S..............................................................................................................................S....S.......................
======================================================================
ERROR: molmod.test.test_examples.test_example_000_a
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/usr/local/lib/python2.7/site-packages/molmod/test/test_examples.py", line 86, in test_example_000_a
    check_example(__name__, "000_units", "a_reaction.py", [])
  File "/usr/local/lib/python2.7/site-packages/molmod/test/test_examples.py", line 76, in check_example
    cwd=dntmp, env=env)
  File "/usr/local/lib/python2.7/subprocess.py", line 394, in __init__
    errread, errwrite)
  File "/usr/local/lib/python2.7/subprocess.py", line 1047, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

======================================================================
ERROR: molmod.test.test_examples.test_example_000_b
.....
.....

@tovrstra
Copy link
Member

That's already better.

There seem to be issues with running the examples in a temporary directory, i.e. the example does not seem to get copied properly. It works for me, so this is specific for your system. Are you running out of disk space in /tmp? If not, you need to figure out what is going on the temporary directory:

  1. Add a line to test_examples.py before line 76 to print out the name of the temporary dir and the files it should copy, print(dntmp, fn_script, fns_data).

  2. Check after running nosetests if those files are there. They should be. If not, something is going wrong in lines 58-67, but I cannot guess what that would be at the moment.

@tovrstra
Copy link
Member

@yurivict There hasn't been any activity here for a while. If you want to get back to this, feel free to reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants