pyenv icon indicating copy to clipboard operation
pyenv copied to clipboard

-bash: alias: `export PATH': invalid alias name after installation of pyenv

Open laurent101 opened this issue 9 years ago • 8 comments

Hi, after installing pyenv via Homebrew (on OSX Sierra) and following further installation instructions, like adding eval "$(pyenv init -)" to bash_profile, I end up with the following: '-bash: alias: `export PATH': invalid alias name' when starting a new shell (or running ~/.bash_profile). Running echo $PATH works as expected. Any idea what to look for to suppress this message.

Thanks

laurent101 avatar Jun 15 '17 22:06 laurent101

Please show the relevant part of your bash profile file. You might be missing a newline?!

blueyed avatar Jun 16 '17 06:06 blueyed

Thanks for picking up on this so quickly!

#PATH export PATH="/usr/local/bin:/usr/bin:/bin:JENV_ROOT=/usr/local/var/jenv:$PATH"

#PYENV export PYENV_ROOT="${HOME}/.pyenv"

if [ -d "${PYENV_ROOT}" ]; then export PATH="${PYENV_ROOT}/bin:${PATH}" eval "$(pyenv init -)" fi

#PYENV-VIRTUALENV eval "$(pyenv virtualenv-init -)" export PYENV_VIRTUALENV_DISABLE_PROMPT=1

laurent101 avatar Jun 16 '17 07:06 laurent101

Looks ok.

You can put set -x before (and set +x after) this block to see what gets executed before the error.

Maybe you also have something in bashrc?!

blueyed avatar Jun 16 '17 07:06 blueyed

Also make sure that the error goes away when you comment/remove this block etc.

blueyed avatar Jun 16 '17 07:06 blueyed

Blueyed, that solved the problem. Many thanks for your assistance!

laurent101 avatar Jun 16 '17 09:06 laurent101

@laurent101 What exactly solved it? :)

blueyed avatar Jun 16 '17 13:06 blueyed

@laurent101 I would really appreciate some feedback here..

blueyed avatar Jun 18 '17 01:06 blueyed

Really sorry about the late reply. I was offline for a couple of days. Running source ~/.bash_profile with set -x /+x I discovered there was a typo in the command line for eliminating duplicates in PATH.

laurent101 avatar Jun 18 '17 06:06 laurent101