Solved

Changing $PATH variable - OS X

Posted on 2016-08-25
2
55 Views
Last Modified: 2016-08-26
I am trying to update my $Path variable.  However, I am getting the message the executable needs to be in the PATH.

I used this command to update the path
echo 'export PATH=/Users/rjw/Documents/Python' >>~/.bash_profile

Open in new window


But when you look at echo $PATH you get the following without my path above.

export PATH=${PATH}:~/android-sdk-mac/tools
export PS1="rjw "
export PATH="/usr/local/mysql/bin:$PATH"
alias ll='ls -lahG'
export PATH=/usr/local/mysql/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/rjw/android-sdk-mac/tools:/usr/local/mysql/bin

export PATH=/usr/local/mysql/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/rjw/android-sdk-mac/tools:/usr/local/mysql/bin:/usr/local/mysql/bin

export PATH=/usr/local/mysql/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/rjw/android-sdk-mac/tools:/usr/local/mysql/bin:/usr/local/mysql/bin

##
# Your previous /Users/rjw/.bash_profile file was backed up as /Users/rjw/.bash_profile.macports-saved_2016-01-13_at_10:05:16
##

# MacPorts Installer addition on 2016-01-13_at_10:05:16: adding an appropriate PATH variable for use with MacPorts.
export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
# Finished adapting your PATH environment variable for use with MacPorts.


##
# Your previous /Users/rjw/.bash_profile file was backed up as /Users/rjw/.bash_profile.macports-saved_2016-07-26_at_16:54:01
##

# MacPorts Installer addition on 2016-07-26_at_16:54:01: adding an appropriate PATH variable for use with MacPorts.
export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
# Finished adapting your PATH environment variable for use with MacPorts.


##
# Your previous /Users/rjw/.bash_profile file was backed up as /Users/rjw/.bash_profile.macports-saved_2016-07-26_at_17:07:46
##

# MacPorts Installer addition on 2016-07-26_at_17:07:46: adding an appropriate PATH variable for use with MacPorts.
export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
# Finished adapting your PATH environment variable for use with MacPorts.


##
# Your previous /Users/rjw/.bash_profile file was backed up as /Users/rjw/.bash_profile.macports-saved_2016-07-26_at_17:13:45
##

# MacPorts Installer addition on 2016-07-26_at_17:13:45: adding an appropriate PATH variable for use with MacPorts.
export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
# Finished adapting your PATH environment variable for use with MacPorts.
# Setting PATH for Python 3.5
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.5/bin:${PATH}"
export PATH

Open in new window


I uninstalled macports if that is the problem and went to homebrew instead.
0
Comment
Question by:sharingsunshine
2 Comments
 
LVL 27

Accepted Solution

by:
serialband earned 500 total points
ID: 41771165
This is more of a linux and bash question than just OS X.

After you ran your command, did you open a new Terminal window?  Did you reload your Terminal.  You current window won't load the .bash_profile until you've done something to reload it.

You can load it without restarting your terminal with the built-in source command:
source .bash_profile

You can start a new bash instance
bash

or if you want to reload your single instance,
exec bash


Your path command is also wrong.  You will replace all paths with just your home folder.
You really need
echo 'export PATH=$PATH:/Users/rjw/Documents/Python' >>~/.bash_profile

It also looks like macports added it's own path after yours, so the 2nd PATH setting won.

What are the current contents of your .bash_profile?
0
 

Author Comment

by:sharingsunshine
ID: 41771862
that's what I needed.  The path is in and working.  Thanks for the help.

I had closed the terminal window and then restarted it but that didn't do it.  But using  source .bash_profile and changing to your path made it work.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Connectivity using SMB Symptoms When connecting to Windows Server shares from a Mac you receive an error similar to "Connection failed because the original item could not be found"Authentication persistently fails to a Windows Server from a Mac wi…
The error "There was an error performing the update" occurred on a Mac OS X client workstation running  Symantec AntiVirus for Mac (http://www.symantec.com/business/products/purchasing.jsp?pcid=pcat_security&pvid=825_1) - the Enterprise product vers…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now