question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pip install on latest ubuntu fails with error

See original GitHub issue

Description: github actions for python 3.8 fails with the following error:

ERROR: Invalid requirement: 'Warning: The lock flag' (from line 2 of requirements.txt)

Action version:

runs-on: ubuntu-latest (python-version: [ '3.8' ])
- name: Set up Python ${{ matrix.python-version }}
        uses: actions/setup-python@v2
        with:
          python-version: ${{ matrix.python-version }}

Platform:

  • Ubuntu)
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:

Repro steps:
Create a repo with Pipfile, add dependencies and lock the Pipfile. run:

python -m pip install --upgrade pip setuptools pipenv virtualenv PyYAML flake8 pylint nose coverage
pipenv --python '3.8' lock -r > requirements.txt
pip install -r requirements.txt

Expected behavior: pip should install all required packages

Actual behavior: pip fails with thee following error:

ERROR: Invalid requirement: 'Warning: The lock flag' (from line 2 of requirements.txt)

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:7
  • Comments:15 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
singhpratyushcommented, May 4, 2022

A quick fix is sticking to the immediately previous version

python -m pip install --upgrade pip setuptools pipenv==2022.4.21 virtualenv PyYAML flake8 pylint nose coverage

Update:

You should consider using pipenv to install dependencies and not convert them to requirements.txt and install using pip (because this).

A good way of doing so can be pipenv install --system if you don’t want to change how you run commands inside your environment.

1reaction
matteiuscommented, Aug 16, 2022

@ianyoung There was a deprecation warning around install -r for a number of releases, please use the newer pipenv requirements command.

Read more comments on GitHub >

github_iconTop Results From Across the Web

pip install error - python - Ask Ubuntu
You are installing pip with sudo but its using your user's home folder's python staging area. This can cause issues later on where...
Read more >
Error using pip install on ubuntu 16.04 LTS [duplicate]
Closed last year. I was trying to install a python module for both python3 and python2, and I had to upgrade pip, however,...
Read more >
pip not working on ubuntu 18, how to fix that? - Server Fault
When I ran the pip command first, I got error as pip command not found. So, installed it using sudo apt install python-pip....
Read more >
Installing scikit-learn
There are different ways to install scikit-learn: Install the latest official release. This is the best approach for most users. It will provide...
Read more >
How to Install Pip on Windows - ActiveState
One of the most common problems with running Python tools like pip is the “not on PATH” error. This means that Python cannot...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found