After reading a reply to a post regarding importing modules, help("modules") was suggested as a means to display what is currently available. I tried it and got errors after only performing a basic install of Python 2.7 and Python for Windows. Can these be repaired [see attached]
vegaseat 1,735 DaniWeb's Hypocrite Team Colleague
Works fine for me ...
Python 2.7.1 (r271:86832, Nov 27 2010, 18:30:46) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> >>> import sys, os, wx
>>> help("modules")
Please wait a moment while I gather a list of all available modules...
ArgImagePlugin _imagingcms htmllib socket
BaseHTTPServer _imagingft httplib sprite
Bastion _imagingmath idlelib sqlite3
BdfFontFile _imagingtk ihooks sre
BmpImagePlugin _io image sre_compile
BufrStubImagePlugin _json imageext sre_constants
CGIHTTPServer _locale imageop sre_parse
Canvas _lsprof imaplib ssl
ConfigParser _md5 imghdr sspi
ContainerIO _msi imp sspicon
Cookie _multibytecodec importlib sstruct
CurImagePlugin _multiprocessing imputil stat
DcxImagePlugin _numericsndarray inspect statvfs
Dialog _numericsurfarray io string
DocXMLRPCServer _numpysndarray isapi stringold
EpsImagePlugin _numpysurfarray itertools stringprep
ExifTags _pyio joystick strop
FileDialog _random json struct
FitsStubImagePlugin _sha key subprocess
FixTk _sha256 keyword sunau
FliImagePlugin _sha512 lib2to3 sunaudio
FontFile _socket linecache surface
FpxImagePlugin _sqlite3 locale surfarray
GbrImagePlugin _sre locals surflock
GdImageFile _ssl logging symbol
GifImagePlugin _strptime mac_scrap symtable
GimpGradientFile _struct macosx sys
GimpPaletteFile _subprocess macpath sysconfig
GribStubImagePlugin _symtable macurl2path sysfont
HTMLParser _testcapi mailbox tabnanny
Hdf5StubImagePlugin _threading_local mailcap tarfile
IcnsImagePlugin _tkinter markupbase telnetlib
IcoImagePlugin _vlcbackend marshal tempfile
ImImagePlugin _warnings mask test
Image _weakref math tests
ImageChops _weakrefset matplotlib textwrap
ImageCms _win32sysloader md5 this
ImageColor _winreg mhlib thread
ImageDraw _winxptheme midi threading
ImageDraw2 abc mimetools threads
ImageEnhance adodbapi mimetypes time
ImageFile afxres mimify timeit
ImageFileIO aifc mixer timer
ImageFilter antigravity mixer_music tkColorChooser
ImageFont anydbm mmap tkCommonDialog
ImageGL argparse mmapfile tkFileDialog
ImageGrab array mmsystem tkFont
ImageMath ast modulefinder tkMessageBox
ImageMode asynchat mouse tkSimpleDialog
ImageOps asyncore movie tkSnack
ImagePalette atexit mpl_toolkits toaiff
ImagePath audiodev msilib token
ImageQt audioop msvcrt tokenize
ImageSequence base multifile trace
ImageShow base64 multiprocessing traceback
ImageStat bdb mutex transform
ImageTk binascii netbios ttfquery
ImageTransform binhex netrc ttk
ImageWin bisect new tty
ImtImagePlugin bsddb nmovie turtle
IptcImagePlugin bufferproxy nntplib types
JpegImagePlugin bz2 nt unicodedata
McIdasImagePlugin cPickle ntpath unittest
MicImagePlugin cProfile ntsecuritycon urllib
MimeWriter cStringIO nturl2path urllib2
MpegImagePlugin calendar numbers urlparse
MspImagePlugin camera numpy user
OleFileIO cdrom odbc uu
PIL cgi opcode uuid
PSDraw cgitb operator version
PaletteFile chempy optparse vidcap
PalmImagePlugin chunk os vidle
PcdImagePlugin cmath os2emxpath vis
PcfFontFile cmd overlay visual
PcxImagePlugin code parser warnings
PdfImagePlugin codecs pdb wave
PixarImagePlugin codeop perfmon weakref
Pmw collections pickle web
PngImagePlugin color pickletools webbrowser
Polygon colordict pipes whichdb
PpmImagePlugin colorsys pixelarray win2kras
PsdImagePlugin commands pkgdata win32api
PyQt4 commctrl pkgutil win32clipboard
PySide compat platform win32com
Queue compileall plistlib win32con
Scientific compiler pmg_tk win32console
Scientific_affinitypropagation constants pmg_wx win32cred
Scientific_interpolation contextlib popen2 win32crypt
Scientific_netcdf cookielib poplib win32cryptcon
Scientific_numerics_package_id copy posixfile win32event
Scientific_vector copy_reg posixpath win32evtlog
ScrolledText csv pprint win32evtlogutil
SgiImagePlugin ctypes profile win32file
SimpleDialog curses pstats win32gui
SimpleHTTPServer cursors pty win32gui_struct
SimpleXMLRPCServer datetime py_compile win32help
SocketServer dateutil pyclbr win32inet
SpiderImagePlugin dbhash pydoc win32inetcon
StringIO dbi pydoc_data win32job
SunImagePlugin dde pyexpat win32lz
TarIO decimal pygame win32net
TgaImagePlugin difflib pyglet win32netcon
TiffImagePlugin dircache pylab win32pdh
TiffTags dis pymedia win32pdhquery
Tix display pymol win32pdhutil
Tkconstants distutils pypm win32pipe
Tkdnd docs pysideuic win32print
Tkinter doctest pythoncom win32process
UserDict draw pytz win32profile
UserList dumbdbm pywin win32ras
UserString dummy_thread pywin32_testutil win32rcparser
WalImageFile dummy_threading pywintypes win32security
WmfImagePlugin email quopri win32service
XVThumbImagePlugin encodings random win32serviceutil
XbmImagePlugin errno rasutil win32timezone
XpmImagePlugin event re win32trace
_LWPCookieJar examples rect win32traceutil
_MozillaCookieJar exceptions regcheck win32transaction
__builtin__ fastevent regutil win32ts
__future__ filecmp repr win32ui
_abcoll fileinput rexec win32uiole
_arraysurfarray fnmatch rfc822 win32verstamp
_ast font rlcompleter win32wnet
_bisect fontTools robotparser winerror
_bsddb formatter runpy winioctlcon
_camera fpformat rwobject winnt
_camera_opencv_highgui fractions sched winperf
_camera_vidcapture freemol scipy winsound
_codecs freetype scrap winxpgui
_codecs_cn ftplib select winxptheme
_codecs_hk functools servicemanager wsgiref
_codecs_iso2022 future_builtins sets wx
_codecs_jp gc sgmllib wxPython
_codecs_kr genericpath sha wxversion
_codecs_tw getopt shelve xdrlib
_collections getpass shlex xml
_csv gettext shutil xmlWriter
_ctypes gfxdraw signal xmllib
_ctypes_test glob sip xmlrpclib
_dummybackend gp2x sipconfig xxsubtype
_elementtree gzip sipdistutils zipfile
_functools hashlib site zipimport
_hashlib heapq smtpd zlib
_heapq hmac smtplib
_hotshot hotshot sndarray
_imaging htmlentitydefs sndhdr
>>>
Enter any module name to get more help. Or, type "modules spam" to search
for modules whose descriptions contain the word "spam".
stan_l 4 Newbie Poster
even with the import sys, os, wx I still get the same error - I misspoke in the intial post - maybe ActivePython is the issue?????
vegaseat 1,735 DaniWeb's Hypocrite Team Colleague
I am not sure what ActivePython does to the pure Python version from
python.org
I would advice you to uninstall that version and download the pure python-2.7.1.msi file from python.org!
Check the FTP site:
http://www.python.org/ftp/python/2.7.1/
stan_l 4 Newbie Poster
I did as you suggested. Attached screenshot shows I have the same version as you posted - but the same error.
stan_l 4 Newbie Poster
I once again removed python, did a registry clean and defrag, re-installed and the modules were listed without error. Curious, it removed my PostGRE ODBC drivers which were installed for a windows app I wrote. On a Win7 machine with ActivePython installed the modules also appeared w/out error. Being new to Python and with sooooo many libs, modules, eggs available I obviously messed up somewhere to get the error I received. Caveat Emptor. Not really solved, but I'll wait a day or so for any addtional comments then mark it so.
snippsat 661 Master Poster
look like it get and error on try to import numpy.
Try. help('numpy')
.
Try this.
try:
help('modules')
except Exception, e:
print e
Or
try:
help('modules')
except ImportError:
pass
To get it to continue after ImportError.
Place for numpy C:\Python27\Lib\site-packages\numpy
So you have to delete this folder is reinstall.
Remeber if you reinstall python,can 3 party modules like numpy not be removed.
You have to do it manually.
Edited by snippsat because: n/a
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.