|
InstallingPyjamasAndPyjamasDesktopForWindows
Installing Pyjamas and Pyjamas Desktop for WindowsWiki has MovedThe Pyjamas Wiki is now at http://pyjs.org/wiki (article contributed by Mike Truty) I write in with questions from time to time and I really like Pyjamas. I noticed some concern about getting Pyjamas running on Windows in some posts and I wanted to verify that I got Pyjamas running on Windows today in around 30minutes with the following recipe. It's really straightforward and this is Windows Vista 64-bit SP1. This is just a checkpoint to reinforce that Pyjamas and Pyjamas Desktop are functional on Windows. Big thanks to lkcl for his GREAT work and I'm sure others as well! Mike Here is the short recipe: INSTALL PYJAMAS AND DEPENDENCIES: 1. Open an Administrator command-line and do everything from there. 2. Install Python 2.6.2 for Windows. A. Download Python 2.6.2 for Window from: http://www.python.org/ftp/python/2.6.2/python-2.6.2.msi B. Run the installer from the command line and choose all the defaults. C. Mine installs to C:\Python26 3. Install Pyjamas 0.6. A. Download from http://sourceforge.net/projects/pyjamas/files/pyjamas/0.6/pyjamas-0.6... B. Extract. C. Mine installed to C:\Pyjamas\v6 4. Install comtypes 0.6.1. A. Download from http://sourceforge.net/projects/comtypes/files/comtypes/0.6.1/comtype... B. Run installer from the command line. C. Mine seems to create files under C:\Python26\Lib\site-packages \comtypes. 5. [Optional?] Install Python for Windows Extensions (pywin32) from: http://sourceforge.net/projects/pywin32/files/pywin32/Build%20214/pyw... A. I'm not sure if this is even necessary anymore. Based on my reading in the group, I would skip this. (lkcl: no, it's not) B. I did install it by running the installer from the command line.
C. It does seem to add some packages/files under C:\Python26\Lib
\site-packages.
Permanently update the path for Python and Pyjamas.
A. I added the following to my system path: c:\python26;c:\Pyjamas
\v6\bin;
B. Close/re-open the Admin command line.
CONFIGURE PYJAMAS AND PYTHON ON WINDOWS:
Initialize Pyjamas:
A. cd C:\Pyjamas\v6
B. > python bootstrap.py
I modified my bin\pyjsbuild.bat. I'm not sure if there is a better
way to fixup PYTHONPATH.
set _OLD_PYTHONPATH=%PYTHONPATH%
set PYTHONPATH=c:\bin\pyjamas\v6;
python C:\Pyjamas\v6\bin\pyjsbuild.py %CMD_LINE_ARGS%
set PYTHONPATH=%_OLD_PYTHONPATH%
Then, I created a corresponding command for the desktop runs called
pyjd.bat:
@echo off
set CMD_LINE_ARGS=
:setArgs
if ""%1""=="""" goto doneSetArgs
set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
shift
goto setArgs
:doneSetArgs
set _OLD_PYTHONPATH=%PYTHONPATH%
set PYTHONPATH=c:\bin\pyjamas\v6;
python %CMD_LINE_ARGS%
set PYTHONPATH=%_OLD_PYTHONPATH%
FIX PROBLEMS:
I had to fix a problem that lkcl has already corrected. msxml2.dll is
not present on these systems however msxml3.dll is. So, I edited
pyjamas\v6\pyjd\mshtml.py and changed
GetModule('msxml2.dll')
to:
GetModule('msxml3.dll')(lkcl: this is in latest svn, it'll be in the next release) There's an issue that lkcl has already corrected that we can sidestep easily. This will need to be more thoroughly corrected to run anything that uses a Timer for it's fine for these samples. Edit pyjamas\v6\library\pyjamas\Timer.py and delete the line with gobject in it. (lkcl: likewise) RUN EXAMPLES
Run helloworld in a browser:
A. cd examples\helloworld
B. I create a build.bat in sample directories:
@echo off
pyjsbuild.bat --print-statements Hello
C. Run it: output\Hello.html
Run helloworld from the desktop:
A. cd examples\helloworld
B. I create a run.bat in the sample directories:
@echo off
pyjd Hello.py
C. Run it: run.bat
Run KitchenSink in a browser:
A. cd examples\kitchensink
B. I create a build.bat in sample directories:
@echo off
pyjsbuild.bat --print-statements KitchenSink
C. Run it: output\KitchenSink.html
Run KitchenSink from the desktop:
A. cd examples\kitchensink
B. Create run.bat just like in helloworld but this time with
kitchensink.py.
C. Run it: run.bat
Step back in awe and admire the work of a great community!
|
► Sign in to add a comment
There is an error in the pyjd.bat file above.
The path statement should be:
set PYTHONPATH=c:\pyjamas\v6; Not:
set PYTHONPATH=c:\bin\pyjamas\v6;
Does pyjamas desktop not support gears?
I tried running that sample using this process after expaning the python path to find the gears module in library/pyjamas like this:
set PYTHONPATH=c:\pyjamas\v6;c:\pyjamas\v6\library;
But I get this error:
Traceback (most recent call last):
AttributeError?: 'NoneType?' object has no attribute 'gjs_get_global_context'Somebody refined this tutorial even more: http://blog.holkevisser.nl/2011/02/12/how-to-install-pyamas-on-windows/