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 419227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T18:45:24+00:00 2026-05-12T18:45:24+00:00

import sys sys.path.append(‘/home/myuser/svn-repos/myproject’) from myproject.settings import * But, it says module not found when

  • 0
import sys
sys.path.append('/home/myuser/svn-repos/myproject')
from myproject.settings import *

But, it says module not found when I run the script?
By the way, settings.py has been set up and manage.py syncdb works.

  • 1 1 Answer
  • 1 View
  • 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-05-12T18:45:24+00:00Added an answer on May 12, 2026 at 6:45 pm

    You want sys.path.append('/home/myuser/svn-repos') instead. Then when you import myproject, it looks in svn-repos for the myproject folder, and looks in that for settings.

    Alternatively, leave it as is and just import settings. This is less good because it’s less specific and you may end up importing something other than what you intend.

    You may also want to consider sys.path.insert(0, 'yourpath') because python starts at the beginning of that dict and works backwards, so whatever you put at the front takes precedence, solving the aforementioned settings problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Firstly, here's my script: #!/usr/bin/python import sys, os sys.path.append('/home/username/python') sys.path.append(/home/username/python/flup) sys.path.append(/home/username/python/django) # more path
I thought import sys sys.path.append(/home/me/mydir) is appending a dir to my pythonpath if I
I have the following simple code: import urllib2 import sys sys.path.append('../BeautifulSoup/BeautifulSoup-3.1.0.1') from BeautifulSoup import
I have a file with this content import os import sys sys.path.append('/home/user/dj/project/') sys.path.append('/home/user/dj/') os.environ.setdefault(DJANGO_SETTINGS_MODULE,
tests.py import unittest import sys import os sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir))) import my_module.ext print sys.path print
import os from os.path import abspath, dirname import sys # Set up django project_dir
Can someone explain why this code: import sys sys.path.append(C:\\WINDOWS\\system32) import clr clr.AddReferenceToFile(wiimotelib.dll) works fine
It's weird to me that the import fails even when it's in the sys.path
Python reports an import error, even when a valid package exists on sys.path, if
import sys from PyQt4 import QtGui, QtCore class Example(QtGui.QWidget): def __init__(self): super(Example, self).__init__() self.initUI()

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.