Installing Python2.7 over Python3.3 - python

I'm running Windows 7 and I currently have python 3.3 installed on my system. I need to install the python 2.7 interpreter so that I can work with some outdated code, and I don't want to uninstall Python 3.3. Does anyone know how to do this without reinstalling IDLE and duplicating the system files that python33 and python27 have in common? Thanks.

As both the python versions are installed in different folders, so you need not worry about it.
You can use set "PYTHONPATH=%PYTHONPATH%;C:\My_python_lib" command in windows to temporary change the default python version to use.
While working on the projects requiring different python, you can use virtual environment approach. The following link will help you on this topic: http://docs.python-guide.org/en/latest/dev/virtualenvs/
This is widely used concept by python developers.

just install them in different folders.

When you install python 2.7 , it will be automatically be installed in a different folder just go into that folder and run python idle from there.

Related

How to uninstall python?

I had uninstalled python 3.10 because I want to run python 3.7.5
so I uninstalled all and there is no python folder or files in C drive.
but the registry have lots of python files and I don't know how to clean up this all files
One of the comments above has shown you the correct way to uninstall any version of Python.
If you have to use multiple versions of Python, it's recommended to use a version manager. Some good choices are Conda and pyenv-win.

Would it be dangerous to uninstall Python

I plan on uninstalling and reinstalling Python to fix pip. I, however, have a lot of python files which I worked hard on and I really don't want to lose them. Would my Python files be okay if I uninstalled Python?
If you are using Linux and a distribution like Ubuntu, you will definitely break the OS. Don't do it.
Moreover, there is no evidence that your installation is broken because of Python, and you may probably not solve your problem.
Your Python files are not specially managed by Python itself. If you uninstall Python, source code files (files with the .py extension) won't be affected.
There's no harm I can see in overwriting a pip installation. So, just follow the instructions and let us know if you have further problems:
Download get-pip.py.
Run python get-pip.py and get on with the rest of your stuff.
Before uninstalling python, make sure all your python applications support the new python version.
My suggestion is to create virtual environments in your system to use multiple python versions
Try Anaconda - https://www.anaconda.com/ to create multiple virtual environments, where you can run a python version on each environment.
It depends on whether you installed the Python or it came with the OS.
If you installed Python, it’s no problem at all — your files are safe and uninstalling Python won’t touch them.
If you’re planning on uninstalling the Python that came with your OS, I’d advise not do do that — it could cause a whole lot of trouble. Instead, you could install a new version of Python into your user directory and link to it by adding its location to the PATH variable used by your shell.

Upgrade Python on Mac from 2.7 to 3.6 (or newest) for elastic beanstalk client AWS

I'm trying to follow the instructions here but no matter what I do it seems to be stuck on using Python 2.7.1 which is causing me errors currently.
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3-install-osx.html
Attached is an image showing my logs of upgrading to the newest awsebccli but its still stuck saying 2.7.1 when it should say 3.6 (or newer)
What could I be doing wrong?
I want to note that I also installed the newest version of python3 and python via brew.
Here is the exact error I'm getting if it helps also.
You do not want to upgrade the default python 2.7x installation or the python 3.x installation available on linux or OSX. There are usually lots of other libraries and applications that depend on this default installation. When you want to use a specific version of python the approach is to rely on a virtual enviorenment.
virtualenv is a tool to create isolated Python environments.
You are then leaving the system installation untouched. Getting the hang of virtualenv is quite easy. Once you create it (a one off task). All you need is to activate it and then you can use it as you would normally use the default python interpreter. How to copy packages from one virtualenv (or the system installation) to another is discussed here:
Installing python3 in a python2 virtual environment

How to find out if I still have Python 2.7 on Mac? Does installing Python 3.3 also uninstall the older package?

Could there possibly be hidden files that I would need to find. Or do I have to re-install Python 2.7 if I want to work with it?
Thanks
Python installations on OS X generally go in separately and don't uninstall each other. Also, the convention is still for the executable python to refer to 2 and python3 to refer to 3, so they don't even really overlap.
Common locations you might have python include
/usr/bin/python (the system installed one, probably an osx specific 2.7.5)
/Library/Frameworks/Python.framework/Versions/... This is where the ones you install from Python.org go, separately for each version.
Your homebrew directory if you are using that
Which one runs when you type python (or python3) depends on your PATH environment variable.
python --version - will give you the version of the currently used python in environment variable PATH.
Nothing gets uninstalled. You have to just adjust the PATH variable according what you will be using.

Python Versions on Mac

I'm working on Mac Os 10.7 (Lion) and I have some questions:
What is the pre-installed version of python on Lion?
I've been working on this computer for some time now, and i've installed lots of software in order to do college work many times I didn't know what I was really doing. The thing is: now I hava on the /Library/Frameworks/Python.framework/Versions/ a folder called "7.0" I'm pretty sure there no python version 7. Is this folder native or a third-part program installation. Can I delete it? (it's using 1 Gb on disk).
Where is located the original python that comes with mac os?
I've choose Homebrew as my package manager, is there a easy way to manage python versions with it?
Lion uses Python 2.7 by default; 2.5 and 2.6 are also available.
/Library/Frameworks/Python.framework does not exist on a stock install of Lion. My guess is that you've ended up with this by installing some application.
The default Python install is primarily installed in /System/Library/Frameworks/Python.framework, although some components are located elsewhere.
Yes - you can brew install python#2 to get a Python 2.7 separate from the system version, or brew install python to get Python 3.7. Both will install to /usr/local, like any other Homebrew recipe.
I think that is Python 2.7 but you can check typing python on a command terminal. It will tell you the version.
I couldn't tell that you can deleting it, because I don't know what it has... can you give more info about it?
Just type "which python" and it will tell you
You should use virtualenv and pip: http://jontourage.com/2011/02/09/virtualenv-pip-basics/

Categories

Resources