Score:0

Bash script giving error when trying to run python pip

ng flag

I've created a custom GitHub Action with the following Dockerfile:

FROM python:3
RUN pip install --upgrade pip
RUN pip install flake8 mypy isort
COPY entrypoint.sh /
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

The entrypoint.sh file is simple enough:

#!/bin/bash

...

$(python3 -m pip install -r $9 --no-cache-dir)

...

The offending line above gives an error saying:

/entrypoint.sh: line 44: Collecting: command not found

The GitHub Action completes fine and even though the line raises this error it still executes. Does anyone have any insight on why this is happening and how to solve this?


Attempted solution #1:

Changing pip to pip3 in the line gives an error saying pip3 is not installed and the whole workflow fails to complete, where before it completed with no issue.

Score:2
cn flag

The command python3 -m pip install -r $9 --no-cache-dir indeed ran fine.

It's output probably began with:

Collecting PACKAGE_NAME

But you didn't see this because for some reason you wrapped it with $(), which means "Don't show the output, execute it."

And Collecting is not a command, which is why it wasn't found!

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.