Wazam
Wazam

Reputation: 320

How to install the os module?

I'm trying to install the os Python module on Windows.

In a cmd console, I typed:

C:\Users\username> pip install os
Collecting os
  Could not find a version that satisfies the requirement os (from versions: )
No matching distribution found for os

So I guessed the module was not available on Windows for some reasons, but I found references of it in some SO questions.

Obviously, typing Windows and os in Google only gives me answers about Windows itself.

So, how can I install the os module on Windows?


See Also:

Determining if a given Python module is a built-in module - to learn how to check if a library is built-in and hence doesn't require installing.

Upvotes: 12

Views: 225703

Answers (3)

Darwish
Darwish

Reputation: 11

The Following Line can be pasted in cmd or any terminal to install the module.

pip install os-sys

Upvotes: -11

w. Patrick Gale
w. Patrick Gale

Reputation: 2337

If you are trying to use the os library in your Python code and you are getting an error like NameError: name 'os' is not defined, you need to make sure you are including an import statement near the top of your Python script to use the os library:

import os

Upvotes: 4

Praveen Meghwal
Praveen Meghwal

Reputation: 462

OS is python's standard library. So no need to download it.

Upvotes: 41

Related Questions