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.

pipenv install fails on windows-latest unless it's in its own step

See original GitHub issue

Describe the bug When using windows-latest OS, pipenv fails to create a virtual environment, unless the pipenv install command is in it’s own step.

Steps to reproduce

  1. Create an action using windows-latest OS.
  2. Create a single step to install pipenv and run pipenv install e.g.
    - name: Install Pipenv
      run: |
        python -m pip install --upgrade pip
        pip install pipenv
        pipenv install --verbose --dev --skip-lock --python=${{ matrix.python }}
    
  3. The snippet above will fail, but the snippet below succeeds.
    - name: Install Pipenv
      run: |
        python -m pip install --upgrade pip
        pip install pipenv
    - name: Install python packages
      run: |
        pipenv install --verbose --dev --skip-lock --python=${{ matrix.python }}
    

Basically this diff went from a successful build to a failing build, which seems very strange to me.

--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -9,8 +9,7 @@ jobs:
     strategy:
       matrix:
         # ubuntu-18.04 currently same as ubuntu-latest
-        # TODO: windows-latest (windows server 2019) fails at pipenv install when creating virtual env
-        os: [ubuntu-16.04, ubuntu-18.04, macos-latest, windows-latest]
+        os: [ubuntu-16.04, ubuntu-latest, macos-latest, windows-latest]
         # black doesn't seem to work with python-3.5 on ubuntu-18.04
         python: [3.6, 3.7]
 
@@ -24,8 +23,6 @@ jobs:
       run: |
         python -m pip install --upgrade pip
         pip install pipenv
-    - name: pipenv
-      run: |
         pipenv install --verbose --dev --skip-lock --python=${{ matrix.python }}
     - name: Run tests
       run: |

Expected behavior I’d expect the steps to behave the same way, regardless of what way the commands are grouped.

Runner Version and Platform

  • Github actions Current runner version: ‘2.163.1’
  • windows-latest

What’s not working?

pipenv fails to create a virtual env, unless the command is in it’s own step. github-actions-failure

Job Log Output

Collecting virtualenv
  Downloading https://files.pythonhosted.org/packages/05/f1/2e07e8ca50e047b9cc9ad56cf4291f4e041fa73207d000a095fe478abf84/virtualenv-16.7.9-py2.py3-none-any.whl (3.4MB)
Installing collected packages: certifi, virtualenv-clone, virtualenv, pipenv
Successfully installed certifi-2019.11.28 pipenv-2018.11.26 virtualenv-16.7.9 virtualenv-clone-0.5.3
Creating a virtualenv for this project�
##[error]Process completed with exit code 1.

Comments

I’m not sure if this issue should go here or in another actions repo. I had a look around, but thought https://github.com/actions/virtual-environments wasn’t right, since the command does work in some cases, but not in others. Feel free to close here and move to the appropriate repo, and sorry if I got it wrong!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
TingluoHuangcommented, Apr 14, 2020

It looks like PowerShell 7 release and has fixed the problem on the Hosted runner. I am going to close this issue, please reopen if this still happens. 😄

1reaction
TingluoHuangcommented, Jan 6, 2020

@ConorSheehan1 check the install pipenv step, it actually runner pipenv install as well, i run it twice.

Read more comments on GitHub >

github_iconTop Results From Across the Web

pipenv install packages for python is not working
The Scripts directory with utility scripts for packages installed per-user is not on PATH , so your command shell won't find them unless...
Read more >
Common Pipenv Errors and How to Solve Them
The second most common reason locking fails is that we attempt to install a package that is a pre-release version. You can resolve...
Read more >
Errors Using Pipenv When Installing Numpy Versions in ...
Follow these steps in creating a new virtual environment using pipenv. ... It is no problem to just install numpy at its latest...
Read more >
How to properly install Pipenv on WSL Ubuntu 18.04?
The scripts pipenv and pipenv-resolver are installed in '~/.local/bin' which is not on PATH. Consider adding this directory to PATH or, if ......
Read more >
Pipenv: A Guide to the New Python Packaging Tool
Pipenv is a packaging tool for Python that solves some common problems associated with the typical workflow using pip, virtualenv, and the good...
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