Announcement

Collapse
No announcement yet.

Question about the .bashrc file and Gutsy (Solved)

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Question about the .bashrc file and Gutsy (Solved)

    1st question:
    In trying to set my PYTHONPATH environment variable I realized that I did not have a .bashrc file in my home directory. When I installed fiesty this file was automatically created. Why is it missing in Gutsy? I also realized that there isn't a .bash_profile in /etc.

    2nd question:
    When I noticed that it was missing I created a .bashrc file using Kate and set my environment variable as follows
    Code:
    export PYTHONPATH=$PYTHONPATH:~/my_script_directory
    any ideas as to why this isn't working for me?


    #2
    Re: Question about the .bashrc file and Gutsy

    Originally posted by BostonBrother
    1st question:
    In trying to set my PYTHONPATH environment variable I realized that I did not have a .bashrc file in my home directory. When I installed fiesty this file was automatically created. Why is it missing in Gutsy?
    it should be there.
    something is wrong with your user env.
    either you deleted it accidentally or...i don't know: it should be there.

    Originally posted by BostonBrother
    I also realized that there isn't a .bash_profile in /etc.
    ttbomk there's no such file as /etc/.bash_profile.
    the file you're looking for probably is /etc/profile.

    Originally posted by BostonBrother
    2nd question:
    When I noticed that it was missing I created a .bashrc file using Kate and set my environment variable as follows
    Code:
    export PYTHONPATH=$PYTHONPATH:~/my_script_directory
    any ideas as to why this isn't working for me?
    maybe...
    if PYTHONPATH had a null value before this line, expanding it would result in
    Code:
    :/home/your_user/your_script_directory
    are you sure this works?
    gnu/linux is not windoze

    Comment


      #3
      Re: Question about the .bashrc file and Gutsy

      Regarding the .bashrc
      it should be there.
      something is wrong with your user env.
      either you deleted it accidentally or...i don't know: it should be there.
      Well, my guess is that it probably did get erased somehow. Is there a way to get it back?

      ttbomk there's no such file as /etc/.bash_profile.
      the file you're looking for probably is /etc/profile.
      You are right, I do have this file /etc/profile

      maybe...
      if PYTHONPATH had a null value before this line, expanding it would result in
      Code:
      :/home/your_user/your_script_directory
      the PYTHONPATH was indeed null as you say. However, when I changed it to this:
      Code:
      export PYTHONPATH=$HOME:/my_script_directory
      and checked it by
      Code:
      echo $PYTHONPATH
      /home/username/my_script_directory
      This is the correct path to the directory that I need, and it still did not work.

      I'm guessing that my problems may be stemming from the fact that I did not have that .bashrc file.

      Comment


        #4
        Re: Question about the .bashrc file and Gutsy

        Originally posted by BostonBrother
        Well, my guess is that it probably did get erased somehow. Is there a way to get it back?
        simplest way is probably to have a new user created off system settings -> usr mngmnt
        then copy that new user's .bashrc over to /tmp
        eventually copy .bashrc from /tmp to your original user's home dir.
        that should get you a fresh .bashrc file.
        anyway, keeping a test user handy is always...well handy!

        Originally posted by BostonBrother
        the PYTHONPATH was indeed null as you say. However...
        you could make sure ownership and permission mask for that directory are ok.
        pls, issue:
        Code:
        cd
        chown you_user:your_group path_to_your_dir
        chmod 755 path_to_your_dir
        just to make sure...
        what do you expect from setting PYTHONPATH in your env?

        hth
        gnu/linux is not windoze

        Comment


          #5
          Re: Question about the .bashrc file and Gutsy

          Well I was able to set the environment variable, just not in .bashrc.
          I was able to set in in /etc/profile

          The thing that I don't get is that it seems to me that I should be able to set the path without editing the profile. I needed root access to change that file and now that path is set for every user on my system.

          I tried setting the path to /home/user in profile and then adding /home/user/script_directory in .bashrc but it didn't work.
          When I echo $PYTHONPATH it shows that it is there, but my python interpretor doesn't see the added path.

          what do you expect from setting PYTHONPATH in your env?
          I just don't want to tell my interactive interpretor where to look everytime I start it up, and I don't want to start filling in the directory where the python library is with a bunch of classes that I'm just messing around with and not planning on keeping.

          BTW thanks for you comments, they have been very helpful in working this problem out to this point.

          Comment


            #6
            Re: Question about the .bashrc file and Gutsy (Solved)

            For anyone that happens to come across this problem in the future.
            My problem was that I was somehow missing both my .bashrc and my .profile from my home directory.

            To fix I replaced both files by creating another user and copying the files from there into my home directory. To get my environment variable PYTHONPATH to be recognized I placed it in the .profile in my home directory, not the .bashrc using the code:
            Code:
            export PYTHONPATH=~/my_script_directory
            Thanks for all the help, couldn't have gotten here without it.

            Comment

            Working...
            X