Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI error: pip not installed on 2.7 #19

Closed
eddiewebb opened this issue Dec 19, 2019 · 3 comments · Fixed by #21
Closed

CI error: pip not installed on 2.7 #19

eddiewebb opened this issue Dec 19, 2019 · 3 comments · Fixed by #21

Comments

@eddiewebb
Copy link

eddiewebb commented Dec 19, 2019

Very odd. Running a 2.7 build locally or on CIrcle fails, python:3.6 seems to work fine.

$ circleci build -c 2dotoh.yml --job codespell
Docker image digest: sha256:81eaab60f3118a29f49ba42229c9a918d792bce8e75e2b2443e4042db932ac87
====>> Spin up Environment
Build-agent version 1.0.18380-12161d8b (2019-11-04T17:44:02+0000)
Docker Engine Version: 19.03.5
Kernel Version: Linux 368961b4dd9b 4.9.184-linuxkit #1 SMP Tue Jul 2 22:58:16 UTC 2019 x86_64 Linux
Starting container cimg/python:2.7
  using image cimg/python@sha256:20752b5f66dd6e0447217385eca897649dbc180b96ddf5f1c3792386c06509f3

Using build environment variables
  BASH_ENV=/tmp/.bash_env-localbuild-1576771155
  CI=true
  CIRCLECI=true
  CIRCLE_BRANCH=patch-1
  CIRCLE_BUILD_NUM=
  CIRCLE_JOB=codespell
  CIRCLE_NODE_INDEX=0
  CIRCLE_NODE_TOTAL=1
  CIRCLE_REPOSITORY_URL=git@github.com:eddiewebb/trinity.git
  CIRCLE_SHA1=83ce3cc41ea295a414d211bbd283905665fdc7d1
  CIRCLE_SHELL_ENV=/tmp/.bash_env-localbuild-1576771155
  CIRCLE_WORKING_DIRECTORY=~/project


The redacted variables listed above will be masked in run step output

====>> Checkout code
  #!/bin/bash -eo pipefail
mkdir -p /root/project && cd /tmp/_circleci_local_build_repo && git ls-files | tar -T - -c | tar -x -C /root/project && cp -a /tmp/_circleci_local_build_repo/.git /root/project
====>> install codespell
  #!/bin/bash -eo pipefail
pip install codespell
/bin/bash: pip: command not found
Error: Exited with code 127
Step failed


but manually invoking container passes

Development/trinity on patch-1* : [10:34:31]
$ docker run -it cimg/python:2.7 bash
Unable to find image 'cimg/python:2.7' locally
2.7: Pulling from cimg/python
5667fdb72017: Pull complete 
d83811f270d5: Pull complete 
ee671aafb583: Pull complete 
7fc152dfb3a6: Pull complete 
e4ca174ff71e: Pull complete 
ec7d07481cdc: Pull complete 
38808d14ffdd: Pull complete 
0f3f034efc2b: Pull complete 
5ab14eaa35bf: Pull complete 
173f3617fc64: Pull complete 
7f41c24f015d: Pull complete 
Digest: sha256:20752b5f66dd6e0447217385eca897649dbc180b96ddf5f1c3792386c06509f3
Status: Downloaded newer image for cimg/python:2.7

root@68a64a2e5cee:~/project# pip install codespell
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting codespell
  Downloading https://files.pythonhosted.org/packages/df/6f/764ca059e0eb06b69e1abed2c9a2cabe7dac72b336e2600615b38ea547a3/codespell-1.16.0.tar.gz (134kB)
     |################################| 143kB 1.2MB/s 
Installing collected packages: codespell
  Running setup.py install for codespell ... done
Successfully installed codespell-1.16.0
WARNING: You are using pip version 19.2.3, however version 19.3.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
@FelicianoTech
Copy link
Contributor

There seems to be a PATH issue with regard to interactive vs non-interactive Bash sessions here. Investigating.

The Dockerfile itself checks pip before finishing so strange:

pip --version

@eddiewebb eddiewebb changed the title CI error: pip not installed CI error: pip not installed on 2.7 Dec 19, 2019
eddiewebb added a commit to eddiewebb/grafana that referenced this issue Dec 19, 2019
These new images from CircleCI are engineered to have faster spinup times through a smaller footprint and more shared layers with other languages run on CircleCI (means more cache hits!)

They also add stability with more deterministic versioning.

CI: remove sudo and circleci legacy images

replaced more `circleci` with `cimg` alternative. Removed any sudo for affected jobs since those run as root.

CI: fix node version

CI: pin python docker image for codespell

CI:use python 3.6

issue with 2.7 - CircleCI-Public/cimg-python#19
@eddiewebb
Copy link
Author

🎉

@wyardley
Copy link

It also doesn't seem to be in root's $PATH, even in an interactive session

circleci@78b8e0c69367:~/project$ pip --version
pip 19.2.3 from /home/circleci/.pyenv/versions/3.7.7/lib/python3.7/site-packages/pip (python 3.7)
circleci@78b8e0c69367:~/project$ sudo pip --version
sudo: pip: command not found
circleci@78b8e0c69367:~/project$ sudo su - 
root@78b8e0c69367:~# pip --version
-su: pip: command not found
root@78b8e0c69367:~# logout
circleci@78b8e0c69367:~/project$ which pip
/home/circleci/.pyenv/shims/pip

pip does work as the circleci user, but was still confusing, especially since Circle's example docs suggest using sudo pip install pipenv (https://circleci.com/docs/2.0/language-python/#cache-dependencies)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants