Uninstalling Python3.5 from Linux RHEL - python

I installed Python3.5 in Linux machine using configure, make, make install and made it default over existing Python2.6 . Now I want to uninstall Python 3.5 as it is not supporting zlib. How do I uninstall default Python 3.5. Linux is RHEL6.7.

you probably can remove the directory that contain the new installation.
but the main thing is to remove it from the $PATH.

To re-add Python 3.x, go here to use a software collection which installs "along side" the original 2.6 - so no collisions/corruption. http://developers.redhat.com/products/softwarecollections/get-started-rhel6-python/
This is for 3.4, but you can use these instructions for 3.5 too.

Because python is integral into the RHEL OS, please explain what you mean by:
"and made it default over existing Python2.6 ." Otherwise attempts to "uninstall" your working python install might leave you with a broken RHEL install.

Related

Accidentally installed python 3.5 vs. python3.5 : Is this bad?

I run Linux Mint with Python 3.4.x pre-installed. I'm starting a new project and wanted to take advantage of 3.5ish stuff so I decided I would install 3.5 and create my new virtual environment pointing to it.
So, I by accident typed
sudo apt-get install python 3.5
Which I've since learned is different from
sudo apt-get install python3.5.
I know that is different because the later requires adding a new repository wherein the former I was able to do before I added the deadsnakes repo.
So, I went through the install of "python 3.5" - it asked me some questions about FTP to ined(something) or standalone, then I installed python3.5.
My question(s) is
1) What is python 3.5? (with the space),
2) Did I break anything,
3) Should I uninstall python 3.5 even though the uninstall warns me not to unless I really know what I am doing?
Thank you
Newer versions always have newer patches and fixes. Python 3.5.2 is probably what you installed if you used sudo apt-get install python3.5. There is also Python 3.6 now.
With the space (sudo apt-get install python 3.5) it would mean install python and 3.5 so maybe it just installed/updated python2.
Anyway, having multiple versions is not an issue. You may alias each install and use them as required.
Should I uninstall python 3.5 even though the uninstall warns me not to unless I really know what I am doing?
You shall do that if no other program/dependency is lost. Have you used it in some code? (which wouldn't work if its gone!) If you haven't then go ahead uninstall it.
It's not good. I had the same installing Ruby and accidentally typing:
Don't do this!!
apt install ruby 2.4
It installed the latest Ruby and many gigabytes of packages with 2.4 in the name.
I tried to remove them with
apt remove 2.4
...but it turns out some of these packages are essential for the Operating System.
To list the packages with label 2.4:
apt-cache show 2.4
So uninstalling non-essential packages could be an option if you manage to list them and use that output as arguments for apt remove. But I suppose even then your system may potentially be left unstable.
Luckily I ran the command on a relatively fresh Raspbian install so I'll just do a clean install. Apt install is a surprisingly dangerous command, :D, good luck

python binary version doesnt match rpm version

I have installed manually python (2.7.3). Whoc do I update the rpm version
usr/bin/python -V:
Python 2.7.3
rpm -qf /usr/bin/python:
python-2.6.5-3.el6.x86_64
any suggestions?
linux version: RH6.3
You installed it incorrectly. Instead of make install you should run make altinstall. This will install the new version of Python parallel to existing versions, and create a new executable in $PREFIX/bin with the name of python followed by the minor version of Python installed, e.g. python2.7.
Create a symlink in /usr/bin/ called python2.7, point to to where you have installed the new Python and use that.
Do not attempt to upgrade or force the default python on a redhat box, because a lot of other tools will stop working.

Upgrade Python 2.4 to 2.6 or 3.0

I am running Python 2.4 on Redhat Linux 5.
Any idea how to upgrade to either Python 2.6 or 3.0?
Thanks in advance,
Sum
See before upgrading version is 2.x
python --version
Python 2.7.5
Use below command to upgrade your python to 3.x version-
yum install python3x
replace x with the version number you want.
i.e. for installing python 3.6 execute
yum install python36
After that if you want to set this python for your default version then in bashrc file add
vi ~/.bashrc
alias python='python3.6'
execute bash command to apply the settings
bash
Now you can see the version below
python --version
Python 3.6.3
As with all software on Linux, the first port of call should be the package manager, using it will give you a relatively painless experience most of the time.
In the case of Red Hat, that is yum, so you probably want something like:
yum update python
If there is not a package for the software at hand, then you could download the source code and build it, but note that this is generally a harder route - firstly it's more work, and secondly package maintainers are careful to ensure that software functions correctly on a distro, so they are more likely to work well and interact well with the rest of your system.
It's worth noting that you can have 2.x and 3.x installed side-by-side, and most distros package them separately. As such, to get 3.x, you probably want to do:
yum install python3
(Note I don't use Red Hat, so I don't know for sure that is the correct package name).
As a final point - 2.4, 2.6 and 3.0 are all outdated versions. You really want Python 2.7.2 (the latest 2.x release) or Python 3.3 (the latest 3.x release).

How can I uninstall python 2.6.5 and install the newest version(2.7.3) in ubuntu 10.04

I want to uninstall python 2.6.5, and install python 2.7.3
but there is so many other software relay on it.
so how can I up upgrade python in ubuntu10.04?
I used this link to do the same(i.e the installation part), after doing this the default python version will change to 2.7.3.
Another useful link How do I install python 2.7.2 on 10.04?.
Why do you want to uninstall the old one? You can install python 2.7 and just create a virtualenv that points to it: Use different Python version with virtualenv
Aside from that, it's rather risky to upgrade it, if you don't want to upgrade the whole system.

How many installations of macports do I need

Over the past couple of months I've set about using Wing IDE to do the vast majority of my programming. I chose Wing primarily because it works well with wxPython, allowing me to debug much more quickly than was the case when I was using TextWrangler alongside Terminal. A quirk of Wing however is that there is no satisfactory way to force universal builds of python to run in 32-bit mode. Since I'm using wxPython 2.8.x (32-bit only) I'm using a 32-bit-only version of python as the executable (2.7.1). So long as I'm only using the python standard library and wxPython I have no problems, my trouble begins when I start trying to install third-party modules to work with this 32-bit version of Python. I want to do all my installing using macports, but it appears that the macports I have downloaded installs modules for use only with a different version of python that happens to be universal. Essentially then this is a question about macports, and I'd appreciate clarification on the following two points:
If I want three versions of python on my computer (say 2.6, 2.7 and 3.2), and want to use macports to install modules for each of them, do I need three separate versions of macports - one for each python?
If I'm right about (1) how do I set about installing separate versions? I've looked on the macports website but can find no reference to alternative versions based on which version of python you want to use it with
Help much appreciated.
A Python installed at /Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 almost certainly has nothing to do with MacPorts. You probably installed it from a python.org installer. If you want to install packages to it, you should install separate versions of easy_install using the Distribute package and/or pip for it and directly install packages for that Python instance with them. Those versions will be installed in the framework bin directory, /Library/Frameworks/Python.framework/Versions/2.7/bin. You can't manage Python packages for it from MacPorts; that works only for MacPorts Pythons, i.e. at /opt/local/bin.
So it appears you have three versions of Python 2.7 installed. The Apple-supplied system Python at /usr/bin/python2.7, a MacPorts-installed version at /opt/local/bin/python2.7, and a third (possibly from python.org) at /Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 (for which there is likely a symlink at /usr/local/bin/python2.7). There's nothing inherently wrong about having all three installed and the three can easily co-exist. Just keep in mind which one you are using, either by managing your shell path or using an absolute path to each, and that any additional packages installed need to be installed to the correct Python's site-packages directory. If you use easy_install or pip, you need to install and/or use the correct one for each.
If your goal is just to use wx-python with Python 2.7, there is an outstanding MacPorts issue about building a 32-bit-only version of wx-python because of its dependency on deprecated OS X Carbon APIs. There appears to be a new MacPorts port of a Cocoa version of wxWidgets which should work in 64-bit mode. You might want to experiment with it:
sudo port selfupdate
sudo port install py27-wxpython-devel
No you don't need separate versions of macport, what you need is separate versions of python.
Clear steps to do it :
Install macports. You should be able to use port command after that. You should have /opt/local/bin first in your path automatically, if you are using the installer for Mac.
Install python 2.6 - sudo port install python26
Install python 2.7 - sudo port install python27
You can use python26 through /opt/local/bin/python2.6
You can use python27 through /opt/local/bin/python2.7
If you want to use the python27 as default then do a sudo port python-select python27. This will ensure that /opt/local/bin/python is linked to /opt/local/bin/python2.7.
Mac comes with default python installation which is not removed. It can be accessed from /usr/bin/python.
Macports installs it's tools under path /opt/local and binaries at /opt/local/bin. So now you will have multiple versions of python and located at different location so that you can choose which one to run.
The packages installed with a particular version of python will go in it's site-packages and will not be available to other versions of python installation.
[Edit: based on comments]
I have multiple versions of standard python installation.
~ $ /usr/bin/python
python python2.5 python2.6 pythonw pythonw2.6
python-config python2.5-config python2.6-config pythonw2.5
With python2.5, I get:
>>> print platform.architecture()
('32bit', '')
>>> sys.maxint > 2**32
False
With python2.6, I get:
>>> print platform.architecture()
('64bit', '')
>>> sys.maxint > 2**32
True
See the note at - http://docs.python.org/library/platform.html

Categories