I’ve tried everything I can find, but no matter what, I get the “no module named …” error when I try to import a module from a zip archive.
I’ve tried the sys.path.append method in the Digi instructions (which are pretty thin in this area), and the sys.path.insert method in the XIG code (which runs without error), but I always get the same error.
Can someone who has made this work provide some guidance here? I’m at the end of my rope.
def fib(n): # write Fibonacci series up to n
a, b = 0, 1
while b < n:
print b,
a, b = b, a+b
def fib2(n): # return Fibonacci series up to n
result =
a, b = 0, 1
while b < n:
result.append(b)
a, b = b, a+b
return result
#################
And here is what I get when I run it.
#> python test.py
[‘WEB/python/test.zip’, ‘WEB/python’, ‘WEB/python/python.zip’]
Traceback (most recent call last):
File “”, line 20, in ?
ImportError: No module named fibo
#>
So clearly the path has been modified properly, but for some reason it doesn’t seem to be actually looking in the zip file. When I include fibo.py in the WEB/python directory, it runs fine. Can someone please tell me what I’m missing here?