Skip to content
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

Pipfile.lock not found when Pipfile missing. Regression of #1977 #3524

Closed
txomon opened this issue Feb 11, 2019 · 3 comments
Closed

Pipfile.lock not found when Pipfile missing. Regression of #1977 #3524

txomon opened this issue Feb 11, 2019 · 3 comments
Labels
Type: Regression This issue is a regression of a previous behavior.

Comments

@txomon
Copy link

txomon commented Feb 11, 2019

Issue description

Pipenv fails to run when only having Pipfile.lock. I am doing the process I described in #2489 (comment) and, and if I remove the touch Pipfile step, it will not work.

Expected result

pipenv sync should not depend on having Pipfile

Actual result

pipenv sync fails if Pipfile doesn't exist

Steps to replicate

Go to any pipenv project you may have and run the following

$ echo 'FROM python:alpine

RUN pip install pipenv
COPY Pipfile.lock .
RUN pipenv sync --verbose
' > test.dockerfile
$ docker build --file test.dockerfile .
Sending build context to Docker daemon  148.5kB
Step 1/4 : FROM python:alpine
 ---> 408808fb1a9e
Step 2/4 : RUN pip install pipenv
 ---> Using cache
 ---> 8d746c715b6a
Step 3/4 : COPY Pipfile.lock .
 ---> Using cache
 ---> 276d433c16bf
Step 4/4 : RUN pipenv sync --verbose
 ---> Running in 458c40362331
Traceback (most recent call last):
  File "/usr/local/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/pipenv/vendor/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/pipenv/cli/command.py", line 615, in sync
    pypi_mirror=state.pypi_mirror,
  File "/usr/local/lib/python3.7/site-packages/pipenv/core.py", line 2589, in do_sync
    raise exceptions.LockfileNotFound("Pipfile.lock")
pipenv.exceptions.LockfileNotFound: ERROR: Pipfile.lock not found! You need to run $ pipenv lock before you can continue.
The command '/bin/sh -c pipenv sync --verbose' returned a non-zero code: 1

$ pipenv --support

Pipenv version: '2018.11.26'

Pipenv location: '/usr/local/lib/python3.7/site-packages/pipenv'

Python location: '/usr/local/bin/python'

Python installations found:

  • 3.7.1: /usr/local/bin/python
  • 3.7.1: /usr/local/bin/python3.7m
  • 2.7.15: /usr/bin/python

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.7.1',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '4.20.6-arch1-1-ARCH',
 'platform_system': 'Linux',
 'platform_version': '#1 SMP PREEMPT Thu Jan 31 08:22:01 UTC 2019',
 'python_full_version': '3.7.1',
 'python_version': '3.7',
 'sys_platform': 'linux'}

System environment variables:

  • HOSTNAME
  • PYTHON_PIP_VERSION
  • SHLVL
  • HOME
  • GPG_KEY
  • PATH
  • LANG
  • TERRAFORM_VERSION
  • PYTHON_VERSION
  • PWD
  • CLOUD_SDK_VERSION
  • PIP_DISABLE_PIP_VERSION_CHECK
  • PYTHONDONTWRITEBYTECODE
  • PIP_SHIMS_BASE_MODULE
  • PIP_PYTHON_PATH
  • PYTHONFINDER_IGNORE_UNSUPPORTED

Pipenv–specific environment variables:

Debug–specific environment variables:

  • PATH: /google-cloud-sdk/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
  • LANG: C.UTF-8
  • PWD: /usr/local/src/ki

@frostming frostming added the Type: Regression This issue is a regression of a previous behavior. label Feb 12, 2019
@tekumara
Copy link

tekumara commented Mar 3, 2019

I've also just run into this problem.

@sne4ky
Copy link

sne4ky commented May 2, 2019

Same issue here

@techalchemy
Copy link
Member

Sorry for the issues, this is fixed on master however (and tells you that pipenv should not run in the root directory)

It works fine against master with the following dockerfile:

FROM python:alpine

# Copy over a wheel built against master
COPY pipenv-2018.11.27.dev0-py3-none-any.whl .
RUN pip install pipenv-2018.11.27.dev0-py3-none-any.whl
RUN mkdir -p app
WORKDIR app
COPY Pipfile.lock .
RUN pipenv sync --verbose

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Regression This issue is a regression of a previous behavior.
Projects
None yet
Development

No branches or pull requests

5 participants