2

My Mac came installed with python 2.7 as the default python version. But, this version is no longer supported by many packages and software. I searched several online forums regarding how to change the default python version on mac. But, none of them seem to work. I also installed the latest version of python, and if I type:

python --version

It returns the version as python 3.8. But if I try to install packages like Biopython, I get an error like this -

defaulting to user installation because normal site-packages is not writeable

Collecting biopython Using cached biopython-1.77.tar.gz (16.8 MB)

ERROR: Command errored out with exit status 1:

Biopython requires Python 3.6 or later. Python 2.7 detected

I am really finding it difficult to install many packages required for my work. Any help or suggestions would be greatly appreciated.

Thank you.

8
  • How exactly are you attempting to install it? Commented Nov 30, 2020 at 6:50
  • Hello, I am using the following command - pip install biopython. If any changes are to be made, please let me know Commented Nov 30, 2020 at 7:47
  • Whichever pip you are running apparently belongs to Python 2.7. Does it help if you use pip3? Or the full path to your 3.8 pip? Or the full path to Python 3.8 followed by -m pip? Commented Nov 30, 2020 at 8:00
  • Hello, I tried using pip3 install biopython, and biopython was installed. But, if I try to run a simple script, I am getting this error : [ImportError: No module named Bio] Commented Nov 30, 2020 at 8:26
  • We really need to see more details about where each version of Python is installed, what your sys.path looks like, and where the modules are installed. All of this should be easy to find from numerous duplicates. Commented Nov 30, 2020 at 8:35

1 Answer 1

1

Probably, you just have to change your Python symbolic link.

Please check this, and you will get it: https://dev.to/malwarebo/how-to-set-python3-as-a-default-python-version-on-mac-4jjf

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

3 Comments

Hello, I have already tried the method suggested by you and that is the reason why I am getting python 3.8, when I type the following command (python --version). But, when I try to install Biopython using (pip install biopython) - I am getting the above error and biopython throws an error saying that my 'default version of python is 2.7'.
that's because your pip is also a symbolic link to your python 2.7 instalation. Try "pip3 install biopython" and it will work. Also, to make your pip command point to pip3, please follow this link: stackoverflow.com/questions/44455001/…
Thank you for the response. @tripleee suggested the same solution before and I executed it and Biopython was successfully installed....Cheers:)

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.