0

I am using macos 10.14 and think I need to remove the 3.7 version of python from my path to compile an angular application. This is my result of echo $PATH

/Users/my_usrname/.nvm/versions/node/v10.15.3/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/Library/Frameworks/Python.framework/Versions/3.7/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Wireshark.app/Contents/MacOS 

I have uninstalled the 3.7 version, but I still have it in my path. This is how my .bash_profile looks like

# export PATH="/usr/local/sbin:$PATH"
# Setting PATH for Python 3.7
# The original version is saved in .bash_profile.pysave
# PATH="/Library/Frameworks/Python.framework/Versions/3.7/bin:${PATH}"
# export PATH

# Setting PATH for Python 2.7
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
export PATH

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  #This load$

As you can see I have uncommented the 3.7 version and this does not give the desired result. These are all the tricks I have read about from others to remove a python version from the path, but it didn't do it. Then I found something that seems to be relevant in .bash_profile.pysave

export PATH="/usr/local/sbin:$PATH"
# Setting PATH for Python 3.7
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.7/bin:${PATH}"
export PATH

Should I remove/uncomment? Or replace this with 2.7 version? Is it safe? I'm not totally sure what I'm dealing with, but I have above avg computer skills. Any help would be appreciated.

2 Answers 2

1

You need to understand the difference between the .bash_profile and .bashrc, here is a good read

https://medium.com/@kingnand.90/what-is-the-difference-between-bash-profile-and-bashrc-d4c902ac7308

In short the bash_profile is ran whenever you log into a shell via ssh or whatever. So the paths you are exporting in .bash_profile will run, if you have logged into a shell..

Sign up to request clarification or add additional context in comments.

Comments

0

It should work after you uninstall the 3.7 version and revise your PATH.

What is the output by typing which python? And did you restart your terminal or source your .bash_profile after the revision?

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.