jez
jez

Reputation: 1287

Using interpreter to lookup module 'sys' in Python

So I just installed the python interpreter and wanted to use the help(sys) feature to get more information about the sys module, but I got this error and had no idea what went wrong.

C:\Users\Jake>python
Python 2.7.2 (default, Jun 12 2011, 14:24:46) [MSC v.1500 64 bit (AMD64)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> help(sys)
'more' is not recognized as an internal or external command,
operable program or batch file.

>>>

Is this a matter of not having the source code for the sys module on my computer or something else entirely? Any help would be greatly appreciated.

Upvotes: 5

Views: 1552

Answers (4)

rob mayoff
rob mayoff

Reputation: 385670

Python uses the more program to show the help text. It's saying it can't find the more program. It should be at C:\Windows\System32\more.com. You need to have C:\Windows\System32 in your PATH environment variable.

Upvotes: 8

ekhumoro
ekhumoro

Reputation: 120618

Make sure that:

  1. the directory containing more.com is in your PATH environment variable
  2. the .COM extension is in your PATHEXT environment variable

Upvotes: 0

initzero
initzero

Reputation: 852

It looks like you have the sys module on your system, since import sys worked fine.

I'm not sure what the issue is exactly, but you can find plenty of info on sys and other modules at Python site.

Also, on Linux you can run a pydoc server and browse the module help pages in a browser.

$ pydoc -p <port>

$ firefox http://localhost:<port>/

Though I'm not sure what it takes to set up pydoc in Windows.

Upvotes: 0

Matt Fenwick
Matt Fenwick

Reputation: 49095

more is a program used to display text in the terminal. I believe it generally comes with Windows installations. Python is trying to use it to display the help text, but it seems that your computer doesn't have it, or your python interpreter isn't able to use it.

Here's a list of common Windows shell commands, including more.

Upvotes: 3

Related Questions