Skip to main content Link Menu Expand (external link) Document Search Copy Copied

setting up PYENV and MINICONDA

Pyenv is one of the most useful tools to get a robust development environment up and running.

Even when installing Miniconda or Anaconda(check miniconda out before anaconda if you haven’t) it is worth going through pyenv. (here is a useful article)

Extra Tip: before installing a new python version please make sure you have all necessary CONFIGURE_OPTS enabled i.e shared_libraries like here

Building with --enable-shared

You can build CPython with --enable-shared to install a version with shared object.

If --enable-shared was found in PYTHON_CONFIGURE_OPTS or CONFIGURE_OPTS, python-build will automatically set RPATH to the pyenv’s prefix directory. This means you don’t have to set LD_LIBRARY_PATH or DYLD_LIBRARY_PATH for the version(s) installed with --enable-shared.

$ env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 3.x.y

Virtual Environments

Virtual environments are useful when you need to avoid touching the system python, (which is the recommended way for most development) pyenv plugin pyenv-virtualenv provides this functionality.

once pyenv-virtualenv is set up pyenv virtualenv 3.x.y name_of_vitualenv

Installing Latest Miniconda (QUITE OPTIONAL)

Install the latest miniconda

$ pyenv install miniconda3-latest 

Create a virtual environment

$  pyenv virtualenv miniconda3-latest YOUR-PREFERRED-NAME

Conda caveats:

Conda may sometimes not support your target platform. check before committing

Fixing broken python wheel

I encountered a problem where I couldn’t use pip or wheel. I had to use this

curl https://bootstrap.pypa.io/get-pip.py | python -