# Machine executor with python has problems with pyenv

**URL:** <https://discuss.circleci.com/t/machine-executor-with-python-has-problems-with-pyenv/16697>\
**Category:** Bug Reports\
**Tags:** python\
**Created:** [September 20, 2017, 1:36pm UTC](https://discuss.circleci.com/t/machine-executor-with-python-has-problems-with-pyenv/16697 "2017-09-20T13:36:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![asfer](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/asfer/32/17077_2.png) [@asfer](https://discuss.circleci.com/u/asfer)\
**Post date:** [September 20, 2017, 1:36pm UTC](https://discuss.circleci.com/t/machine-executor-with-python-has-problems-with-pyenv/16697/1 "2017-09-20T13:36:53Z")

</div>

I am trying to use the machine executor on a CircleCI 2.0 config so my tests can create networks and spin containers as they see fit.

However, I could not make pyenv work as intended like following logs demonstrate. Even after updating pyenv (`cd $(pyenv root) && git pull`):

```auto
circleci@prealloc-xyz:/opt/circleci/.pyenv$ pyenv versions
/opt/circleci/.pyenv/libexec/pyenv-versions: line 75: pyenv-version-name: command not found
  2.7.12
  3.5.2
circleci@prealloc-xyz:/opt/circleci/.pyenv$ pyenv global 3.5.2
/opt/circleci/.pyenv/libexec/pyenv-global: line 28: pyenv-version-file-write: command not found

```

Even `pyenv init -` shows this same issue:

```auto
circleci@prealloc-7q38ocmx-c8e34328-6a08-4ddf-a87c-b8ab092f2ecc:/opt/circleci/.pyenv/libexec$ pyenv init -
export PATH="/opt/circleci/.pyenv/shims:${PATH}"
export PYENV_SHELL=bash
source '/opt/circleci/.pyenv/libexec/../completions/pyenv.bash'
command pyenv rehash 2>/dev/null
/opt/circleci/.pyenv/libexec/pyenv-init: line 107: pyenv-commands: command not found

```

I ended up using the system executable which unfortunately also requires some tweaking, because it misses some packages:

```auto
sudo apt-get install python3-dev python3.4-venv

```

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [June 18, 2018, 11:35am UTC](https://discuss.circleci.com/t/machine-executor-with-python-has-problems-with-pyenv/16697/2 "2018-06-18T11:35:10Z")

</div>

Closed on June 18, 2018, 11:35am UTC


