[clpython-devel] Cannot import

import sys sys.path.append('/usr/lib/python2.5') import types debugger invoked on a CLPYTHON.USER.BUILTIN.TYPE.EXCEPTION:|ImportError| in thread ImportError: Could not find module/package `types'.Search paths
$ sbcl * (require 'clpython) * (clpython.app.repl:repl) tried: ".", "/usr/lib/python2.5" Any idea? -- Seo Sanghyeon

On Fri, Jul 24, 2009 at 12:14 PM, Seo Sanghyeon<sanxiyn@gmail.com> wrote:
import sys sys.path.append('/usr/lib/python2.5') import types debugger invoked on a CLPYTHON.USER.BUILTIN.TYPE.EXCEPTION:|ImportError| in thread ImportError: Could not find module/package `types'.Search paths
$ sbcl * (require 'clpython) * (clpython.app.repl:repl) tried: ".", "/usr/lib/python2.5"
Any idea?
Assuming there is a file /usr/lib/python2.5/types.py, try adding a backslash to the end: "/usr/lib/python2.5/". I've been working on import improvements, so that many built-in modules including "types" can be imported. I'll submit that shortly. - Willem

2009/7/24 Willem Broekema <metawilm@gmail.com>:
Assuming there is a file /usr/lib/python2.5/types.py, try adding a backslash to the end: "/usr/lib/python2.5/".
I get a different error.
import types debugger invoked on a SB-INT:SIMPLE-FILE-ERROR in thread: error opening #P"/usr/lib/python2.5/types.fasl": Permission denied
-- Seo Sanghyeon

On Fri, Jul 24, 2009 at 2:33 PM, Seo Sanghyeon<sanxiyn@gmail.com> wrote:
I get a different error.
import types debugger invoked on a SB-INT:SIMPLE-FILE-ERROR in thread: error opening #P"/usr/lib/python2.5/types.fasl": Permission denied
By default CLPython tries to write the fasl file next to the source file, which is not allowed. To resolve it you could create a new writable directory and copy or symlink all the standard Python libs there. That's not a very nice solution, so let me know if you have a suggestion on how to handle this issue. Writing the fasl file to a temporary file, perhaps? (If you have asdf-binary-locations installed, CLPython will use that to determine the fasl file location, and you should not get this error.) - Willem

2009/7/24 Willem Broekema <metawilm@gmail.com>:
(If you have asdf-binary-locations installed, CLPython will use that to determine the fasl file location, and you should not get this error.)
I've setup asdf-binary-locations, and the problem is gone. Thanks. Here are my suggestions: 1. CLPython should not force people to add slash at the end for sys.path entries. CPython does not work that way. 2. CLPython documentation should say something about write permission for .fasl files. asdf-binary-locations seems to be a good solution. -- Seo Sanghyeon

On Fri, Jul 24, 2009 at 1:22 PM, Willem Broekema<metawilm@gmail.com> wrote:
I've been working on import improvements, so that many built-in modules including "types" can be imported. I'll submit that shortly.
And I've just committed that. Everyone, please let me know if there are particular built-in modules that you wish were available, or better yet, please try to add missing functionality, using the existing modules in /lib as examples. - Willem
participants (2)
-
Seo Sanghyeon
-
Willem Broekema