1

In my .bashrc I added the following:

export PYTHONPATH=$PYTHONPATH:/home/tbao/src/Cython-0.14.1

When I relogin, I get the error:

-bash: /home/tbao/src/Cython-0.14.1: is a directory

I want to add the the directory to my pythonpath, but I can't. What am I doing wrong?

6
  • 1
    Does $PYTHONPATH contain spaces? Commented Jun 18, 2011 at 15:53
  • Try adding a / at the end and see if it works. Commented Jun 18, 2011 at 15:57
  • I've added a / at the end and it doesn't work. PYTHONPATH does not contain spaces. I tried to echo $PYTHONPATH and got a newline, which was weird. Commented Jun 18, 2011 at 16:01
  • There's more to this story. Something else in your initialization files (e.g. .bashrc, .profile, .bash_profile) is using or setting PYTHONPATH in an unexpected way. Can you find it? Commented Jun 18, 2011 at 17:01
  • It sounds to me like there's an invisible character on that line of the .bashrc messing things up. Can you view it with something that shows invisibles and see if anything turns up? Commented Jun 18, 2011 at 18:05

1 Answer 1

2

I would guess that the comments about there being spaces in are spot on, to handle that, quote the right-hand side:

export PYTHONPATH="$PYTHONPATH:$HOME/src/Cython-0.14.1"

Can you share what the current value of PYTHONPATH currently is? Perhaps with something like:

echo $PYTHONPATH | tr : \\n

So it's split across multiple lines and easier to read.

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

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.