7

How can I install python3-dev in Oracle Linux?

yum install python3-dev is not working.

It gives a message:

No package python3-dev available.

I need python3-dev to convert a python script to Linux executable using Cython.

I tried to search rpm files, that also did not work.

Bellerofont
  • 1,081
  • 18
  • 17
  • 16
Harmeet Kochhar
  • 71
  • 1
  • 1
  • 2
  • Check this link : http://stackoverflow.com/questions/10763440/how-to-install-python3-version-of-package-via-pip-on-ubuntu – CodeChanger Jan 31 '17 at 12:21

4 Answers4

5

friend, OL6 and OL7 repo havent python 3, only 2

OL7 official repo
OL6 official repo

then:

wget https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tar.xz
xz -d Python-3.6.5.tar.xz
tar -xvf Python-3.6.5.tar
cd Python-3.6.5
./configure
make
make test
sudo make install

if no step goes wrong, take a coffe, wait about 10 minutes in make test phase and be happy.

Marcelo Guedes
  • 1,419
  • 11
  • 10
4

The hard way is with the following statements:

Note I used oraclelinux:7-slim docker container

yum -y install wget \
    && yum -y install gcc readline readline-devel \
    && yum -y install zlib zlib-devel \
    && yum -y install libffi-devel openssl-devel \
    && yum -y install tar gzip \
    && yum -y install make \
    && yum clean all

  wget https://www.python.org/ftp/python/3.7.5/Python-3.7.5.tgz \
     && tar -xf Python-3.7.5.tgz \
     && cd Python-3.7.5 \
     && ./configure --enable-optimizations \
     && make \
     && make test
     && make install

And the easy way is:

yum update \
&& yum -y install python3
cjeronimomx
  • 806
  • 10
  • 9
3

When I stumbled into the same problem the links provided in the other answers didn't work and I didn't want to work out dependencies to install from source.

An easy way to install Python3.6 on Oracle Linux that I found is described in this blog. Here are the three easy steps:

sudo yum install -y yum-utils
sudo yum-config-manager --enable *EPEL
sudo yum install -y python36

I've tested it to work on the 7-slim tag of the official docker image. Naturally, there I had to drop the sudo prefixes.

mapto
  • 605
  • 9
  • 23
2

If you want to use RPMs from Oracle Linux, you can install Python 3 via Software Collections.

Check the Oracle documentation on how to enable Software Collections on your Oracle Linux server and then install Python 3: https://docs.oracle.com/cd/E52668_01/E59096/html/index.html

Djelibeybi
  • 78
  • 7