1

So I want to add some code to my python path the code is located in $HOME/eon on my machine. I was told to add:

export PYTHONPATH=$HOME/test:$PYTHONPATH
export PATH=$HOME/test/bin:$PATH

to ~/.profile. However this does not work for me. When I type those two lines into the terminal I do add the test folder to my python path but only temporarily. I have also tried adding the two lines to my ~/.bashrc file but still no luck.

2 Answers 2

1

What you're doing works fine on my system, so it's possible you forgot to "tell the system" to use the new version ~/.bashrc

Here is the output from my terminal after adding your lines to my ~/.bashrc:

/home/amit/test/bin:/home/amit/test/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/amit/bin

The changes are not reflected. However, after

[amit@amit ~]$ source ~/.bashrc 

I get:

[amit@amit ~]$ echo $PATH
/home/amit/test/bin:/home/amit/test/bin:/home/amit/test/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/amit/bin
Sign up to request clarification or add additional context in comments.

1 Comment

Not sure how but I had multiple instances of bashrc up at some point because vim told me I had a swap file for it. Once i deleted the swap file everything worked fine.
1
  1. Add them in ~/.profile
  2. Save and exit
  3. Do source ~/.profile to make changes effective for the current bash

If you are still having problems, you can add echo 'hello world.' to your .bashrc and see if it prints it when you open a new terminal to see if your system runs .bashrc as it should be.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.