Centos 7 setup - No matching distribution found for octoprint

What is the problem?
Trying to setup Octoprint via pip on Centos 7 server:
pip install octoprint -> "no matching distribution found for octoprint"

How can I fix this?

Thanks!

What did you already try to solve it?

[root@sircentos OctoPrint]# python --version
Python 2.7.5

(venv) [root@sircentos OctoPrint]# pip install pip --upgrade
Successfully installed pip-19.3.1

(venv) [root@sircentos OctoPrint]# pip install octoprint
DEPRECATION: Python 2.7 will reach [...]
ERROR: Could not find a version that satisfies the requirement octoprint (from versions: none)
ERROR: No matching distribution found for octoprint

(venv) [root@sircentos OctoPrint]# pip install octoprint==1.3.12
DEPRECATION: Python 2.7 will reach [...]
ERROR: Could not find a version that satisfies the requirement octoprint==1.3.12 (from versions: none)
ERROR: No matching distribution found for octoprint==1.3.12

(venv) [root@sircentos OctoPrint]# pip install --no-cache-dir octoprint
Collecting octoprint
Could not find a version that satisfies the requirement octoprint (from versions: )
No matching distribution found for octoprint

Additional information about your setup (OctoPrint version, OctoPi version, printer, firmware, browser, operating system, ... as much data as possible)

[root@sircentos ~]# yum update
[...]
No packages marked for update

[root@sircentos ~]# yum install python-pip python-devel python-setuptools python-virtualenv git libyaml-devel
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile

  • base: pkg.adfinis-sygroup.ch
  • epel: pkg.adfinis-sygroup.ch
  • extras: pkg.adfinis-sygroup.ch
  • updates: pkg.adfinis-sygroup.ch
    Package python2-pip-8.1.2-10.el7.noarch already installed and latest version
    Package python-devel-2.7.5-86.el7.x86_64 already installed and latest version
    Package python-setuptools-0.9.8-7.el7.noarch already installed and latest version
    Package python-virtualenv-15.1.0-2.el7.noarch already installed and latest version
    Package git-1.8.3.1-20.el7.x86_64 already installed and latest version
    Package libyaml-devel-0.1.4-11.el7_0.x86_64 already installed and latest version
    Nothing to do

I have installed too the "Development Tool" group.

[root@sircentos ~]# uname -a
Linux sircentos 3.10.0-1062.9.1.el7.x86_64 #1 SMP Fri Dec 6 15:49:49 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

[root@sircentos ~]# cat /etc/system-release
CentOS Linux release 7.7.1908 (Core)

In a case like this, it sounds like you might need to install it manually.

sudo yum install unzip
# Create the virtual environment
cd ~
virtualenv oprint
# Get the code
mkdir ~/OctoPrint
cd ~/OctoPrint
wget https://github.com/foosel/OctoPrint/archive/1.3.12.zip
unzip 1.3.12.zip
cd somewhere # (Do an ls and find out what folder is here, then cd into it)
# Activate the virtual environment
source ~/oprint/bin/activate
# Install OctoPrint from your local folder
pip install .
1 Like

OctoPrint requires at least python 2.7.9. 2.7.5 is way way way too old.

1 Like

Thank you for the reply.

This works as well!

That's true, infact the installation fails with the error:
OctoPrint requires Python '>=2.7.9,<3' but the running Python is 2.7.5

I have installed the 2.7.9 version but I'm not able to use it...

[root@sircentos ~]# python --version
Python 2.7.5
[root@sircentos ~]# python2.7 --version
Python 2.7.9

[root@sircentos OctoPrint]# virtualenv --python=/usr/bin/python2.7 venv
Running virtualenv with interpreter /usr/bin/python2.7
New python executable in /root/OctoPrint/venv/bin/python2.7
Also creating executable in /root/OctoPrint/venv/bin/python
Installing setuptools, pip, wheel...done.
[root@sircentos OctoPrint]# source venv/bin/activate
(venv) [root@sircentos OctoPrint]# python2.7 --version
Python 2.7.5

How can I solve?

Thanks.

Solved:
recompiling python was the solution, with some plus:

yum install openssl openssl-devel

cd /tmp/Python-2.7.9 [-setup folder-]
./configure
make
make altinstall

cd ~/OctoPrint
virtualenv -p python2.7 venv
source venv/bin/activate

Thanks.

1 Like