List of modules available for import inside Python?

This is a discussion on List of modules available for import inside Python? within the Python forums in Programming Languages category; Is there a way to view all the modules I have available for import from within Python? Like writing in the interpreter: import.modules Also, is there anything like Cpan for Python?...

Go Back   Application Development Forum > Programming Languages > Python

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-28-2008, 12:21 AM
ssecorp
Guest
 
Default List of modules available for import inside Python?

Is there a way to view all the modules I have available for import
from within Python?
Like writing in the interpreter:
import.modules


Also, is there anything like Cpan for Python?
Reply With Quote
  #2  
Old 08-28-2008, 12:48 AM
James Mills
Guest
 
Default Re: List of modules available for import inside Python?

On Thu, Aug 28, 2008 at 2:21 PM, ssecorp <circularfunc@gmail.com> wrote:
> Also, is there anything like Cpan for Python?


Try the Python Cheese Shop / PyPi

http://pypi.python.org/pypi

cheers
James

--
--
-- "Problems are solved by method"
Reply With Quote
  #3  
Old 08-28-2008, 12:54 AM
Chris Rebert
Guest
 
Default Re: List of modules available for import inside Python?

On Wed, Aug 27, 2008 at 9:21 PM, ssecorp <circularfunc@gmail.com> wrote:
> Is there a way to view all the modules I have available for import
> from within Python?
> Like writing in the interpreter:
> import.modules
>
>
> Also, is there anything like Cpan for Python?


The closest thing would be PyPI (the Python Package Index)
[http://pypi.python.org/pypi], and easy_install (a package manager for
Python) [http://peak.telecommunity.com/DevCenter/EasyInstall].

- Chris
========
Follow the path of the Iguana...
Rebertia: http://rebertia.com
Blog: http://blog.rebertia.com

> --
> http://mail.python.org/mailman/listinfo/python-list
>

Reply With Quote
  #4  
Old 08-28-2008, 02:04 AM
Fredrik Lundh
Guest
 
Default Re: List of modules available for import inside Python?

ssecorp wrote:

> Is there a way to view all the modules I have available for import
> from within Python?
> Like writing in the interpreter:
> import.modules


there's a helper script in the 2.5 source code kit that locates all
existing standard modules:

http://svn.python.org/projects/pytho...listmodules.py

to get all modules, remove the for-loop that follows after the comment
"get rid of site packages".

also see:

http://effbot.org/zone/listmodules-cgi.htm

</F>

Reply With Quote
  #5  
Old 08-28-2008, 02:12 AM
Michele Simionato
Guest
 
Default Re: List of modules available for import inside Python?

On Aug 28, 6:21*am, ssecorp <circularf...@gmail.com> wrote:
> Is there a way to view all the modules I have available for import
> from within Python?
> Like writing in the interpreter:


Try:

>>> help()

help> modules
Please wait a moment while I gather a list of all available modules...
<snip>
Reply With Quote
  #6  
Old 08-28-2008, 10:42 AM
pruebauno@latinmail.com
Guest
 
Default Re: List of modules available for import inside Python?

On Aug 28, 12:21 am, ssecorp <circularf...@gmail.com> wrote:
> Is there a way to view all the modules I have available for import
> from within Python?
> Like writing in the interpreter:
> import.modules
>
> Also, is there anything like Cpan for Python?


Isn't the most obvious answer to the first question this link?

http://docs.python.org/modindex.html
Reply With Quote
  #7  
Old 08-28-2008, 12:10 PM
Fredrik Lundh
Guest
 
Default Re: List of modules available for import inside Python?

pruebauno@latinmail.com wrote:

>> Is there a way to view all the modules I have available for import
>> from within Python?
>> Like writing in the interpreter:
>> import.modules
>>
>> Also, is there anything like Cpan for Python?

>
> Isn't the most obvious answer to the first question this link?


depends on whether you want a list of the modules that you might be able
to import, or the modules that are actually present on your system.

</F>

Reply With Quote
  #8  
Old 08-28-2008, 02:23 PM
Jason Scheirer
Guest
 
Default Re: List of modules available for import inside Python?

On Aug 27, 11:04*pm, Fredrik Lundh <fred...@pythonware.com> wrote:
> ssecorp wrote:
> > Is there a way to view all the modules I have available for import
> > from within Python?
> > Like writing in the interpreter:
> > import.modules

>
> there's a helper script in the 2.5 source code kit that locates all
> existing standard modules:
>
> http://svn.python.org/projects/pytho...listmodules.py
>
> to get all modules, remove the for-loop that follows after the comment
> "get rid of site packages".
>
> also see:
>
> http://effbot.org/zone/listmodules-cgi.htm
>
> </F>


I like to direct new users to pydoc's built-in HTTP server:

import pydoc
pydoc.gui()
(then click the 'open browser' button)
Reply With Quote
  #9  
Old 08-28-2008, 03:32 PM
mblume
Guest
 
Default Re: List of modules available for import inside Python?

Am Thu, 28 Aug 2008 11:23:01 -0700 schrieb Jason Scheirer:
>
> I like to direct new users to pydoc's built-in HTTP server:
>
> import pydoc
> pydoc.gui()
> (then click the 'open browser' button)
>


Now, this is cool !

Thanks a lot!

Martin

Reply With Quote
  #10  
Old 09-06-2008, 04:18 PM
clurker
Guest
 
Default Re: List of modules available for import inside Python?

Michele Simionato wrote:

> On Aug 28, 6:21Â*am, ssecorp <circularf...@gmail.com> wrote:
>> Is there a way to view all the modules I have available for import
>> from within Python?
>> Like writing in the interpreter:

>
> Try:
>
>>>> help()

> help> modules
> Please wait a moment while I gather a list of all available modules...
> <snip>


This looks like it could be a useful tool, but when I try it
I get the following:

Please wait a moment while I gather a list of all available modules...

/usr/lib/python2.5/site-packages/reportlab/lib/PyFontify.py:35:
Warning: 'with' will become a reserved keyword in Python 2.6
/usr/lib/python2.5/site-packages/reportlab/lib/PyFontify.py:36:
Warning: 'with' will become a reserved keyword in Python 2.6
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.5/site.py", line 346, in __call__
return pydoc.help(*args, **kwds)
File "/usr/lib/python2.5/pydoc.py", line 1645, in __call__
self.interact()
File "/usr/lib/python2.5/pydoc.py", line 1663, in interact
self.help(request)
File "/usr/lib/python2.5/pydoc.py", line 1679, in help
elif request == 'modules': self.listmodules()
File "/usr/lib/python2.5/pydoc.py", line 1797, in listmodules
ModuleScanner().run(callback)
File "/usr/lib/python2.5/pydoc.py", line 1848, in run
for importer, modname, ispkg in pkgutil.walk_packages():
File "/usr/lib/python2.5/pkgutil.py", line 110, in walk_packages
__import__(name)
File "/usr/local/lib/python2.5/site-packages/PIL/__init__.py", line 1342,
in <module>

File "/usr/local/lib/python2.5/site-packages/PIL/__init__.py", line 927,
in main

UnboundLocalError: local variable 'given_files' referenced before assignment
>>>


which could be because I am fairly free and unrestrained when
it comes to installing stuff, and I see now I have modules
on both /usr/lib/python2.5 and /usr/local/lib/python2.5

Apparently python knows about them both, but I don't know I
haven't introduced an incompatibility somewhere...and that PIL
package showing up at the tail of the errors was one of my
more recent additions...

Any help will be appreciated,

sc

Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 08:40 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.