Installation problem, development environment

I am installing on a clean (just installed) Ubuntu 18.04(.3), and following the instructions for installation for development on the indico site.
All goes exactly as expected up to the step:

“pip install -e .”

at which point I get an ERROR:
ERROR: Package ‘indico’ requires a different Python: 2.7.17 not in ‘~=3.9’

The default Python is indeed 2.7.17, and I am stumped.
Any helpful ideas?
Thanks,

Use the 2.3-maintenance branch if you want to develop on the stable version. master is for Indico 3 which requires Python 3.9.

Thanks for that helpful hint.

This opens up a lot of questions, however, about the feasibility of developing
agains the stable (2.3) version:
-is version 3 coming soon (ie. within the next 6 months)?
-are there structural differences between versions 2.3 and 3 that would render
any halfway (or even fully) developed 2.3-plugins useless?

  • etc.

Nobody wants to waste time developing for /dev/null.

regards

is version 3 coming soon (ie. within the next 6 months)?

Certainly. More like within the next 2 months I hope.

are there structural differences between versions 2.3 and 3 that would render any halfway (or even fully) developed 2.3-plugins useless?

No. In fact, when porting the Zoom plugin this is all that needed to be changed. And the majority was fully automated by using modernize --no-diffs -n -w -x import vc_zoom/, then pyupgrade --py38-plus vc_zoom/**/*.py and some cleanups (removing unused six imports, isort, flake8) plus minor bugfixes (for some reason a case of viewitems() didn’t get automatically replaced with items()).

I am trying to install the Development version of Indico by following the instructions provided on this page.

I got two errors. The first one was with venv being not compatible. I ran sudo apt-get install python3-venv and it got fixed.

Now I have python3.8-venv.

When I run pip install -e '.[dev]', I get ERROR: Package 'indico' requires a different Python: 3.8.10 not in '~=3.9.0'.

I have tried different ways to fix this but none works.

You need Python 3.9 - that’s why the setup guide uses pyenv.

1 Like

I am really sorry to do this. I am having problem just setting up the pyenv, giving me the above error. What am I doing wrong.

# Install Dependencies
sudo apt-get install -y make build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev \
libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python-openssl


# Intall Pyenv
curl https://pyenv.run | bash

export PATH="$HOME/.pyenv/bin:$PATH"
export PATH="$PYENV_ROOT/bin:$PATH"

if command -v pyenv 1>/dev/null 2>&1; then
  eval "$(pyenv init -)"
fi


exec "$SHELL" # Or just restart your terminal

pyenv install --list | grep " 3\.[678]"

mkdir -p ~/dev/indico/data

cd ~/dev/indico
pyenv install 3.9.10

pyenv local 3.9.10

apt install python3.9-venv

python -m venv env

after adding the repo and plug ins dir

source ./env/bin/activate
pip install -U pip setuptools wheel

cd src
pip install -e '.[dev]'

I get

ERROR: Package 'indico' requires a different Python: 3.8.10 not in '~=3.9.0'.

I tried several solutions including:

  • Delete system Python installations

  • set Pyenv global as well as local to 3.9.10

No success.

Sounds like your pyenv isn’t active… how does your $PATH look like? And without the venv etc, what does python -V tell you? It should be Python 3.9.*

apt install python3.9-venv is not needed btw.

1 Like

I did

alias python=/home/vagrant/.pyenv/versions/3.9.10/bin/python

Now python -V gives me 3.9.10

If I do not install venv separately, I get

Error: [Errno 71] Protocol error: 'lib' -> '/home/vagrant/dev/env/lib64'

$PATH outputs this

bash: /home/vagrant/.pyenv/plugins/pyenv-virtualenv/shims:/home/vagrant/.pyenv/bin:/home/vagrant/.pyenv/plugins/pyenv-virtualenv/shims:/home/vagrant/.pyenv/bin:/home/vagrant/.pyenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin: No such file or directory

I think there must be something wrong with your environment. Unfortunately it’s hard to debug such things without having a shell in that environment, but I’d have a look at the docs on https://github.com/pyenv/pyenv/ whether you can find anything useful. In any case I recommend making sure hat pyenv is working correctly before doing any steps regarding Indico.

PS: If your distribution has Python 3.9, you could even skip pyenv altogether - in that case using python3.9 -m venv ... should create a virtual environment using Python 3.9.

1 Like

Cool. I’ll try that. I’ll try different servers too. The problem might even be with Vagrant. Thank you for your valuable support. :fist_right: