473,414 Members | 1,951 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

Python Importing Modules

4
Hi
I am aruni.I have just started to use the python.I tried to import os in my program.but it is giving me an error as "no Module named OS".I thought it as similar to sys.Can anyone tell me an sugesstion.How to use the os in my python program.
Sep 14 '07 #1
6 15083
bvdet
2,851 Expert Mod 2GB
Hi
I am aruni.I have just started to use the python.I tried to import os in my program.but it is giving me an error as "no Module named OS".I thought it as similar to sys.Can anyone tell me an sugesstion.How to use the os in my python program.
Python is case-sensitive:
Expand|Select|Wrap|Line Numbers
  1. >>> import OS
  2. Traceback (most recent call last):
  3.   File "<interactive input>", line 1, in ?
  4. ImportError: No module named OS
  5. >>> import os
  6. >>> os.getcwd()
  7. 'C:\\SDS2_7.0\\macro\\macrolib'
  8. >>> 
Sep 14 '07 #2
aruni
4
Python is case-sensitive:
Expand|Select|Wrap|Line Numbers
  1. >>> import OS
  2. Traceback (most recent call last):
  3.   File "<interactive input>", line 1, in ?
  4. ImportError: No module named OS
  5. >>> import os
  6. >>> os.getcwd()
  7. 'C:\\SDS2_7.0\\macro\\macrolib'
  8. >>> 
Hi..
Again i am getting error.
what i have to do to avoid this.
Sep 18 '07 #3
bartonc
6,596 Expert 4TB
Hi..
Again i am getting error.
what i have to do to avoid this.
small "os". Not Capital "OS".
Sep 18 '07 #4
aruni
4
small "os". Not Capital "OS".

Hi
For both the os and OS i getting error.when i opened my python exe my first statement is " 'import site' failed; use _v for traceback"
Sep 19 '07 #5
Hi aruni,

Is the issue resolved now?? Im also having same issue

'import site' failed; use -v for traceback
Traceback (most recent call last):
File "path of file", line 51, in ?
import os, os.path, subprocess, pwd, re, socket, string, sys, syslog, time, traceback,random
ImportError: No module named os
Nov 11 '18 #6
rodnaz
3
Hi, This has been seen if you run python 2.x when you were intending to run python v3.x eg "python myfile.py" instead of "python3 myfile.py" Cheers Nigel see https://stackoverflow.com/questions/...-for-traceback
Nov 13 '18 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Edmond Rusjan | last post by:
Hi All, I'd like to use Python-2.3.4 on OSF1 V4.0, but have trouble installing. With a plain "./configure; make" build, I cannot import socket. If I uncomment the socketmodule in Modules/Setup,...
10
by: Andrew Dalke | last post by:
Is there an author index for the new version of the Python cookbook? As a contributor I got my comp version delivered today and my ego wanted some gratification. I couldn't find my entries. ...
1
by: Sorin Schwimmer | last post by:
Hi All, After a disaster in which I lost my whole harddrive, I decided to install the newest everything that I use. I put the latest Gentoo Linux, with gcc 4.1.1, installed tcl/tk 8.4.14 and...
0
by: Kurt B. Kaiser | last post by:
Patch / Bug Summary ___________________ Patches : 342 open (-38) / 3712 closed (+54) / 4054 total (+16) Bugs : 951 open (-14) / 6588 closed (+33) / 7539 total (+19) RFE : 257 open...
7
by: brasse | last post by:
Hello! I am having some trouble building Python 2.6 on AIX. The steps I have taken are: export PATH=/usr/bin/:/usr/vacpp/bin/ ../configure --with-gcc=xlc_r --with-cxx=xlC_r --disable-ipv6...
0
by: Akira Kitada | last post by:
Hi list, I was trying to build Python 2.6 on FreeBSD 4.11 and found it failed to build some of the modules. """ Failed to find the necessary bits to build these modules: _bsddb ...
0
by: Akira Kitada | last post by:
Hi Marc-Andre, Thanks for the suggestion. I opened a ticket for this issue: http://bugs.python.org/issue4204 Now I understand the state of the multiprocessing module, but it's too bad to see...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.