Pip install fails in CI, runs fine in SSH

Hello! I am having problems with using pip to install Python packages in my CircleCI project.

I specified Python 2.7.10 in my circle.yml. I have two requirements.txt files, so I have overridden the install commands to make sure both of them get installed.

Here are the relevant parts of my circle.yml:

machine:
  python:
    version: 2.7.10

dependencies:
  override:
    - pip install -r server/requirements.txt
    - pip install -r tests/requirements.txt
    # more stuff follows...

When Circle hits the first pip install, it tries to install the packages in requirements.txt and hits an error when installing one.

When I tried to diagnose the issue, I logged into the box via SSH and ran pip install -r server/requirements.txt in the project directory. That worked fine!

I also tried installing the packages locally in a clean 2.7.10 virtualenv, and that worked as well. So I’m not sure what I should try next.

Here’s the full Circle error log:

pip install -r server/requirements.txt
Downloading/unpacking Flask==0.10.1 (from -r server/requirements.txt (line 1))
  Downloading Flask-0.10.1.tar.gz (544kB): 544kB downloaded
  Running setup.py egg_info for package Flask
    
    warning: no files found matching '*' under directory 'tests'
    warning: no previously-included files matching '*.pyc' found under directory 'docs'
    warning: no previously-included files matching '*.pyo' found under directory 'docs'
    warning: no previously-included files matching '*.pyc' found under directory 'tests'
    warning: no previously-included files matching '*.pyo' found under directory 'tests'
    warning: no previously-included files matching '*.pyc' found under directory 'examples'
    warning: no previously-included files matching '*.pyo' found under directory 'examples'
    no previously-included directories found matching 'docs/_build'
    no previously-included directories found matching 'docs/_themes/.git'
Downloading/unpacking Flask-WebTest==0.0.7 (from -r server/requirements.txt (line 2))
  Downloading Flask-WebTest-0.0.7.tar.gz
  Running setup.py egg_info for package Flask-WebTest
    
Downloading/unpacking jsonschema==2.4.0 (from -r server/requirements.txt (line 3))
  Downloading jsonschema-2.4.0.tar.gz (48kB): 48kB downloaded
  Running setup.py egg_info for package jsonschema
    
Downloading/unpacking raven==5.2.0 (from -r server/requirements.txt (line 4))
  Downloading raven-5.2.0.tar.gz (225kB): 225kB downloaded
  Running setup.py egg_info for package raven
    
    warning: no previously-included files matching '*~' found anywhere in distribution
Downloading/unpacking blinker==1.3 (from -r server/requirements.txt (line 5))
  Downloading blinker-1.3.tar.gz (91kB): 91kB downloaded
  Running setup.py egg_info for package blinker
    
Downloading/unpacking subprocess32==3.2.6 (from -r server/requirements.txt (line 6))
  Downloading subprocess32-3.2.6.tar.gz (51kB): 51kB downloaded
  Running setup.py egg_info for package subprocess32
    
    warning: no files found matching '*.h'
    no previously-included directories found matching 'build'
    no previously-included directories found matching 'dist'
    no previously-included directories found matching '.hg*'
Downloading/unpacking platformio==2.3.5 (from -r server/requirements.txt (line 7))
  Downloading platformio-2.3.5.tar.gz (80kB): 80kB downloaded
  Running setup.py egg_info for package platformio
    Traceback (most recent call last):
      File "<string>", line 16, in <module>
      File "/home/ubuntu/virtualenvs/venv-2.7.10/build/platformio/setup.py", line 40, in <module>
    IOError: [Errno 2] No such file or directory: 'README.rst'
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 16, in <module>

  File "/home/ubuntu/virtualenvs/venv-2.7.10/build/platformio/setup.py", line 40, in <module>

IOError: [Errno 2] No such file or directory: 'README.rst'

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /home/ubuntu/virtualenvs/venv-2.7.10/build/platformio

pip install -r server/requirements.txt returned exit code 1

Storing complete log in /home/ubuntu/.pip/pip.log Action failed: pip install -r server/requirements.txt

And here are the contents of my requirements.txt:

Flask==0.10.1
Flask-WebTest==0.0.7
jsonschema==2.4.0
raven==5.2.0
blinker==1.3
subprocess32==3.2.6
platformio==2.3.5
lockfile==0.11.0

I see the PlatformIO developer builds on CircleCi, I’ve asked them to come take a look if they can.

Eta: not sure how invites work, issue is here @ikravets

Try with this

checkout:
    post:
        *****
        - pip install -U pip setuptools virtualenv
1 Like

Thanks @ikravets, that worked!

I don’t understand what that does - can you help explain why that works?

Circle.CI uses obsolete setuptools (released in 2013). I don’t know how to ask them to make the latest setuptools/pip.

@ikravets thanks for the solution, I made a feature request to update the version of setuptools :slight_smile:

In the future this is the best way to ask for something new.

1 Like

@levlaz sorry for the offtop. Did you receive my e-mail as for docs?

I get the following error when I do this: OSError: [Errno 2] No such file or directory: '/usr/local/lib/python2.7/dist-packages/setuptools-3.4.4-py2.7.egg'. Any ideas?

Try without - pip install -U pip setuptools virtualenv. Just use - pip install -U platformio

1 Like