Last year I’ve given a workshop about packaging Python projects. One of the participants was a bioinformatics researcher. She needed advice because she wanted to switch from Python 2 to Python 3, but a library she needed was only available for Python 2. Moving the library to Python 3 was pretty interesting and I’ll share here how I did it — or rather how I would do it if I had the same situation again.

Local Setup

Make sure you can execute Python 2 and Python 3 locally. I like pyenv for that:

$ pyenv install 2.7.18
$ pyenv install 3.8.5
$ pyenv local 3.8.5
$ pip --version

Alternatively, you can use conda to switch between Python 2 and 3.

#python3 #python #programming #python2

How to moved a Library from Python 2 to Python 3
3.65 GEEK