1

I need to build a pipeline which was written in python 2.7. A few dependencies like matplotlib have been upgraded since then to work with Python 3.x, but the original pipeline code is incompatible with python 3.x syntax. While building, I am unable to use Python 2.7 as matplotlib and thereby mayavi refuse to be installed after that. And if I build everything using Python 3.x the final code does not execute because the code is incompatible with python 3.x.

The pipeline I need to run is https://github.com/aestrivex/ielu

Please help.

3
  • This sounds like an XY problem. Why exactly can't you use matplotlib in python 2.7? What is your Ubuntu version? are you using the OS default python, or a 3rd party installation such as anaconda? Jan 9, 2019 at 3:38
  • @steeldriver looks like the repo mentioned wants to use anaconda Jan 11, 2019 at 1:17
  • one possible course of action is to clone that repo and upgrade it to python3 then submit a pull request back to the repo ... however as @steeldriver suggests its probably easier to write your new code using python 2.7 Jan 11, 2019 at 1:19

1 Answer 1

1

You can use pyenv to switch between python versions.

# Get Pyenv
curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash

# add pyenv to ~/.bashrc
echo -e "export PATH="/root/.pyenv/bin:$PATH" \n eval "$(pyenv init -)" \n eval "$(pyenv virtualenv-init -)" " >> ~/.bashrc

source ~/.bashrc

# install python 3 via pyenv
pyenv install 3.5.6

# verify
pyenv versions

# pyenv local <version> : use this to set python version per directory.
# pyenv gloal <version> : use this to set python version globally.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .