[ase-users] ASE on Windows
Jens Jørgen Mortensen
jensj at fysik.dtu.dk
Mon Oct 11 08:55:02 CEST 2010
On Mon, 2010-09-13 at 14:00 +0100, Andrew Mark wrote:
> Hi,
>
>
> I had some trouble installing ASE on a windows machine. It seems that
> a few important routines are written in a way that work on unix, but
> not windows. I made some modifications that got things to work for me.
> I'm new to python so I don't know what larger implications these
> modifications might have. I regard them as quick and dirty hacks, but
> they seem to be working for me. I post them here in the hopes that
> they will be useful to others, and that users with more Python
> experience might suggest better solutions.
Thanks for doing this - It's great with feedback like this! Since it
doesn't seem that anyone has time right now to look into this, I've
opened a ticket with a link to this email, so that your modifications
don't get lost.
https://trac.fysik.dtu.dk/projects/ase/ticket/62
Thanks,
Jens Jørgen
>
> How to install ASE on Windows:
>
>
> 1) Download the tarball and unzip it to a temporary directory
>
>
> 2) The installer script svnversion_io.py makes calls that fail under
> windows, but you seem to be able to comment it out. Edit the file
> setup.py and modify the lines starting at 45 to read:
> # Get the current version number:
> #execfile('ase/svnversion_io.py') # write ase/svnversion.py and get
> svnversion
> execfile('ase/version.py') # get version_base
> #if svnversion:
> # version = version_base + '.' + svnversion
> #else:
> version = version_base
>
>
> 3) From the command prompt in your temporary directory run "python
> setup.py install" to install ase.
>
>
> 4) If you like, you can run the testsuite in the same directory with
> "python Tools\testase.py". Most of the tests will return OK. But 6
> will return errors. I don't know why. The testsuite fails to create a
> log.
>
>
> 5) You now have a more or less working version of ase. The main
> remaining difficulty is that the gui ag doesn't work. This is because
> windows doesn't run python scripts as executables. To fix this, find
> the file \tools\ag (no extension) and copy it to c:\python26\Lib
> \site-packages\ase. You will have to adjust the path depending on the
> location of your python package.
>
>
> 6) Find the file c:\python26\Lib\site-packages\ase\visualize
> \__init__.py. You will need to make three modifications at the
> beginning, middle, and end of this file:
>
>
> a) At the top of the file, after the other import statements, add the
> line "from time import sleep".
>
>
> b) Find the line that reads "format = 'traj'". Modify the following
> lines so that they read:
>
>
> ag_dir='c:\\python26\\Lib\\site-packages\\ase\\'
> if repeat is None:
> # command = 'ag'
> command = 'python %sag' % ag_dir
> else:
> # command = 'ag --repeat=%d,%d,%d' % tuple(repeat)
> command = 'python %sag --repeat=%d,%d,%d' % ag_dir,
> tuple(repeat)
> repeat = None
>
>
> The first line should point to the directory where you copied ag
>
>
> c) Comment out the last line of the file and add:
>
>
> #os.system('(sleep 60; rm %s) &' % filename)
> sleep(1)
> os.remove(filename)
>
>
> Check that everything works by running the tutorials in the ase
> manual.
>
>
> Best of luck,
>
>
> -AM
>
>
> _______________________________________________
> ase-users mailing list
> ase-users at listserv.fysik.dtu.dk
> https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users
More information about the ase-users
mailing list