-
Notifications
You must be signed in to change notification settings - Fork 541
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
All packages with CLI failing with '/home/runner/.local/bin' which is not on PATH #99
Comments
For what it's worth, I think I ran into a similar issue. Looks like for some reason Python 2 is being used in the container even when I specified another version. Maybe that's related? 🤔 |
Ah. Please disregard my earlier comment. Turns out I'd made a typo in my action. I pluralized my matrix with python-versions: [3.6, 3.7, 3.8, 3.9] instead of python-version: [3.6, 3.7, 3.8, 3.9] I imagine that causes |
I'm reproducing a very similar issue. I have the same Python action running in two repos, and it succeeds in one while failing in another. In this case I'm trying to run name: Python tests
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6]
steps:
- uses: actions/checkout@v2
- run: |
# Hack to get setup-python to work on act
# https://github.com/nektos/act/issues/251#issuecomment-706412948
if [ ! -f "/etc/lsb-release" ] ; then
echo "DISTRIB_RELEASE=18.04" > /etc/lsb-release
fi
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
- name: Lint with flake8
run: |
flake8 . In the repo where this doesn't work, it gives the warning:
In the repo where it does work, there is no warning. Interestingly, I can reproduce this both in the github runner, and also locally using the |
Update: I've narrowed down the issue to a [install]
install-scripts=... which was affecting the location to which pip installed the commands @heitorlessa looks like your repo might have a similar issue: [install]
prefix= A workaround is to - name: Install dependencies
run: |
cd /
python -m pip install --upgrade pip
pip install flake8 |
Same here.
|
Also trying newer Ubuntu 20.04 as a workaround of this PATH issue actions/setup-python#99
It may happen in the case where python dependencies are mistakingly referenced BEFORE - name: Install dependencies
run: |
sudo apt-get -y install ...stuff...
python -m pip install --upgrade pipenv
pipenv sync --dev
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }} But when you install Python dependencies after setting-up Python it'll be OK: - name: Install dependencies
run: sudo apt-get -y ...stuff...
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Python dependencies
run: |
python -m pip install --upgrade pipenv
pipenv sync --dev I just tested with ubuntu-latest and |
Hello @heitorlessa! We apologize for such a late reply. |
Hello @heitorlessa, I'm going to close the issue because we haven't received a response from you. |
Yes please do. I moved away from trying again as I couldn't reproduce it either so killed the project |
Describe the bug
Packages entrypoints/CLI are not available in PATH e.g.
flake8
,poetry
,pytest
.When investigating Github Action logs I can see two noticeable warnings that explains the issue:
Defaulting to user installation because normal site-packages is not writeable
WARNING: The script flake8 is installed in '/home/runner/.local/bin' which is not on PATH.
As I have another repo using this same action, and it is working just fine, I wonder if something happened recently to cause this - Virtualenv manipulation, PATH manipulation, etc.
Which version of the action are you using?
Tried both - same issue
v1
v2
v2.0.1
ormaster
)Environment
If applicable, please specify if you're using a container
Python Versions
Please list all of the effected versions of Python (
3.8.2
, etc.)3.6, 3.7, 3.8
To Reproduce
Create a new Github action using the following steps:
It will fail when it attempts to run
poetry
command. Same happens with any other package.Run/Repo Url
If applicable, and if your repo/run is public, please include a URL so it is easier for us to investigate.
https://github.com/aws-samples/cookiecutter-aws-sam-pipeline/pull/10/checks?check_run_id=730151630
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
PATH content - Captured via
tmate
sessionDebug logs
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: