Difference between revisions of "Installation windows Python x86-32 Visual Studio Express for Windows Desktop"

From relax wiki
Jump to navigation Jump to search
Line 27: Line 27:
 
Make a folder '''own''' in '''C:\WinPython27\WinPython-32bit-2.7.x\scripts''' and <br>
 
Make a folder '''own''' in '''C:\WinPython27\WinPython-32bit-2.7.x\scripts''' and <br>
 
copy '''C:\WinPython27\WinPython-32bit-2.7.x\scripts\env.bat''' to '''C:\WinPython27\WinPython-32bit-2.7.x\scripts\own\pyt32.bat'''
 
copy '''C:\WinPython27\WinPython-32bit-2.7.x\scripts\env.bat''' to '''C:\WinPython27\WinPython-32bit-2.7.x\scripts\own\pyt32.bat'''
 +
 +
If you have permission to change the Environment Variables in windows, you can add the '''pyt32.bat''' to your path.<br>
 +
Right click Computer -> properties -> Advanced system settings -> Environment Variables -> User variables ->  Edit: PATH <br>
 +
Add to end of the Variable value:
 +
;C:\WinPython27\WinPython-32bit-2.7.x\scripts\own
 +
In any folder, hold "Shift" and right click, "Open command window here". Write:
 +
<source lang="powershell">
 +
pyt32
 +
python
 +
</source>
  
 
= Install Visual Studio Express 2012 for Windows Desktop =
 
= Install Visual Studio Express 2012 for Windows Desktop =
Line 76: Line 86:
 
You can now copy this shortcut around, which open a command prompt at the current folder, and set the paths correctly.
 
You can now copy this shortcut around, which open a command prompt at the current folder, and set the paths correctly.
  
=== Tip - add env.bat to windows path ===
+
 
If you have permission to change the Environment Variables in windows, you can add the '''env.bat''' to your path.<br>
 
Right click Computer -> properties -> Advanced system settings -> Environment Variables -> User variables ->  Edit: PATH <br>
 
Add to end of the Variable value:
 
;C:\WinPython27\WinPython-32bit-xxx\scripts
 
In any folder, hold "Shift" and right click, "Open command window here". Write:
 
<source lang="powershell">
 
env
 
relax -g
 
</source>
 
  
 
= Install other software =
 
= Install other software =

Revision as of 10:34, 20 June 2013

Download preparation

This guide should follow Homepage for MS Windows development platform

First: Download these packages, do not unpack them yet.

  1. (.exe): wxPython: http://www.lfd.uci.edu/~gohlke/pythonlibs/#wxpython
  2. (.exe): scons: http://www.lfd.uci.edu/~gohlke/pythonlibs/#scons
  3. (.zip): minfx: http://download.gna.org/minfx/
  4. (.zip): bmrblib: http://download.gna.org/bmrblib/

take the win32 bit versions.

Install python and necessary packages

I recommend to install a python distribution which is packed with several packages already.

Winpython

You could consider winpython, which includes Ipython, numpy, scipy. matplotlib etc.:
Homepage

Make a folder: C:\WinPython27.
Run the downloaded winpython exe file, and extract to: C:\WinPython27.
Open WinPython Control Panel in ex. C:\WinPython27\WinPython-32bit-2.7.x
Drag the 4 above mentioned packakes, into the window, and install the packages.
For a command window, use the WinPython Command Prompt found in C:\WinPython27\WinPython-32bit-2.7.x, which fixes path issues for finding python.

Trick to set variables in cmd

Make a folder own in C:\WinPython27\WinPython-32bit-2.7.x\scripts and
copy C:\WinPython27\WinPython-32bit-2.7.x\scripts\env.bat to C:\WinPython27\WinPython-32bit-2.7.x\scripts\own\pyt32.bat

If you have permission to change the Environment Variables in windows, you can add the pyt32.bat to your path.
Right click Computer -> properties -> Advanced system settings -> Environment Variables -> User variables -> Edit: PATH
Add to end of the Variable value:

;C:\WinPython27\WinPython-32bit-2.7.x\scripts\own

In any folder, hold "Shift" and right click, "Open command window here". Write:

pyt32
python

Install Visual Studio Express 2012 for Windows Desktop

See versions of VS 2012 here.
Take 32 bit compiling, since a horrible imprecision bug has been reported for 64 bit building. See bug #20821.

For 32 bit compiling, you will only need, Visual Studio Express for Windows Desktop.
From http://www.microsoft.com/visualstudio/eng/downloads, download and install: Visual Studio 2012 Express for Windows Desktop.
Skip all extra packages install. After install, just exit any program, which opened after install.

Install Subversion checkout of relax

Install a subversion client. For example: http://tortoisesvn.net/

Right click in winpython folder: C:\WinPython27, and select SVN Checkout. Write the path:

svn://svn.gna.org/svn/relax/trunk
svn://svn.gna.org/svn/relax/branches/relax_disp

Build relax

Open the WinPython Command Prompt
Navigate to the SVN checked out relax folder.
First we need to run the variable setup vcvars32.bat or vcvarsall.bat x86 for Microsoft Visual Studio 11.0, before we can compile.

cd C:\WinPython27\relax_disp
"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\vcvars32.bat"
"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\x86_amd64\vcvarsx86_amd64.bat"
"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" x86
"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" x86_amd64
echo %PROCESSOR_ARCHITECTURE%
set PROCESSOR_ARCHITECTURE=x86
echo %PROCESSOR_ARCHITECTURE%
scons

(Scons will automatically find CL.exe, and setup compilation for 64 bit.)

Modify env.bat

Modify C:\WinPython27\WinPython-32bit-xxx\scripts\env.bat, and add to end of file

set PATH=%PATH%;C:\WinPython27\relax_disp

Test installation, by clicking C:\WinPython27\WinPython-32bit-xxx\scripts\cmd.bat, and write

relax
relax -g

Tip - shortcut to cmd.bat

Make shortcut to C:\WinPython27\WinPython-32bit-xxx\scripts\cmd.bat, and modify the shortcut. Set

Start in: %PWD%

You can now copy this shortcut around, which open a command prompt at the current folder, and set the paths correctly.


Install other software

xmgrace - for the plotting results of NMR-relax

relax produces xmgrace "'.agr" files for plotting. There exist two ports for xmgrace to windows QtGrace and GraceGTK.
Download QtGrace, and unpack to C:\WinPython27\qtgrace_windows_binary.
Then copy C:\WinPython27\qtgrace_windows_binary\bin\qtgrace.exe to C:\WinPython27\qtgrace_windows_binary\bin\xmgrace.exe

Modify C:\WinPython27\WinPython-32bit-xxx\scripts\env.bat, and add to end of file

set PATH=%PATH%;C:\WinPython27\qtgrace_windows_binary\bin

Test installation, by clicking C:\WinPython27\WinPython-32bit-xxx\scripts\cmd.bat, and write

xmgrace

which should start xmgrace.

Python editor

A good lightweight editor for windows could Pyscripter

Trouble shooting

See also