ImportError: No module named pytz

3,165 views
Skip to first unread message

magus

unread,
Sep 8, 2011, 10:41:07 AM9/8/11
to PyISAPIe
Hello All,

I am getting "ImportError: No module named pytz".

pytz module is installed as an egg and accessible from python shell.
It is not importing with IIS/PyISAPIe though. Strange thing is that
suds module is importing just fine with IIS/PyISAPIe.

Here is my setup:
Windows 7 64bit
IIS 7
Python 2.6

Trace extract:
Could not initialize interpreter

Traceback (most recent call last):
File "c:\local_path\test.py", line 14, in
import pytz
ImportError: No module named pytz


Additional Information
-- Module Search Path --

c:\local_path
C:\Python26\lib\site-packages\lxml-2.2.2-py2.6-win32.egg
C:\Python26\lib\site-packages\suds-0.4-py2.6.egg
C:\Python26\lib\site-packages\setuptools-0.6c11-py2.6.egg
C:\Python26\lib\site-packages\pytz-2011h-py2.6.egg
C:\Python26\lib\site-packages\soaplib-2.0.0b1_beta-py2.6.egg
C:\Python26\Lib
C:\Python26\DLLs
C:\Windows\SysWOW64\inetsrv
C:\Python26
C:\Python26\lib\site-packages


-- Other Path Info --

Current Directory = 'c:\local_path'
Python Home = '<Auto>'
sys.executable = 'c:\local_path\PyISAPIe.dll'
sys.exec_prefix = 'C:\Python26'
sys.prefix = 'C:\Python26'

Any help will be appreciated.

Thanks,
Nick

Randy Syring

unread,
Sep 8, 2011, 10:45:36 AM9/8/11
to pyis...@googlegroups.com, magus
Is it in zipped form (i.e. a single file)? Try installing as a
directory instead of a file. Sometimes, the web user doesn't have
permission to write to a temporary location, which is needed to unzip
the egg.

--------------------------------------
Randy Syring
Intelicom
Direct: 502-276-0459
Office: 502-212-9913

For the wages of sin is death, but the
free gift of God is eternal life in
Christ Jesus our Lord (Rom 6:23)

magus

unread,
Sep 8, 2011, 10:56:17 AM9/8/11
to PyISAPIe
Hi Randy,

It was a good point. Both suds and pytz modules are installed as
files. But the problem was indeed with access permissions. suds has
good permissions, pytz - not.

Thanks for your quick reaction. The problem is solved.

Nick

sanja...@gmail.com

unread,
Jul 14, 2012, 2:55:53 PM7/14/12
to pyis...@googlegroups.com
Hi Nick,

I am facing the same problem. 
"ImportError: No module named pytz".
Mac OS X 10.7.3
Python 2.5.4

Also when I run:

>>> import matplotlib
>>> print matplotlib.version

 I get an error: "
Traceback (most recent call last):
  File "<pyshell#2>", line 1, in <module>
    print matplotlib.version
AttributeError: 'module' object has no attribute 'version'
>>> "

This means somehow mat plotib has not been properly installed. 

But I am new to programming. Suggestions would be helpful. Thanks,
Reply all
Reply to author
Forward
0 new messages