Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9232503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:19:47+00:00 2026-06-18T06:19:47+00:00

I’m confused. I think this is going to be a simple error, but I

  • 0

I’m confused. I think this is going to be a simple error, but I can’t find what I’m doing wrong. I’m running python 2.4.4. I’ve written my first python script consisting of multiple files. I’ve read python looks in the current working directory, as well as all the usual paths for user-added modules. I’ve confirmed this by looking at sys.path:

$ python
Python 2.4.4 (#1, Jan  8 2013, 09:29:21) 
[GCC 4.7.2 20120921 (Red Hat 4.7.2-2)] on linux3
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print(sys.path)
['', '/usr/local/lib/python24.zip', '/usr/local/lib/python2.4',     '/usr/local/lib/python2.4/plat-linux3', '/usr/local/lib/python2.4/lib-tk',     '/usr/local/lib/python2.4/lib-dynload', '/usr/local/lib/python2.4/site-packages']
>>> 

The first entry, ”, represents look in the current working directory, yet it does not seem to be doing so. Here is the contents of my mult file python program. Note, everything is in the same directory:

$ ls
cherwellTicket.py  dsutils.py  emailMessage.py
$

Here is the contents of dsutils.py. This module contains various static methods I want to use in other classes:

#!/usr/bin/python

import getpass
import socket

class DSUtils:
    # (I didn't paste the rest)

And here is the contents of cherwellTicket.py. Note, this is in the same directory:

#!/usr/bin/python

import DSUtils 

class CherwellTicket:

    def __init():
        pass

Yet, when python trys to execute cherwellTicket.py, heres what happens:

$ python cherwellTicket.py 
Traceback (most recent call last):
  File "cherwellTicket.py", line 3, in ?
    import DSUtils 
ImportError: No module named DSUtils
$ 

Both files are in the same directory, so why is the cherwellTicket script now able to import the dsutils class?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T06:19:49+00:00Added an answer on June 18, 2026 at 6:19 am

    DSUtils is different than dsutils. I think you might want:

    from dsutils import DSUtils
    

    The module is the name of the file (sans .py extension). Python doesn’t look at the classes within a module until the module is being imported.

    Alternatively,

     import dsutils
     class_you_want = dsutils.DSUtils
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a French site that I want to parse, but am running into
I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
This could be a duplicate question, but I have no idea what search terms
Does anyone know how can I replace this 2 symbol below from the string
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am confused How to use looping for Json response Array in another Array.
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.