Installing from source can be done, of course, but I would be hesitant to upgrade my Ubuntu systems' python package from source for several reasons:
Doing so could break the system by doing a straight compile from source(I'm not exactly certain how Ubuntu customizes their Python package builds).
I would be concerned that there might be issues with using modules from the repositories going forward.
There is a PPA that looks active(the 2.7.x train was last built in April of this year), but the PPA doesn't yet have a 2.7.5 build. You may want to ping the maintainer and see what their plans are for future builds and if they are going to include one for 2.7.5. If possible, I would recommend this over installing from source. As with any new software, I would recommending building this out on a test system first.
Another option is to use a sandbox(pyenv
) to run any new untested software package. A straight installation onto your system could adversely impact the operation of your machine.
The package pyenv will allow one to install a non-system Python version on your box without impacting the main Python package installed on your machine( Again: Your system is dependent on the currently installed version of Python and upgrading it could break your system). Previously, Pythonbrew was recommended for isolating python packages from the system, but that has since been deprecated and superseded by the pyenv
package.
The pyenv
package provides the following functionality:
- Lets you change the global Python version on a per-user basis.
- Provides support for per-project Python versions.
- Allows you to override the Python version with an environment variable.
- Search commands from multiple versions of Python at a time.
Installation
Check out pyenv into ~/.pyenv.
git clone git://github.com/yyuu/pyenv.git .pyenv
Add ~/.pyenv/bin to your $PATH for access to the pyenv command-line utility.
echo 'export PATH="$HOME/.pyenv/bin:$PATH"' >> ~/.bash_profile
Zsh note: Modify your ~/.zshenv
file instead of ~/.bash_profile
.
Add pyenv init to your shell to enable shims and auto-completion.
echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
Zsh note: Modify your ~/.zshenv
file instead of ~/.bash_profile
.
Restart your shell so the path changes take effect. You can now begin using pyenv.
exec $SHELL
Install Python versions into ~/.pyenv/versions. For example, to install Python 2.7.5, download and unpack the source, then run:
pyenv install 2.7.5
NOTE If you need to pass configuration options to build from source, please use CONFIGURE_OPTS environment variable.
Rebuild the shim binaries. You should do this any time you install a new Python binary (for example, when installing a new Python version, or when installing a package that provides a binary).
pyenv rehash
sudo make **install**
instead ofsudo make **altinstall**
? Do you get the same error?