I have 2.7 version of Python installed on my computer and many projects built on that version. What would be the best way to upgrade cleanly and get rid those old projects.
Depends on your OS. I would google “how to upgrade python OS” replacing OS with the OS you are running.
Do follow the Google this advice, and be very careful here, but process should [in an ideal world] be:
Install a version manager (pyenv I think, it’s been a while since I’ve used Python).
Install Python 2.7 using pyenv
Install Python 3.x using pyenv.
Set global as 2.7 using pyenv.
Work through each project setting its Python version to 3.x. Stuff will inevitably break for that project as you upgrade, but everything outside of it will be fine as either upgraded or still on 2.7 ().
- If you are switching between two major releases, for example 2.7.x to 3.3.x: Keep them side by side. They will be installed in different directories, named after their version. Have your PATH variable point to the older version and link the shortcut to newer version (python.exe in installation folder).
- If you are switching between two minor releases, just install one over the other. Download latest version from their website and run it. It will remove the previous version and update automatically.
You can also install a major release over a minor release without keeping it, just make sure your path variable is pointing to the right thing. I started pretty late, so I have been using version 3.x from the start.
Oh, and do look at the changes they made moving from 2.7.x to 3.3.x, you might wanna work with both.
I hope this will help you