473,587 Members | 2,448 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Python Importing Modules

4 New Member
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 15092
bvdet
2,851 Recognized Expert Moderator Specialist
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 New Member
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 Recognized Expert Expert
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 New Member
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
malashree
1 New Member
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,rando m
ImportError: No module named os
Nov 11 '18 #6
rodnaz
3 New Member
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
2620
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, the build fails. Using gcc 3.4.2. Had no problem on OSF1 V5.1, Linux and Sun. Have not been able to find reference to a similar problem in...
10
3678
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. Andrew dalke@dalkescientific.com
1
3453
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 tried Python 2.5. I tried with and without the suggested -fwrapv compiler option, and make gave me the same:
0
11320
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 (-15) / 266 closed (+13) / 523 total ( -2) New / Reopened Patches ______________________
7
1861
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 make This is the error message I'm seeing:
0
2436
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 _sqlite3 _tkinter gdbm linuxaudiodev spwd sunaudiodev
0
1932
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 math, mmap and readline modules, that worked fine before, cannot be built anymore.
0
8215
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7973
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8220
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6626
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5394
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3844
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2358
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1454
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1189
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.