Closed FelicianoTech closed 2 years ago
From recent GitHub issues in Pyenv, it seems there has been a recent change to how much is needed to be done to ensure Pyenv is initialized as part of $PATH.
Example Issue: https://github.com/pyenv/pyenv/issues/1906
This looks to be a recent issue (perhaps starting from a particular Pyenv version).
Is the following related?
- image: circleci/python:3.10
- sudo pip install awscli
:heavy_check_mark: Passes.
- image: cimg/python:3.10
- sudo pip install awscli
:x: sudo: pip: command not found
I'm running into this as well. What I found out is that I locally have a .python-version
file and it breaks the build environment on CircleCI. This is a recent change and it was quite difficult to debug.
Fix is to add
- run: rm .python-version
at the top of the config.
There were some changes to the Python image a few months ago. Is anyone having this issue with images published within the past couple of months?
I've this exact problem 3.10. Should try a different version?
@mellis-at-infomedia When v3.10.6 came out, the alias 3.10 was updated. Which specific tag are you using? Is there a build link with the error that is for a public project?
Same problem so far, still trying 3.10
. No link to provide, sorry. But here is a sample workflow to reproduce the issue:
version: 2.1
jobs:
old_image:
docker:
- image: circleci/python:3.10
steps:
- run: sudo pip install awscli
new_image:
docker:
- image: cimg/python:3.10
steps:
- run: sudo pip install awscli
workflows:
build_and_test:
jobs:
- old_image
- new_image
Is everyone here trying to use pip with sudo
? Using it without sudo
works: https://app.circleci.com/pipelines/github/felicianotech/cci-testing-pub/795/workflows/b06c6237-8392-4375-beaf-294b576a4541/jobs/1805
You may need to fall back to circleci/python:3.10
, which is not the version CircleCI recommends and is marked as experimental, but does seem to have less of these issues
@felicianotech It does work, thank you for that :blush:
I'm going to go ahead and close this. In the near future, we'll be updating this readme (as well as for the other images) and how to use package managers, such as when to use sudo
or not. Hopefully that will make it clear since I know sometimes it's confusing.
I think there are legitimate cases when pip or binaries installed by pip need to be used with sudo
, for example when running things that will do system-wide operations with sudo.
So I think this issue should be reopened and pip should be pre-installed for root user as well as for the non-root circleci user.
It appears for some pip binaries to be made available in PATH,
eval "$(pyenv init -)"
needs to be manually run. This needs to be investigated as that doesn't sound ideal.