python: pytz package installation issue: ImportError: No module named pytz -


i installed pytz package on windows7 machine via:

c:\users\name\downloads\pytz>easy_install --upgrade pytz searching pytz reading http://pypi.python.org/simple/pytz/ reading http://pytz.sourceforge.net reading http://sourceforge.net/project/showfiles.php?group_id=79122 reading http://www.stuartbishop.net/software/pytz reading http://sourceforge.net/projects/pytz/ best match: pytz 2013b downloading http://pypi.python.org/packages/2.7/p/pytz/pytz-2013b-py2.7.egg#md5=7cfcc57ddb87125a042b70c03580d6cf processing pytz-2013b-py2.7.egg moving pytz-2013b-py2.7.egg c:\python27\lib\site-packages adding pytz 2013b easy-install.pth file  installed c:\python27\lib\site-packages\pytz-2013b-py2.7.egg processing dependencies pytz finished processing dependencies pytz  c:\python27\lib\site-packages>dir  volume in drive c has no label.  volume serial number 485c-3867 

i checked .egg file in python27\lib\site-packages directory:

 directory of c:\python27\lib\site-packages  04/05/2013  06:06 pm    <dir>          . 04/05/2013  06:06 pm    <dir>          .. 04/05/2013  06:06 pm               237 easy-install.pth 09/20/2006  10:05               126 easy_install.py 04/05/2013  05:33 pm               312 easy_install.pyc 04/05/2013  05:33 pm               312 easy_install.pyo 10/19/2009  06:35            85,435 pkg_resources.py 04/05/2013  05:33 pm            90,779 pkg_resources.pyc 04/05/2013  05:33 pm            90,779 pkg_resources.pyo 04/05/2013  06:06 pm           521,259 pytz-2013b-py2.7.egg 03/08/2011  10:39               121 readme.txt 04/05/2013  05:33 pm    <dir>          setuptools 04/05/2013  05:33 pm    <dir>          setuptools-0.6c11-py2.7.egg-info 09/20/2006  10:05             2,362 site.py 04/05/2013  05:33 pm             1,719 site.pyc 04/05/2013  05:33 pm             1,719 site.pyo 04/05/2013  05:36 pm         1,784,796 sqlalchemy-0.8.0-py2.7.egg 04/05/2013  05:27 pm    <dir>          xlrd 04/05/2013  05:27 pm               975 xlrd-0.7.3-py2.7.egg-info 

but when go python interpreter get:

>>>import pytz traceback (most recent call last):   file "<console>", line 1, in <module> importerror: no module named pytz 

when open .py file in pydev claims import pytz statement unresolved. can't find package.

i kindly appreciate help. thank you.

*edit *

the contents of easy_install.pth:

import sys; sys.__plen = len(sys.path) ./sqlalchemy-0.8.0-py2.7.egg ./pytz-2013b-py2.7.egg import sys; new=sys.path[sys.__plen:]; del sys.path[sys.__plen:]; p=getattr(sys,'__egginsert',0); sys.path[p:p]=new; sys.__egginsert = p+len(new) 

i removed ./pytz-2013b-py2.7.egg easy_install.pth file , tried easy_install pytz. time installed , can import pytz without error reported earlier (why fix issue?).

however, ecplise/pydev still not seem acknowledge import pytz statement. can't resolve it. can't resolve import sqlalchemy dos python interpreter can import both. python interpreter in eclipse/pydev set c:\python27\python.exe if go windows > preferences > interpreter - python.

interesting enough had check interpreter configuration in project. assumed project know given global settings. guess not.

now works. thank everyone.

a few thoughts:

  1. check egg doesn't have funky permissions set on it.
  2. is python install in c? import sys; sys.executable check being run.
  3. do have other eggs are able import?

Comments

Popular posts from this blog

ios - iPhone/iPad different view orientations in different views , and apple approval process -

java Extracting Zip file -

C# WinForm - loading screen -