Where did bash environment variable get initialized from?
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
When I execute:
echo $PYTHONPATH
on command line I get the following output:
/home/nehal/catkin_ws/devel/lib/python2.7/dist-packages:/opt/ros/kinetic/lib/python2.7/dist-packages:/home/nehal/anaconda3/lib/python3.6/site-packageâÂÂâÂÂs:/home/nehal/anaconda3/lib/python3.6/dist-packageâÂÂâÂÂs:/home/nehal/anaconda3/lib/python3.6/dist-packageâÂÂâÂÂs:/home/nehal/anaconda3/lib/python3.6/dist-packageâÂÂâÂÂs:/home/nehal/anaconda3/lib/python3.5/dist-packageâÂÂâÂÂs:/home/userx/anaconda3/lib/python3.5/dist-packageâÂÂâÂÂs:/home/userx/anaconda3/lib/python3.5/dist-packageâÂÂâÂÂs:/home/userx/anaconda3/lib/python3.5/dist-packageâÂÂâÂÂs
I looked into .bashrc
file and found only one PYTHONPATH
set
export PYTHONPATH="/home/nehal/anaconda3/lib/python3.6/site-packageâÂÂâÂÂs:$PYTHONPATH"
I also looked into .profile
, /etc/environment
and /etc/profile
but nowhere could I find PYTHONPATH
.
My question is where did the above extra paths come from?
linux environment-variables
 |Â
show 2 more comments
up vote
1
down vote
favorite
When I execute:
echo $PYTHONPATH
on command line I get the following output:
/home/nehal/catkin_ws/devel/lib/python2.7/dist-packages:/opt/ros/kinetic/lib/python2.7/dist-packages:/home/nehal/anaconda3/lib/python3.6/site-packageâÂÂâÂÂs:/home/nehal/anaconda3/lib/python3.6/dist-packageâÂÂâÂÂs:/home/nehal/anaconda3/lib/python3.6/dist-packageâÂÂâÂÂs:/home/nehal/anaconda3/lib/python3.6/dist-packageâÂÂâÂÂs:/home/nehal/anaconda3/lib/python3.5/dist-packageâÂÂâÂÂs:/home/userx/anaconda3/lib/python3.5/dist-packageâÂÂâÂÂs:/home/userx/anaconda3/lib/python3.5/dist-packageâÂÂâÂÂs:/home/userx/anaconda3/lib/python3.5/dist-packageâÂÂâÂÂs
I looked into .bashrc
file and found only one PYTHONPATH
set
export PYTHONPATH="/home/nehal/anaconda3/lib/python3.6/site-packageâÂÂâÂÂs:$PYTHONPATH"
I also looked into .profile
, /etc/environment
and /etc/profile
but nowhere could I find PYTHONPATH
.
My question is where did the above extra paths come from?
linux environment-variables
1
There is aFILES
sectionman bash
, check it for list of files, but please note that it could change from distro to distro
â user996142
May 8 at 18:12
1
See thosedist-packages
, andsite-packages
directories? Those are probably from when you installed ros and anaconda3. Check and see what other files you are sourcing in your .bashrc
â Lucas Ramage
May 8 at 19:51
@nrb Is there a.bash_profile
?
â Nasir Riley
May 8 at 23:11
@NasirRiley No, Why?
â nrb
May 8 at 23:26
@nrb Because depending on the environment, that file usually exists to initialize bash sessions as does.bashrc
.
â Nasir Riley
May 8 at 23:30
 |Â
show 2 more comments
up vote
1
down vote
favorite
up vote
1
down vote
favorite
When I execute:
echo $PYTHONPATH
on command line I get the following output:
/home/nehal/catkin_ws/devel/lib/python2.7/dist-packages:/opt/ros/kinetic/lib/python2.7/dist-packages:/home/nehal/anaconda3/lib/python3.6/site-packageâÂÂâÂÂs:/home/nehal/anaconda3/lib/python3.6/dist-packageâÂÂâÂÂs:/home/nehal/anaconda3/lib/python3.6/dist-packageâÂÂâÂÂs:/home/nehal/anaconda3/lib/python3.6/dist-packageâÂÂâÂÂs:/home/nehal/anaconda3/lib/python3.5/dist-packageâÂÂâÂÂs:/home/userx/anaconda3/lib/python3.5/dist-packageâÂÂâÂÂs:/home/userx/anaconda3/lib/python3.5/dist-packageâÂÂâÂÂs:/home/userx/anaconda3/lib/python3.5/dist-packageâÂÂâÂÂs
I looked into .bashrc
file and found only one PYTHONPATH
set
export PYTHONPATH="/home/nehal/anaconda3/lib/python3.6/site-packageâÂÂâÂÂs:$PYTHONPATH"
I also looked into .profile
, /etc/environment
and /etc/profile
but nowhere could I find PYTHONPATH
.
My question is where did the above extra paths come from?
linux environment-variables
When I execute:
echo $PYTHONPATH
on command line I get the following output:
/home/nehal/catkin_ws/devel/lib/python2.7/dist-packages:/opt/ros/kinetic/lib/python2.7/dist-packages:/home/nehal/anaconda3/lib/python3.6/site-packageâÂÂâÂÂs:/home/nehal/anaconda3/lib/python3.6/dist-packageâÂÂâÂÂs:/home/nehal/anaconda3/lib/python3.6/dist-packageâÂÂâÂÂs:/home/nehal/anaconda3/lib/python3.6/dist-packageâÂÂâÂÂs:/home/nehal/anaconda3/lib/python3.5/dist-packageâÂÂâÂÂs:/home/userx/anaconda3/lib/python3.5/dist-packageâÂÂâÂÂs:/home/userx/anaconda3/lib/python3.5/dist-packageâÂÂâÂÂs:/home/userx/anaconda3/lib/python3.5/dist-packageâÂÂâÂÂs
I looked into .bashrc
file and found only one PYTHONPATH
set
export PYTHONPATH="/home/nehal/anaconda3/lib/python3.6/site-packageâÂÂâÂÂs:$PYTHONPATH"
I also looked into .profile
, /etc/environment
and /etc/profile
but nowhere could I find PYTHONPATH
.
My question is where did the above extra paths come from?
linux environment-variables
edited May 8 at 21:01
Alex Tullenhoff
783
783
asked May 8 at 18:08
nrb
63
63
1
There is aFILES
sectionman bash
, check it for list of files, but please note that it could change from distro to distro
â user996142
May 8 at 18:12
1
See thosedist-packages
, andsite-packages
directories? Those are probably from when you installed ros and anaconda3. Check and see what other files you are sourcing in your .bashrc
â Lucas Ramage
May 8 at 19:51
@nrb Is there a.bash_profile
?
â Nasir Riley
May 8 at 23:11
@NasirRiley No, Why?
â nrb
May 8 at 23:26
@nrb Because depending on the environment, that file usually exists to initialize bash sessions as does.bashrc
.
â Nasir Riley
May 8 at 23:30
 |Â
show 2 more comments
1
There is aFILES
sectionman bash
, check it for list of files, but please note that it could change from distro to distro
â user996142
May 8 at 18:12
1
See thosedist-packages
, andsite-packages
directories? Those are probably from when you installed ros and anaconda3. Check and see what other files you are sourcing in your .bashrc
â Lucas Ramage
May 8 at 19:51
@nrb Is there a.bash_profile
?
â Nasir Riley
May 8 at 23:11
@NasirRiley No, Why?
â nrb
May 8 at 23:26
@nrb Because depending on the environment, that file usually exists to initialize bash sessions as does.bashrc
.
â Nasir Riley
May 8 at 23:30
1
1
There is a
FILES
section man bash
, check it for list of files, but please note that it could change from distro to distroâ user996142
May 8 at 18:12
There is a
FILES
section man bash
, check it for list of files, but please note that it could change from distro to distroâ user996142
May 8 at 18:12
1
1
See those
dist-packages
, and site-packages
directories? Those are probably from when you installed ros and anaconda3. Check and see what other files you are sourcing in your .bashrcâ Lucas Ramage
May 8 at 19:51
See those
dist-packages
, and site-packages
directories? Those are probably from when you installed ros and anaconda3. Check and see what other files you are sourcing in your .bashrcâ Lucas Ramage
May 8 at 19:51
@nrb Is there a
.bash_profile
?â Nasir Riley
May 8 at 23:11
@nrb Is there a
.bash_profile
?â Nasir Riley
May 8 at 23:11
@NasirRiley No, Why?
â nrb
May 8 at 23:26
@NasirRiley No, Why?
â nrb
May 8 at 23:26
@nrb Because depending on the environment, that file usually exists to initialize bash sessions as does
.bashrc
.â Nasir Riley
May 8 at 23:30
@nrb Because depending on the environment, that file usually exists to initialize bash sessions as does
.bashrc
.â Nasir Riley
May 8 at 23:30
 |Â
show 2 more comments
2 Answers
2
active
oldest
votes
up vote
3
down vote
You can figure out which files are being sourced by tracing which files bash opens:
strace -e open bash -l
This should print out all the files bash tries to open (many of which are C libraries you can ingore). That should give you hints about where to look. (The "-l" option to bash asks it to run as a "login" shell, which generally causes bash to parse a few more startup files.)
add a comment |Â
up vote
0
down vote
On startup 'bash' loads it's settings from many files. Most of them usually live in subdirectories of '/etc' directory. So I would run the following command to find all files containing 'PYTHONPATH':
grep -R PYTHONPATH /etc 2>/dev/null
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
You can figure out which files are being sourced by tracing which files bash opens:
strace -e open bash -l
This should print out all the files bash tries to open (many of which are C libraries you can ingore). That should give you hints about where to look. (The "-l" option to bash asks it to run as a "login" shell, which generally causes bash to parse a few more startup files.)
add a comment |Â
up vote
3
down vote
You can figure out which files are being sourced by tracing which files bash opens:
strace -e open bash -l
This should print out all the files bash tries to open (many of which are C libraries you can ingore). That should give you hints about where to look. (The "-l" option to bash asks it to run as a "login" shell, which generally causes bash to parse a few more startup files.)
add a comment |Â
up vote
3
down vote
up vote
3
down vote
You can figure out which files are being sourced by tracing which files bash opens:
strace -e open bash -l
This should print out all the files bash tries to open (many of which are C libraries you can ingore). That should give you hints about where to look. (The "-l" option to bash asks it to run as a "login" shell, which generally causes bash to parse a few more startup files.)
You can figure out which files are being sourced by tracing which files bash opens:
strace -e open bash -l
This should print out all the files bash tries to open (many of which are C libraries you can ingore). That should give you hints about where to look. (The "-l" option to bash asks it to run as a "login" shell, which generally causes bash to parse a few more startup files.)
answered May 8 at 19:58
Alex Tullenhoff
783
783
add a comment |Â
add a comment |Â
up vote
0
down vote
On startup 'bash' loads it's settings from many files. Most of them usually live in subdirectories of '/etc' directory. So I would run the following command to find all files containing 'PYTHONPATH':
grep -R PYTHONPATH /etc 2>/dev/null
add a comment |Â
up vote
0
down vote
On startup 'bash' loads it's settings from many files. Most of them usually live in subdirectories of '/etc' directory. So I would run the following command to find all files containing 'PYTHONPATH':
grep -R PYTHONPATH /etc 2>/dev/null
add a comment |Â
up vote
0
down vote
up vote
0
down vote
On startup 'bash' loads it's settings from many files. Most of them usually live in subdirectories of '/etc' directory. So I would run the following command to find all files containing 'PYTHONPATH':
grep -R PYTHONPATH /etc 2>/dev/null
On startup 'bash' loads it's settings from many files. Most of them usually live in subdirectories of '/etc' directory. So I would run the following command to find all files containing 'PYTHONPATH':
grep -R PYTHONPATH /etc 2>/dev/null
answered May 8 at 21:25
John Doe
804
804
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f442605%2fwhere-did-bash-environment-variable-get-initialized-from%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
1
There is a
FILES
sectionman bash
, check it for list of files, but please note that it could change from distro to distroâ user996142
May 8 at 18:12
1
See those
dist-packages
, andsite-packages
directories? Those are probably from when you installed ros and anaconda3. Check and see what other files you are sourcing in your .bashrcâ Lucas Ramage
May 8 at 19:51
@nrb Is there a
.bash_profile
?â Nasir Riley
May 8 at 23:11
@NasirRiley No, Why?
â nrb
May 8 at 23:26
@nrb Because depending on the environment, that file usually exists to initialize bash sessions as does
.bashrc
.â Nasir Riley
May 8 at 23:30