[ase-users] The error of ``python -m ase.test''
Hongyi Zhao
hongyi.zhao at gmail.com
Wed Mar 23 00:48:02 CET 2016
2016-03-21 23:47 GMT+08:00 Hongyi Zhao <hongyi.zhao at gmail.com>:
> 2016-03-21 14:25 GMT+08:00 Jens Jørgen Mortensen <jensj at fysik.dtu.dk>:
>> On 03/20/2016 08:35 AM, Hongyi Zhao wrote:
>>>
>>> Hi all,
>>>
>>> I installed the lastest stable version of ase and the do the following
>>> testing:
>>>
>>> $ python -m ase.test
>>>
>>> Then I meet the following errors:
>>>
>>> ======================================================================
>>> ERROR: mopac/mopac_cmdline.py
>>> ----------------------------------------------------------------------
>>> Traceback (most recent call last):
>>> File
>>> "/home/werner/anaconda2/lib/python2.7/site-packages/ase/test/__init__.py",
>>> line 54, in testfile
>>> {'display': self.display})
>>> File
>>> "/home/werner/anaconda2/lib/python2.7/site-packages/ase/test/mopac/mopac_cmdline.py",
>>> line 3, in <module>
>>> from ase.calculators.mopac import Mopac
>>> ImportError: cannot import name Mopac
>>>
>>> ----------------------------------------------------------------------
>>> Ran 167 tests in 44.635s
>>>
>>> FAILED (errors=1)
>>>
>>>
>>> Furthermore, I tried the latest develop git version, and meet the same
>>> errors.
>>>
>>> Any hints on this issue?
>>
>>
>> The file:
>>
>>
>> /home/werner/anaconda2/lib/python2.7/site-packages/ase/test/mopac/mopac_cmdline.py
>>
>> is not part of the latest stable release or the latest development version.
>> It looks like you running some mix of an older version of ASE and a newer
>> one. How did you install ASE? Did you set your $PATH and $PYTHONPATH?
>
> Thanks for pointing this out. For my case, I use anaconda and the ase
> was installed by the following commands:
>
> $ conda install -c https://conda.anaconda.org/jochym python-ase
>
> and then by
>
> $ pip install --upgrade ase
>
> Which make a mixed stuff for my case.
>
> I reinstalled the pip version of ase and removed the conda-repo
> version of ase. And it solve the issue.
>
> As for the lastest git version of ase, I use the following method to install:
>
> $ git clone https://gitlab.com/ase/ase.git ase.git
> $ cd ase.git
> $ pip install .
>
> And this way will let me using the git version of ase within anaconda
> without setting the PATH and PYTHONPATH environment variables
> manually.
>
> Furthermore, I also tried the method said here:
> https://wiki.fysik.dtu.dk/ase/install.html, i.e., the following steps:
>
> --------------------------------------
> Add ~/ase to your PYTHONPATH environment variable and add ~/ase/tools
> to PATH (assuming ~/ase is where your ASE folder is).
Sorry for my misunderstanding on the above notes. For my case, they
should be the following:
export PYTHONPATH=ase.git:$PYTHONPATH
export PATH=ase.git/tools:$PATH
And this will do the trick. But ``pip install'' method will do some
byte compiling on the source code, so it maybe faster than the
non-compiling method.
Regards
>
>
> Environment variables
>
> PATH
>
> Colon-separated paths where programs can be found.
>
> PYTHONPATH
>
> Colon-separated paths where Python modules can be found.
>
> Set these permanently in your ~/.bashrc file:
>
> $ export PYTHONPATH=~/ase:$PYTHONPATH
> $ export PATH=~ase/tools:$PATH
> --------------------------------------
>
> But, this method will fail for my case, I cann't figure out the reason.
>
> Regards
>
>>
>> Jens Jørgen
>>
>>
>>
>>>
>>> Regards
>>
>>
>
>
>
> --
> Hongyi Zhao <hongyi.zhao at gmail.com>
> Xinjiang Technical Institute of Physics and Chemistry
> Chinese Academy of Sciences
> GnuPG DSA: 0xD108493
--
Hongyi Zhao <hongyi.zhao at gmail.com>
Xinjiang Technical Institute of Physics and Chemistry
Chinese Academy of Sciences
GnuPG DSA: 0xD108493
More information about the ase-users
mailing list