Hello,
I'm running CL-Python w/ Allegro Express 8.0 on Linux. I find that import fails for anything except stuff in the current working directory. That appears to be because *habitat* has search paths = nil. I tried (setf (habitat-search-paths *habitat*) <stuff>) and that works OK for importing .py files but attempting to import built-in stuff like sys fails.
Is there some better way to establish the seach path? Shouldn't the built-in stuff be findable via the default seach paths?
Thanks a lot for your help,
Robert Dodier
On 5/5/07, Robert Dodier robert.dodier@gmail.com wrote:
I'm running CL-Python w/ Allegro Express 8.0 on Linux. I find that import fails for anything except stuff in the current working directory. That appears to be because *habitat* has search paths = nil. I tried (setf (habitat-search-paths *habitat*) <stuff>) and that works OK for importing .py files but attempting to import built-in stuff like sys fails.
Setting the search path in sys.path should work:
import sys
#<package @ #x107484f2>
sys.path.append("~")
None
import bar
; Fast loading /Users/willem/bar.fasl bar #<module `bar' from file #P"/Users/willem/bar.py" @ #x10eede5a>
import math
#<package @ #x10d46d82>
Is there some better way to establish the seach path? Shouldn't the built-in stuff be findable via the default seach paths?
Yeah, there was a typo in py-import, which used (excl:package-children :clpython.modules) while the correct package name was :clpython.module. Sorry for that, please update CVS and try again.
Importing modules should now mostly work, but there is still an issue with importing mutually dependent modules.
- Willem
Hi Willem, I'm still having trouble with import. I updated from CVS and I see some changes there. In a fresh ACL session I loaded CL-Python and called the repl.
import sys
Error: ImportError: Could not find module `sys'. Search paths tried: "." [condition type: ImportError]
Then
[1] CLPYTHON(6): (habitat-search-paths *habitat*) NIL
What else can I try? Thanks for your help.
Robert Dodier
On 5/5/07, Robert Dodier robert.dodier@gmail.com wrote:
Hi Willem, I'm still having trouble with import. I updated from CVS and I see some changes there. In a fresh ACL session I loaded CL-Python and called the repl.
import sys
Error: ImportError: Could not find module `sys'. Search paths tried: "." [condition type: ImportError]
Ah, I checked in Modern mode, while you work in ANSI. (CLPython ought to work fine in both modes.) I reproduced it, and will fix it now.
- Willem
clpython-devel@common-lisp.net