Closed PeaWagon closed 6 years ago
Could this be the same issue as reported here: lucasb-eyer/pydensecrf#28. If yes, the solution would be to install libgcc in conda:
conda install libgcc
There could be other reasons for this, so please let us know if it worked. Mixing up conda compilers with the ones from your Linux distribution is often a source of confusion.
Okay I think that worked for the conda version. Thanks.
I'm still trying to get the github version to work though. When I try to import horton from the github repository that I forked, I get the following error:
(py27) jgarne01@oryx:~/ExtraDrive/githubcode/horton$ python
Python 2.7.13 |Anaconda custom (64-bit)| (default, Dec 20 2016, 23:09:15)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
>>> import horton
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "horton/__init__.py", line 28, in <module>
from horton.cext import *
ImportError: No module named cext
When I try to import horton anywhere else, it works. This version of horton is listed in my "conda list".
horton 2.1.0 <pip>
Here are the tests that I ran using nosetests:
======================================================================
ERROR: horton.part.test.test_proatomdb.test_compute_radii
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jgarne01/anaconda3/envs/py27/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/home/jgarne01/anaconda3/envs/py27/lib/python2.7/site-packages/horton/part/test/test_proatomdb.py", line 128, in test_compute_radii
record = padb.get_record(6, 0)
File "/home/jgarne01/anaconda3/envs/py27/lib/python2.7/site-packages/horton/part/proatomdb.py", line 358, in get_record
return self._map[(number, charge)]
KeyError: (6, 0)
======================================================================
ERROR: horton.part.test.test_proatomdb.test_get_spline
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jgarne01/anaconda3/envs/py27/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/home/jgarne01/anaconda3/envs/py27/lib/python2.7/site-packages/horton/part/test/test_proatomdb.py", line 172, in test_get_spline
spline = padb.get_spline(6)
File "/home/jgarne01/anaconda3/envs/py27/lib/python2.7/site-packages/horton/part/proatomdb.py", line 597, in get_spline
rho, deriv = self.get_rho(number, parameters, combine, do_deriv=True)
File "/home/jgarne01/anaconda3/envs/py27/lib/python2.7/site-packages/horton/part/proatomdb.py", line 547, in get_rho
record = self.get_record(number, charge)
File "/home/jgarne01/anaconda3/envs/py27/lib/python2.7/site-packages/horton/part/proatomdb.py", line 358, in get_record
return self._map[(number, charge)]
KeyError: (6, 0)
======================================================================
FAIL: horton.part.test.test_proatomdb.test_db_basics
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jgarne01/anaconda3/envs/py27/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/home/jgarne01/anaconda3/envs/py27/lib/python2.7/site-packages/horton/part/test/test_proatomdb.py", line 32, in test_db_basics
assert padb.get_numbers() == [1, 8]
AssertionError
======================================================================
FAIL: horton.part.test.test_proatomdb.test_io_group
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jgarne01/anaconda3/envs/py27/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/home/jgarne01/anaconda3/envs/py27/lib/python2.7/site-packages/horton/part/test/test_proatomdb.py", line 103, in test_io_group
assert padb1.size == 5
AssertionError
======================================================================
FAIL: horton.part.test.test_proatomdb.test_io_filename
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jgarne01/anaconda3/envs/py27/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/home/jgarne01/anaconda3/envs/py27/lib/python2.7/site-packages/horton/part/test/test_proatomdb.py", line 116, in test_io_filename
assert keys == [(1, 0), (6, 0), (6, 1)]
AssertionError
======================================================================
FAIL: horton.scripts.test.test_atomdb.test_plot_atoms
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jgarne01/anaconda3/envs/py27/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/home/jgarne01/anaconda3/envs/py27/lib/python2.7/site-packages/horton/scripts/test/test_atomdb.py", line 209, in test_plot_atoms
check_files(dn, fns)
File "/home/jgarne01/anaconda3/envs/py27/lib/python2.7/site-packages/horton/scripts/test/common.py", line 39, in check_files
assert os.path.isfile(os.path.join(dn, fn)), "Missing %s" % fn
AssertionError: Missing dens_001__h.png
----------------------------------------------------------------------
Ran 979 tests in 205.954s
FAILED (SKIP=1, errors=2, failures=4)
You need to take the step explained here, in case you work with the version from git: http://theochem.github.io/horton/2.1.0/tech_dev_git.html#reference-atoms
Also, when you just get the version from git, the c extensions still have to be built, just like when you install from source. This is why you get the error ImportError: No module named cext
. You either do a complete install of the git version (and uninstall the other version first) or you can do an in-place build with ./setup.py build_ext -i
. Also keep in mind that the current latest version from git works with libxc-3.0.0.
In any case, I would strongly recommend to work only with one version of HORTON at a time on your system. Having two versions, like you do now, may give you a lot of confusion error messages.
Okay, I have removed all of the versions of horton and just installed the github version. I can import horton from anywhere except the horton github directory (in that case, it gives the ImportError: No module named cext
). What is the expected behaviour when importing from the horton directory? Should it work or do I have to something extra?
Never mind my last comment. It seems that when I installed horton without the user argument it put my files in the correct anaconda environment directory. You can close this issue now if you'd like.
Both observations seem to be the normal behavior. (i) When you import a package in Python, it will first look for that package in the current directory, which in this case does not work because the cext.so file is not there. (ii) The --user
option should indeed not be used when you want to install into conda or virtualenv.
Hi guys,
I am trying to install horton on my computer (ubuntu 16.04). I am using a python 2.7 anaconda environment. However, I get an error when I try to import horton. Here is my install output:
Here is the error that I get when I try to import horton:
Any help is appreciated.
Thanks, Jen