Skip to content


Subversion checkout URL

You can clone with
Download ZIP


AttributeError: 'module' object has no attribute 'path' when compiling pyjamas-0.8a1 examples #46

pyjsorg opened this Issue · 5 comments

1 participant


What steps will reproduce the problem?

  1. Installed pyjamas-0.7 to ~/tmp/pyjamas-0.7/ from pypi tgz package. Built the 'examples' directory without issues and browsed example gallery using localhost. So far so good.
  2. Installed pyjamas-0.8a1
  3. tried to build the 'examples' directory by doing cd examples && python .

What is the expected output? What do you see instead?

Expected: pyjamas-0.7 like example output with a short compilation OK message. Instead I get an AttributeError from translating (see attached)


Mac OS X Snow Leopard 10.6.8 Intel/i386 running python-2.7.2 from macports. Problem also happens in python-2.6.7 from macports package.

Additional info:

I'm a newbie to pyjamas but have expert knowledge of python and other stuff. I was expecting my first git clone to work out of the box instead of having to fall back to 0.7. Maybe someone could point this out in the tutorial (if the problem's not my system).

Original issue: (January 11, 2012 18:44:50)


From on January 12, 2012 23:14:15:
OK - 35e802c
bad - 271a8aa

Note: git clone before checkout or else some stale *.pyc or cached files may not cause this problem to appear.


From on January 13, 2012 00:01:23:
$ git show 271a8aa
commit 271a8aa
Author: Kees Bos
Date: Thu Mar 3 15:30:35 2011 +0100

Fix from  issue #556  : does not compile
Thanks to Gabriel Jacobo

diff --git a/pyjs/src/pyjs/ b/pyjs/src/pyjs/
index 2cbe44a..4b8ea48 100644
--- a/pyjs/src/pyjs/
+++ b/pyjs/src/pyjs/
@@ -107,7 +107,7 @@ def out_translate(platform, file_names, out_file, module_name,
opts = ["--module-name", module_name,
"-o", out_file.replace(" ", r"\ "),
] + get_translator_opts(translator_args) + file_names

  • opts = [pyjs.PYTHON] + [''] + opts
  • opts = [pyjs.PYTHON] + [os.path.join(pydir, '')] + opts pyjscompile_cmd = ' '.join(opts) #print pyjscompile_cmd - use this to create Makefile code-fragment proc = subprocess.Popen(pyjscompile_cmd, @@ -115,7 +115,7 @@ def out_translate(platform, file_names, out_file, module_name, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True,
  • cwd=pydir,
  • cwd=os.path.dirname(file_names[0]), env=os.environ ) stdout_value, stderr_value = proc.communicate('') diff --git a/pyjs/src/pyjs/ b/pyjs/src/pyjs/ index fca86ed..2469ea6 100644 --- a/pyjs/src/pyjs/ +++ b/pyjs/src/pyjs/ @@ -524,7 +524,7 @@ class Pyjamas(object): data = open(node.args[0].value, 'r').read() except IOError, e: raise TranslationError(
  • "Cannot include file '%s': %s" % (node.args[0].value, e))
  • "Cannot include file '%s': %s" % (node.args[0].value, e), node.node) translator.ignore_debug = True return data, False else:

From on January 13, 2012 00:04:52:
This line is causing the error:

  • "Cannot include file '%s': %s" % (node.args[0].value, e))
  • "Cannot include file '%s': %s" % (node.args[0].value, e), node.node)

From on January 13, 2012 01:23:42:
Using the compiler from 35e802c avoids the error, but then there's other errors during Translation.


From on January 13, 2012 12:58:44:
What I don't onderstand (from the first log) is
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/", line 80, in makepath
dir = os.path.join(*paths)
AttributeError: 'module' object has no attribute 'path'
How can the 'os' module not have 'path', while at the top of the file os.path is used without throwing errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.