Python3.8 on Ubuntu 14.04 - ubuntu-14.04

I am trying to install Python3.8 on Ubuntu 14.04, I get this error:
E: Unable to locate package python3.8 E: Couldn't find any package by
regex 'python3.8'
Is it even possible to have python3.8 on Ubuntu that is that old? If it is possible, please tell me how.
EDIT
When installing from source ( I followed that instruction)
I get this error:
Fatal Python error: _PySys_InitCore: can't initialize sys module
Python runtime state: preinitialized
Current thread 0x00002ab78e1b3740 (most recent call first): generate-posix-vars failed make: *** [pybuilddir.txt] Error 1

An alternative solution could be to compile python statically on a newer system. Then such binaries can be transferred to the target system.
Compilation tested on vanilla Ubuntu 20.04 LTS
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.1 LTS"
$ sudo apt-get install build-essential checkinstall
$ sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev \
libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev
$ wget https://www.python.org/ftp/python/3.8.6/Python-3.8.6.tgz
$ tar xzf Python-3.8.6.tgz
$ cd Python-3.8.6
$ ./configure LDFLAGS="-static" --disable-shared
$ make LDFLAGS="-static" LINKFORSHARED=" "
....
$ cd ..
$ zip -r Python-3.8.6.zip Python-3.8.6
Transfer Python-3.8.6.zip to target sysytem
$ unzip Python-3.8.6.zip
$ cd Python-3.8.6
$ ./python
Of course you would have to do
make install
or clean this folder, that's your choice.

Normally, as long as you are not using any kind of dockerization/paravirtualization, simple:
sudo snap install python38
should work.

Related

Trying to install TA-lib

I'm using gcp debian VM, and trying to install the module TA-lib doing this (with the tar already downloaded):
$ tar -xzf ta-lib-0.4.0-src.tar.gz
$ cd ta-lib/
$ ./configure --prefix=/usr DOING THIS I GET AN ERROR
$ make
$ sudo make install
configure: error: no acceptable C compiler found in $PATH
How can I solve?

how to install gcc-12 on ubuntu

$ sudo apt search gcc-12
Sorting... Done
Full Text Search... Done
$ uname -a
Linux Han 5.10.81.1-microsoft-standard-WSL2 #1 SMP Mon Nov 22 18:52:15 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
I am using the default sources.list file, I want to install gcc-12 but I can't find it in the mirror source, what should I do!
gcc-12 is not available in ubuntu 20.04, so we need to compile it from source code, here are the steps which I borrowed from this video:
Step 1: clone gcc source code and checkout gcc-12 branch
$ git clone https://gcc.gnu.org/git/gcc.git gcc-source
$ cd gcc-source/
$ git branch -a
$ git checkout remotes/origin/releases/gcc-12
Step 2: make another build dir
Note this is important as running ./configure from within the source directory is not supported as documented here.
$ mkdir ../gcc-12-build
$ cd ../gcc-12-build/
$ ./../gcc-source/configure --prefix=$HOME/install/gcc-12 --enable-languages=c,c++
Step 3: installing GCC prequisites and run configure again
The missing libraries will be shown in above ./confgiure output, search and install them one by one.
$ apt-cache search MPFR
$ sudo apt-get install libmpfrc++-dev
$ apt-cache search MPC | grep dev
$ sudo apt-get install libmpc-dev
$ apt-cache search GMP | grep dev
$ sudo apt-get install libgmp-dev
$ sudo apt-get install gcc-multilib
$ ./../gcc-source/configure --prefix=$HOME/install/gcc-12 --enable-languages=c,c++
An alternartive is to run the download_prerequisites script.
$ cd ../
$ cd gcc-source/
$ ./contrib/download_prerequisites
$ ./../gcc-source/configure --prefix=$HOME/install/gcc-12 --enable-languages=c,c++
Step 4: compile gcc-12
$ make -j16
Still flex is missing:
$ sudo apt-get install flex
$ ./../gcc-source/configure --prefix=$HOME/install/gcc-12 --enable-languages=c,c++
$ make -j16
$ make install
Another way is to use Ubuntu 22.04 where gcc-12 is available. In Ubuntu 22.04, gcc-12 can be installed with apt:
$ sudo apt install gcc-12
You can use Homebrew to install pre-built binaries.
Follow instructions to install Homebrew at https://brew.sh/, then
brew install gcc for default GCC (currently 11) or brew install gcc#12 for gcc-12.
Note that it may compile missing dependencies.
I would add if you are adding for 64 bit only, you'll want to add "--disable=multilib" to the end of your configure statement.

Could not find a version that satisfies the requirement tensorflow==1.15.3 (from ludwig)

So i am aiming to install Ludwig for experimentation but i didn't found any solution on the internet to this issue enter image description here
screenshot of the error message
i am using windows subsytem for linux (debian)
Your python version is probably unsupported by tensorflow 1.15.3. I ran into the same issue trying to install with python 3.8.
https://github.com/tensorflow/tensorflow/issues/34302
When I compiled Ludwig from GitHub source, there were a lot of dependencies to patch. I experienced the same error message and I gave up solving it.
I retried with clean installation from the very beginning, I managed to install Ludwig successfully on Google Cloud - Debian 9 VM.
Now I redo the steps on Oracle Cloud - Ubuntu 20.04 VM.
Steps:
Ensure the following dependencies are ready, which I consolidate from various sources.
$ sudo apt update
$ sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev curl libbz2-dev lzma liblzma-dev python3-tk
Clean install Python 3.6. I choose to use older Python 3.6 to execute Ludwig, because Ludwig is using the old Tensorflow 1.15.3. I reserve Python 3.7 and 3.8 environment for other newer Python projects, for example Tensorflow 2.
# Simply use a temporary working folder.
$ cd /tmp
# Download the newest Python3.6 source.
$ curl -O https://www.python.org/ftp/python/3.6.12/Python-3.6.12.tgz
$ tar -xzvf Python-3.6.12.tgz
$ cd Python-3.6.12
# --prefix=/usr/local ensures the newly installed Python3.6 does not mess up with the default Python executables in the OS. This is specially warned in Google Cloud.
$ ./configure --prefix=/usr/local --enable-optimizations
$ sudo make altinstall
$ python3.6 --version
Python 3.6.12
# Upgrade pip and virtualenv
$ sudo python3.6 -m pip install --upgrade pip
$ sudo python3.6 -m pip install --upgrade virtualenv
Prepare the virtual environment for Ludwig.
Reference https://ludwig-ai.github.io/ludwig-docs/getting_started/#installation.
# Go back to home.
$ cd
# Create a Working directory.
$ mkdir Works
$ cd Works
# Initialize a virtual environment with Python3.6
$ virtualenv -p python3.6 ludwig
$ source ludwig/bin/activate
# Install Ludwig
$ pip install ludwig
You can see every dependencies are taken care of and Ludwig is ready to use.
$ pip list
Package Version
-------------------- -------
... ...
ludwig 0.2.2.8
...
tensorflow 1.15.3
...
# Execute Ludwig
$ ludwig

How to install python3.4 in home 'not root'? ensurepip failure

I do not have root privileges on the Red Hat Linux machine I am installing python3.4 on.
Downloaded Python-3.4.1.tgz
tar -xzf Python-3.4.1.tgz
./configure
makealtinstall --with-ensurepip=install prefix=~ exec-prefix=~
Python3 does install, but I don't have pip.
I get the following error:
Ignoring ensurepip failure: pip 1.5.6 requires SSL/TLS
I don't have root access so I cannot install via:
sudo apt-get install libssl-dev openssl
I do have a working version of openssl.
Does anyone have suggestions I could try?
Since you are in RedHat, you have to install openssl-devel
yum install openssl-devel
Or you can install it later with get-pip.py
The complete procedure for installing Python 3.4 with pip3/pip3.4 on RHEL7 is below. For Ubuntu 12.04 LTS replace yum with apt-get, openssl-devel with libssl-dev and you are good to go:
sudo yum install -y gcc make openssl-devel openssl
wget https://www.python.org/ftp/python/3.4.3/Python-3.4.3.tgz
tar -xf Python-3.4.3.tgz
cd Python-3.4.3/
./configure --with-ensurepip=install
make
make install
Alternatively, you can run make altinstall depending on whether you need create python link or not.

Error while building Boot to Gecko

I was trying to build B2G for emulator, but I've got an error.
Environment:
Ubuntu 12.04.1 x64
gcc 4.6.3
Install: out/host/linux-x86/bin/traceview host SharedLib:
libGLES_CM_translator
(out/host/linux-x86/obj/lib/libGLES_CM_translator.so) /usr/bin/ld:
cannot find -lGL collect2: ld returned 1 exit status make: *
[out/host/linux-x86/obj/lib/libGLES_CM_translator.so] Error 1
real 1m33.903s user 0m46.539s sys 0m6.088s
Build failed! <
How do I fix it?
Firefox OS build prerequisites
When building on 64-bit Ubuntu, you may find that you need to add symlinks for the 32-bit >versions of libX11.so and libGL.so:
$ sudo ln -s /usr/lib/i386-linux-gnu/libX11.so.6 /usr/lib/i386-linux-gnu/libX11.so
$ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
Here you should find the solution to your problem.
#> sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib mingw32 openjdk-6-jdk tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386
and then:
#> sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
from the Firefox OS wiki (Firefox OS build prerequisites), about building on Ubuntu 12.04 x64:
$ sudo apt-get install autoconf2.13 bison bzip2 ccache curl flex gawk gcc g++ g++-multilib git ia32-libs lib32ncurses5-dev lib32z1-dev libgl1-mesa-dev libx11-dev make
and then,
$ sudo ln -s /usr/lib/i386-linux-gnu/libX11.so.6 /usr/lib/i386-linux-gnu/libX11.so
$ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so /usr/lib/i386-linux-gnu/libGL.so
I had the exact same error while compiling Android. The following fixed it:
sudo apt-get install libgl1-mesa-dev:i386
I did not have to create any symbolic links or anything, just this simple install

Resources