Build fails due to virtualenv failure


#1
`    New python executable in /home/ubuntu/virtualenvs/venv-2.7.13/bin/python2.7
Also creating executable in /home/ubuntu/virtualenvs/venv-2.7.13/bin/python
Installing setuptools, pip, wheel...
  Complete output from command /home/ubuntu/virtual...2.7.13/bin/python2.7 - setuptools pip wheel:
  Collecting setuptools
  Downloading setuptools-35.0.2-py2.py3-none-any.whl (390kB)
Collecting pip
Collecting wheel
Collecting packaging>=16.8 (from setuptools)
  Downloading packaging-16.8-py2.py3-none-any.whl
Collecting appdirs>=1.4.0 (from setuptools)
  Downloading appdirs-1.4.3-py2.py3-none-any.whl
Collecting six>=1.6.0 (from setuptools)
  Downloading six-1.10.0-py2.py3-none-any.whl
Collecting pyparsing (from packaging>=16.8->setuptools)
  Downloading pyparsing-2.2.0-py2.py3-none-any.whl (56kB)
Installing collected packages: six, pyparsing, packaging, appdirs, setuptools, pip, wheel
Exception:
Traceback (most recent call last):
  File "/opt/circleci/.pyenv/versions/2.7.13/lib/python2.7/site-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/opt/circleci/.pyenv/versions/2.7.13/lib/python2.7/site-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/commands/install.py", line 342, in run
    prefix=options.prefix_path,
  File "/opt/circleci/.pyenv/versions/2.7.13/lib/python2.7/site-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/req/req_set.py", line 784, in install
    **kwargs
  File "/opt/circleci/.pyenv/versions/2.7.13/lib/python2.7/site-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/req/req_install.py", line 851, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/opt/circleci/.pyenv/versions/2.7.13/lib/python2.7/site-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/req/req_install.py", line 1064, in move_wheel_files
    isolated=self.isolated,
  File "/opt/circleci/.pyenv/versions/2.7.13/lib/python2.7/site-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/wheel.py", line 345, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/opt/circleci/.pyenv/versions/2.7.13/lib/python2.7/site-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/wheel.py", line 287, in clobber
    ensure_dir(dest)  # common for the 'include' path
  File "/opt/circleci/.pyenv/versions/2.7.13/lib/python2.7/site-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/utils/__init__.py", line 83, in ensure_dir
    os.makedirs(path)
  File "/home/ubuntu/virtualenvs/venv-2.7.13/lib/python2.7/os.py", line 150, in makedirs
    makedirs(head, mode)
  File "/home/ubuntu/virtualenvs/venv-2.7.13/lib/python2.7/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/lib/python2.7'
----------------------------------------
...Installing setuptools, pip, wheel...done.
Traceback (most recent call last):
  File "/opt/circleci/.pyenv/versions/2.7.13/bin/virtualenv", line 11, in <module>
    sys.exit(main())
  File "/opt/circleci/.pyenv/versions/2.7.13/lib/python2.7/site-packages/virtualenv.py", line 713, in main
    symlink=options.symlink)
  File "/opt/circleci/.pyenv/versions/2.7.13/lib/python2.7/site-packages/virtualenv.py", line 945, in create_environment
    download=download,
  File "/opt/circleci/.pyenv/versions/2.7.13/lib/python2.7/site-packages/virtualenv.py", line 901, in install_wheel
    call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=SCRIPT)
  File "/opt/circleci/.pyenv/versions/2.7.13/lib/python2.7/site-packages/virtualenv.py", line 797, in call_subprocess
    % (cmd_desc, proc.returncode))
OSError: Command /home/ubuntu/virtual...2.7.13/bin/python2.7 - setuptools pip wheel failed with error code 2

((if (directory? "/home/ubuntu/virtualenvs/venv-2.7.13") (echo "Using cached venv") (do ("virtualenv" "/home/ubuntu/virtualenvs/venv-2.7.13" || exit 1) (source "/home/ubuntu/virtualenvs/venv-2.7.13/bin/activate" || exit 2) (pip install nose || exit 3))) "true" (echo "source /home/ubuntu/virtualenvs/venv-2.7.13/bin/activate" >> "~/.circlerc")) returned exit code 1

Action failed: virtualenv

`

Circle build file

machine:
  python:
    version: 2.7.13
  services:
    - docker

test:
  pre:
    - echo "manual" | sudo tee /etc/init/mongod.override
    - sudo service mongod stop
    - docker-compose -f docker-compose.yml up -d
    - sleep 60
  override:
    - ES_PORT=9200 python -m unittest -v test_analytics_transformer

Another build with exact same circle build file passes. I am confused


#2