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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T22:22:46+00:00 2026-06-02T22:22:46+00:00

To add the directory to my python path, I went into the command line,

  • 0

To add the directory to my python path, I went into the command line, did “open -e .bash_profile”, which opened it up in TextEdit. I then added the directory which I just created called “coltrane”, so the bash file looked like this after edit:

file path with coltrane

Then I went into the python interactive session and did “import sys” and “print sys.path” to test if the edit was successful. It gave me this:

sys.path

As you can see, the directory “coltrane” is the first path on sys.path. But then I tried to import “coltrane” and it doesn’t recognize it:

enter image description here

Any idea why this is happening? Did I write it the wrong way in .bash_profile?

thnx

  • 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-02T22:22:47+00:00Added an answer on June 2, 2026 at 10:22 pm

    You added the coltrane directory to the path, and I assume that’s the module you want to import (that is, you have an __init__.py in that directory to make the directory itself a module). But you want to add the directory that contains the module you want to import, i.e., djangoprojects, to your path, because the PYTHONPATH tells Python what directories to look in for modules.

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

Sidebar

Related Questions

Here is my .bash_profile PYTHONPATH=.:/home/miki725/django/django:$PYTHONPATH export PYTHONPATH So then I open python however the
I've tried to add directory c:\mscache which is read only and hidden, to my
How do I add a new directory into my CVS repository using Ant? From
I want to automatically add entries to python's sys.path variable when run by my
Is there any way to create a virtual import path in Python? My directory
I know that I can add an import path to Python like this: import
Im trying to add a directory foo to my repo, but there are some
The problem is simple: Using bash, I want to add a directory to my
I am trying to add a virtual directory to my web config file so
I was wondering how I can add a new directory in my perl settings

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.