1

I recently installed python3 only to realize that mysql-python as well as many other modules were not well supported with it yet. So I changed the path in my bashrc file to point to an installation of python 2.7. The problem is that when I installed python 3 I also installed distribute and pip along with it. I removed the pip and distribute files from the python3 bin directory and installed setuptools and pip using python 2.7 however now when I use the pip command to install django and mysql-python, I get a bash error python331/bin/pip No such file or directory. It's still looking for pip in the python3 install. How can I remedy this?

Thanks

3
  • You should have used virtualenv. Commented May 3, 2013 at 16:34
  • and seeing as I did not, any suggestions? Commented May 3, 2013 at 16:36
  • If I had a suggestion, it would be an answer. Commented May 3, 2013 at 16:36

2 Answers 2

1

...I get a bash error python331/bin/pip No such file or directory. It's still looking for pip in the python3 install. How can I remedy this?

bash, by default, hashes the locations of commands to avoid searching $PATH each time, so if, when you execute...

$ type pip

...you get something like...

pip is hashed (python331/bin/pip)

...you just need to clear the hash table for bash with...

$ hash -r

...then it'll pick up the version in Python 2.7 the next time you try to run pip.

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

Comments

0

Fixed it.

Renamed the directory of where the python3 was installed, bash automatically looks for the next available python install python 2.7

1 Comment

I have ec2 instance where python2.6 and 2.7 are available but I want to use only python2.7 directory. It takes by default 2.6. How can I do this.

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.