0

I'm new to python. I installed python3.4 on OsX some time ago and now I installed python3.5 using the installer you can download from the site.

I noticed that in /Library/Frameworks/Python.framework/Versions/ I have both 3.4 and 3.5. I wasn't expecting that - I was expecting an upgrade where 3.5 replaced 3.4

So, if I run python3.5 and I try to import the packages I installed when using 3.4, they are not found. Furthermore if I use pip install to reinstall them, it says the packages are already installed, therefore I can see that it's pointing to the 3.4 version.

What I'm doing wrong? I supposed that installing the new python should upgrade my existing installation (bringing installed packages with it) rather than add a completely new install.

I'm not sure what to do now:

  1. Should I keep every old version?
  2. Should I manually change which pip is used every time?
  3. (is there a more streamlined update procedure for next time?)
4
  • 1
    I don't know OS-X and the suggestion about virtual envs below is good. The other thing to check is that the pip you are using is the one that corresponds to 3.5 and not to 3.4. Each version of python will have its own pip script, I think. Commented Sep 18, 2015 at 15:46
  • indeed, updated my question Commented Sep 18, 2015 at 15:54
  • you could make some aliases, I guess, e.g. pip35 and pip34. I'll back out now though - someone who knows OS-X well will probably be along to help... Commented Sep 18, 2015 at 15:58
  • 1
    Ah, hang on, I get it now - why doesn't it update rather than just adding a new version - is that what you mean? Commented Sep 18, 2015 at 16:01

1 Answer 1

3

A lot of Python packages are 3rd party. The community is always moving forward and this may take some getting used to!

That said, my recommendation is to start using venv. It gives you (mostly) isolated Python virtual environments in which you can install whatever packages you like (via pip) without polluting the global installation. This also allows you to configure various virtual environments with varying packages and versions. It's really handy!

Link: https://docs.python.org/3.4/library/venv.html

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

1 Comment

yep, thanks for the venv suggestion. I do use it infact. I was just wondering why python isn't actually updating but is just installing a new version leaving the old one in place. I updated my question

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.