[Tutor] Installing modules with easy_install

Ray Jones crawlzone at gmail.com
Tue Aug 28 21:49:24 CEST 2012


On 08/28/2012 12:44 PM, Peter Otten wrote:
> Ray Jones wrote:
>
>> On 08/28/2012 11:06 AM, Peter Otten wrote:
>>> Ray Jones wrote:
>>>
>>>> I'm working on another Python replacement for a Bash script, and I ran
>>>> into a need for enhanced time zone functions. Following directions I
>>>> found on a web site, I did the following:
>>>>
>>>> # easy_install --upgrade pytz
>>>> Searching for 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 2012d
>>>> Downloading
>>>> http://pypi.python.org/packages/2.7/p/pytz/pytz-2012d-
>>> py2.7.egg#md5=e6f9219ae6eff242f13c6700413df69e
>>>> Processing pytz-2012d-py2.7.egg
>>>> creating /usr/local/lib/python2.7/dist-packages/pytz-2012d-py2.7.egg
>>>> Extracting pytz-2012d-py2.7.egg to
>>>> /usr/local/lib/python2.7/dist-packages Adding pytz 2012d to
>>>> easy-install.pth file
>>>>
>>>> Installed /usr/local/lib/python2.7/dist-packages/pytz-2012d-py2.7.egg
>>>> Processing dependencies for pytz
>>>> Finished processing dependencies for pytz
>>>>
>>>>
>>>> Everything I'm reading suggests that now I should have the pytz module
>>>> available to me. But from iPython:
>>>>
>>>>
>>>> In [1]: import pytz
>>>>
> ---------------------------------------------------------------------------
>>>> ImportError                               Traceback (most recent call
>>>> last)
>>>>
>>>> /home/ray/<ipython console> in <module>()
>>>>
>>>> ImportError: No module named pytz
>>> Do you have multiple python installations on your machine? Do you run
>>> easy_install in one and ipython in another?
>> Perhaps. But the module is not accessible from the 'python' shell, from
>> 'idle', or from iPython.
>>
>> As I peruse Synaptic I find I have active installations of Ubuntu's
>> basic python, python2.7, and python2.7-minimal. But are these separate
>> installations? 
> No, I suspected that you had a system python and a self-compiled one, i. e. 
> that you have both
>
> /usr/local/bin/python
>
> and
>
> /usr/bin/python
>
> If that were the case then you should be able to import pytz into one of 
> these.
Bingo!


Ray


More information about the Tutor mailing list