13

I have a Continuous Integration that works with Gitlab. When I deploy, it installs everything in my requirements.txt file with pip. However, when it gets to installing a package named cffi, it throws the error:

Downloading/unpacking cffi==1.10.0 (from -r requirements.txt (line 11)) Cleaning up...

setuptools must be installed to install from a source distribution

I am lost here. Tried adding "setuptools" to requirements.txt and adding a line that explicitly installs it, but it doesn't work.

gitlab.ci looks like this:

script: - "cp tests/test_settings.py app/local_settings.py" - "source /home/ci/misuper-venv/bin/activate" - pip install setuptools - "pip install -r requirements.txt" - "python manage.py migrate --noinput" 

I'm completely lost here. Please help.

1 Answer 1

29

It's a known problem.

pip install -U setuptools pip install -U pip 

Just helped me.

Note: a reasonable person would never sudo pip install anything. OS's Python should be managed by the OS's package manager; strong-arming your system Python installation has been many times seen to break your OS in interesting ways.

To pip install anything, use virtualenv or an equivalent.

Sign up to request clarification or add additional context in comments.

3 Comments

using sudo on the both the above commands solved my issues thank you
@jamesc: Good! But next time consider using a virtualenv. System Python packages are best handled by your package manager.
Thank you! I had this issue when trying to install Pillow. After running the above it installed with no problems.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.