pyjs on windows

88 views
Skip to first unread message

Ming

unread,
Apr 30, 2014, 3:38:42 PM4/30/14
to pyjs-...@googlegroups.com
Hi, Can someone help with two problems? I'm trying pyjs on windows 7. Installed as described below, mostly following the readme file.

It failed to build at step [6] using the command as specified by the readme file. How to debug or fix it? That's ok, as I figured out I can use the step [7] to build for web deployment.

Another problem is that I cannot figure out how to run pyjd, the desktop application. Any hint officially or as a shortcut? 

Some background: I've used gwt for a while, but new to python. I tried to build pyj.be on windows too, though there are some small issues here or there.

Thanks!
-Ming


pyjs install on windows
=========================

[1] install python 2.7.6, pywin32-218
[2] extract pyjs.zip downloaded from github into c:\pytest\pyjsroot

[3]
    c:\>cd pytest\virtualenv-1.11.4
    c:\pytest\virtualenv-1.11.4>c:\python276\python.exe virtualenv.py c:\pytest\pyjsroot\mypy
    New python executable in c:\pytest\pyjsroot\mypy\Scripts\python.exe
    Installing setuptools, pip...done.

[4]
    cd c:\pytest\pyjsroot
    mypy\Scripts\pip.exe install c:\pytest\pyjsroot

[5]
    cd c:\pytest\pyjsroot
    mypy\Scripts\pip.exe install c:\pytest\comtypes-1.0.0


pyjs build examples
=====================

[6] --this failed:
    cd c:\pytest\pyjsroot
    mypy\Scripts\python.exe examples\helloworld

[7] --this works:

    cd c:\pytest\pyjsroot\examples\helloworld
    ..\..\mypy\Scripts\pyjsbuild.exe Hello.py

[8] --how to run pyjd? 


Ming

unread,
May 6, 2014, 10:55:27 PM5/6/14
to pyjs-...@googlegroups.com
The official step [6] still fail.

As to [8], I figure out to copy a pyjd.bat from pjs.be project as below. Then go into the examples\helloworld\ directory and run "pjd.bat Hello.py", it starts the desktop successfully.

[localhost]$ cat pjd.bat
@echo off

set PYJAMAS_HOME=c:\pytest\pyjsroot
set PYJAMAS_SITE=c:\pytest\pyjsroot\mypython\Lib\site-packages

set PYTHONPATH=%PYJAMAS_HOME%;%PYJAMAS_SITE%;%PYTHONPATH%

set CMD_LINE_ARGS=
:setArgs
if ""%1""=="""" goto doneSetArgs
set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
shift
goto setArgs
:doneSetArgs

"c:\pytest\pyjsroot\mypython\Scripts\python.exe" %CMD_LINE_ARGS%

Ming

unread,
May 6, 2014, 11:02:51 PM5/6/14
to pyjs-...@googlegroups.com
Running "pyjsbuild hello.py" gets the error below. Github version 564cf5f of Mar 20 works well. 

564cf5fBuilding: hello
PYJSPATH: ['/home/iton/Desktop/night',
'/usr/lib/python2.7/site-packages/pyjs-0.8.2-py2.7.egg/pyjswidgets',
'/usr/lib/python2.7/site-packages/pyjs-0.8.2-py2.7.egg/pyjswaddons',
'/usr/share/pyjamas/library',
'/usr/share/pyjamas/addons']
Traceback (most recent call last):
File "/usr/bin/pyjsbuild", line 21, in <module>
pyjs.browser.build_script()
File "/usr/lib/python2.7/site-packages/pyjs-0.8.2-py2.7.egg/pyjs/browser.py", line 524, in    build_script
runtime_options, args)
File "/usr/lib/python2.7/site-packages/pyjs-0.8.2-py2.7.egg/pyjs/browser.py", line 448, in build
l()
File "/usr/lib/python2.7/site-packages/pyjs-0.8.2-py2.7.egg/pyjs/linker.py", line 267, in __call__
except translator.TranslationError( e ):
NameError: global name 'e' is not defined

Steve Spicklemire

unread,
May 18, 2014, 7:51:02 AM5/18/14
to pyjs-...@googlegroups.com
I see this too with the git checkout of today.

(mypy)aluminum:pyjs steve$ python ./examples/helloworld

Building: Hello

PYJSPATH: ['/Users/steve/Development/pyjs/examples/helloworld',

 '/Users/steve/Development/pyjs/mypy/lib/python2.7/site-packages/pyjswidgets',

 '/Users/steve/Development/pyjs/mypy/lib/python2.7/site-packages/pyjswaddons']

Traceback (most recent call last):

  File "/Users/steve/Development/pyjs/mypy/bin/pyjsbuild", line 9, in <module>

    load_entry_point('pyjs==0.8.2', 'console_scripts', 'pyjsbuild')()

  File "/Users/steve/Development/pyjs/mypy/lib/python2.7/site-packages/pyjs/browser.py", line 524, in build_script

    runtime_options, args)

  File "/Users/steve/Development/pyjs/mypy/lib/python2.7/site-packages/pyjs/browser.py", line 448, in build

    l()

  File "/Users/steve/Development/pyjs/mypy/lib/python2.7/site-packages/pyjs/linker.py", line 267, in __call__

    except translator.TranslationError( e ):

NameError: global name 'e' is not defined


I'll see if I can track it down.
-steve

Steve Spicklemire

unread,
May 18, 2014, 8:12:05 AM5/18/14
to pyjs-...@googlegroups.com
I'm thinking it should be: 

except translator.TransationError as e

or something like that?
-steve
Reply all
Reply to author
Forward
0 new messages