11

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.

Tomerikoo
  • 18,379
  • 16
  • 47
  • 61
Wazam
  • 310
  • 1
  • 3
  • 8
  • 1
    Why are you trying to install it? `os` is part of the standard library, so if you have Python, you have `os` already. https://docs.python.org/2/library/os.html – Matt Ball Dec 28 '17 at 16:14
  • 1
    [`os`](https://docs.python.org/3/library/os.html#module-os) is a standard Python module, there's no need install it. – martineau Dec 28 '17 at 16:15
  • @MattBall emacs jedi needs it, but doesn't find it And when in the console, the os functions return `no module named os` – Wazam Dec 28 '17 at 16:19
  • 2
    This sounds like an example of [the XY problem](https://meta.stackexchange.com/q/66377/133242). I would suggest that you post another question, with the details of the specific error you're seeing, in the context of emacs jedi. – Matt Ball Dec 28 '17 at 16:21

3 Answers3

34

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

Praveen Meghwal
  • 394
  • 3
  • 4
2

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
w. Patrick Gale
  • 1,643
  • 13
  • 22
-6

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

pip install os-sys
MD Mushfirat Mohaimin
  • 1,966
  • 3
  • 10
  • 22
Darwish
  • 1
  • 2