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

  • Home
  • SEARCH
  • 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 6900677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:34:33+00:00 2026-05-27T07:34:33+00:00

Here is my .bash_profile PYTHONPATH=.:/home/miki725/django/django:$PYTHONPATH export PYTHONPATH So then I open python however the

  • 0

Here is my .bash_profile

PYTHONPATH=".:/home/miki725/django/django:$PYTHONPATH"
export PYTHONPATH

So then I open python however the directory I add in .bash_profile is not the first one:

Python 2.4.3 (#1, Sep 21 2011, 20:06:00) 
[GCC 4.1.2 20080704 (Red Hat 4.1.2-51)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> for i in sys.path:
...     print i
... 

/usr/lib/python2.4/site-packages/setuptools-0.6c9-py2.4.egg
/usr/lib/python2.4/site-packages/flup-1.0.2-py2.4.egg
/usr/lib/python2.4/site-packages/MySQL_python-1.2.3c1-py2.4-linux-i686.egg
/usr/lib/python2.4/site-packages/django_form_utils-0.1.7-py2.4.egg
/usr/lib/python2.4/site-packages/mechanize-0.2.1-py2.4.egg
/usr/lib/python2.4/site-packages/Django-1.2.1-py2.4.egg
/usr/lib/python2.4/site-packages/mercurial-1.6-py2.4-linux-i686.egg
/usr/lib/python2.4/site-packages/lxml-2.2.7-py2.4-linux-i686.egg
/usr/lib/python2.4/site-packages/django_registration-0.7-py2.4.egg
/usr/lib/python2.4/site-packages/sorl_thumbnail-3.2.5-py2.4.egg
/usr/lib/python2.4/site-packages/South-0.7.2-py2.4.egg
/usr/lib/python2.4/site-packages/django_keyedcache-1.4_1-py2.4.egg
/usr/lib/python2.4/site-packages/django_livesettings-1.4_3-py2.4.egg
/usr/lib/python2.4/site-packages/django_app_plugins-0.1.1-py2.4.egg
/usr/lib/python2.4/site-packages/django_signals_ahoy-0.1_2-py2.4.egg
/usr/lib/python2.4/site-packages/pycrypto-2.3-py2.4-linux-i686.egg
/usr/lib/python2.4/site-packages/django_threaded_multihost-1.4_0-py2.4.egg
/usr/lib/python2.4/site-packages/PIL-1.1.7-py2.4-linux-i686.egg
/usr/lib/python2.4/site-packages/pyOpenSSL-0.11-py2.4-linux-i686.egg
/usr/lib/python2.4/site-packages/ZSI-2.0_rc3-py2.4.egg
/usr/lib/python2.4/site-packages/PyXML-0.8.4-py2.4-linux-i686.egg
/usr/lib/python2.4/site-packages/pyquery-0.6.1-py2.4.egg
/usr/lib/python2.4/site-packages/pip-1.0.1-py2.4.egg
/usr/lib/python2.4/site-packages/virtualenv-1.6.1-py2.4.egg
/usr/lib/python2.4/site-packages/simplejson-2.1.6-py2.4-linux-i686.egg
/home/miki725
/home/miki725/django/django
/usr/lib/python24.zip
/usr/lib/python2.4
/usr/lib/python2.4/plat-linux2
/usr/lib/python2.4/lib-tk
/usr/lib/python2.4/lib-dynload
/usr/lib/python2.4/site-packages
/usr/lib/python2.4/site-packages/Numeric
/usr/lib/python2.4/site-packages/PIL
/usr/lib/python2.4/site-packages/gtk-2.0
>>> 
>>> 
>>> 
>>> 
>>> import django
>>> django.__file__
'/usr/lib/python2.4/site-packages/Django-1.2.1-py2.4.egg/django/__init__.pyc'
>>> 

How can I add to a python path in .bash_profile so it would be in the beginning. This is for shared hosting. I need to be able to import my django install instead of using system default.

Thank you

  • 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-05-27T07:34:34+00:00Added an answer on May 27, 2026 at 7:34 am

    Your best bet is to modify sys.path at runtime. In a shared hosting enviroment it’s common to do this in your .wsgi file. You could do something like this:

    import sys
    sys.path.insert(0, '/home/miki725/django/django')
    

    If you add export PYTHONSTARTUP=/home/miki725/.pythonrc to your .bash_profile, you can add that your .pythonrc file, and it’ll be executed before an interactive prompt is shown as well.

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

Sidebar

Related Questions

Note: Move this question to other site if you think its not suite here
I'm not sure what the policy is here on asking followup questions. So please
I have the following line in a shell script: source bash_profile It does not
I broke it again and unfortunately I am not sure why... Problem first Using
Here's a bash script, it gets all files in the current dir, then gets
Here is my script: #!/bin/bash echo Digite o local em que deseja instalar o
Here is an example to get different parts of a filename bash-3.2$ pathandfile=/tmp/ff.txt bash-3.2$
Here is a command on free bsd sudo pw usermod ksbuild -s /usr/local/bin/bash how
Here is a command line script for a dictionary lookup using Wordnet: #!/bin/bash #
I'm trying to run some commands in paralel, in background, using bash. Here's what

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.