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

2018.11.14 regression: pipenv lock -r with named Pipfile #3228

Closed
jakul opened this issue Nov 15, 2018 · 6 comments
Closed

2018.11.14 regression: pipenv lock -r with named Pipfile #3228

jakul opened this issue Nov 15, 2018 · 6 comments
Assignees
Labels
Type: Bug 🐛 This issue is a bug. Type: Regression This issue is a regression of a previous behavior. Type: Vendored Dependencies This issue affects vendored dependencies within pipenv.

Comments

@jakul
Copy link

jakul commented Nov 15, 2018

Issue description

pipenv lock -r fails when using a Pipfile which is not called Pipfile

Expected result

pipenv lock -r works

Actual result

pipenv.vendor.requirementslib.exceptions.PipfileNotFound error

Steps to replicate

craig@amogato2:/tmp/named-pipfile
$ cat NamedPipfile
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]

[packages]
requests = "*"

[requires]
python_version = "3.7"

craig@amogato2:/tmp/named-pipfile
$ PIPENV_PIPFILE=NamedPipfile pipenv lock -r
ERROR: The file could not be found: /private/tmp/named-pipfile/Pipfile
Aborting...
ERROR: The file could not be found: /private/tmp/named-pipfile/Pipfile
Aborting...
Traceback (most recent call last):
  File "/Users/craig/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv/project.py", line 737, in get_or_create_lockfile
    lockfile = Req_Lockfile.load(self.lockfile_location)
  File "/Users/craig/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv/vendor/requirementslib/models/lockfile.py", line 226, in load
    projectfile = cls.load_projectfile(path, create=create)
  File "/Users/craig/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv/vendor/requirementslib/models/lockfile.py", line 171, in load_projectfile
    lf = cls.lockfile_from_pipfile(project_path.joinpath("Pipfile"))
  File "/Users/craig/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv/vendor/requirementslib/models/lockfile.py", line 145, in lockfile_from_pipfile
    raise PipfileNotFound(pipfile_path)
pipenv.vendor.requirementslib.exceptions.PipfileNotFound

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/craig/.local/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "/Users/craig/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/Users/craig/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/Users/craig/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/craig/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/craig/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/Users/craig/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv/vendor/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/Users/craig/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/Users/craig/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv/vendor/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/Users/craig/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv/cli/command.py", line 318, in lock
    pre=state.installstate.pre,
  File "/Users/craig/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv/core.py", line 1232, in do_init
    pypi_mirror=pypi_mirror,
  File "/Users/craig/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv/core.py", line 781, in do_install_dependencies
    lockfile = project.get_or_create_lockfile()
  File "/Users/craig/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv/project.py", line 739, in get_or_create_lockfile
    lockfile = Req_Lockfile.from_data(self.lockfile_location, self.lockfile_content)
  File "/Users/craig/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv/vendor/requirementslib/models/lockfile.py", line 202, in from_data
    lockfile = cls.lockfile_from_pipfile(pipfile_path)
  File "/Users/craig/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv/vendor/requirementslib/models/lockfile.py", line 145, in lockfile_from_pipfile
    raise PipfileNotFound(pipfile_path)
pipenv.vendor.requirementslib.exceptions.PipfileNotFound

craig@amogato2:/tmp/named-pipfile
$ PIPENV_PIPFILE=NamedPipfile pipenv lock -r -v
ERROR: The file could not be found: /private/tmp/named-pipfile/Pipfile
Aborting...
ERROR: The file could not be found: /private/tmp/named-pipfile/Pipfile
Aborting...
Traceback (most recent call last):
  File "/Users/craig/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv/project.py", line 737, in get_or_create_lockfile
    lockfile = Req_Lockfile.load(self.lockfile_location)
  File "/Users/craig/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv/vendor/requirementslib/models/lockfile.py", line 226, in load
    projectfile = cls.load_projectfile(path, create=create)
  File "/Users/craig/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv/vendor/requirementslib/models/lockfile.py", line 171, in load_projectfile
    lf = cls.lockfile_from_pipfile(project_path.joinpath("Pipfile"))
  File "/Users/craig/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv/vendor/requirementslib/models/lockfile.py", line 145, in lockfile_from_pipfile
    raise PipfileNotFound(pipfile_path)
pipenv.vendor.requirementslib.exceptions.PipfileNotFound

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/craig/.local/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "/Users/craig/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/Users/craig/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/Users/craig/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/craig/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/craig/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/Users/craig/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv/vendor/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/Users/craig/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/Users/craig/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv/vendor/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/Users/craig/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv/cli/command.py", line 318, in lock
    pre=state.installstate.pre,
  File "/Users/craig/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv/core.py", line 1232, in do_init
    pypi_mirror=pypi_mirror,
  File "/Users/craig/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv/core.py", line 781, in do_install_dependencies
    lockfile = project.get_or_create_lockfile()
  File "/Users/craig/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv/project.py", line 739, in get_or_create_lockfile
    lockfile = Req_Lockfile.from_data(self.lockfile_location, self.lockfile_content)
  File "/Users/craig/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv/vendor/requirementslib/models/lockfile.py", line 202, in from_data
    lockfile = cls.lockfile_from_pipfile(pipfile_path)
  File "/Users/craig/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv/vendor/requirementslib/models/lockfile.py", line 145, in lockfile_from_pipfile
    raise PipfileNotFound(pipfile_path)
pipenv.vendor.requirementslib.exceptions.PipfileNotFound

$ pipenv --support

Pipenv version: '2018.11.14'

Pipenv location: '/Users/craig/.local/venvs/pipenv/lib/python3.6/site-packages/pipenv'

Python location: '/Users/craig/.local/venvs/pipenv/bin/python3'

Python installations found:

Error %s while executing command %s [Errno 2] No such file or directory: '/usr/local/bin/pythonz': '/usr/local/bin/pythonz' /usr/local/bin/pythonz -c import sys; print(sys.version.split()[0])
Error %s while executing command %s [Errno 2] No such file or directory: '/usr/local/bin/pythonz': '/usr/local/bin/pythonz' /usr/local/bin/pythonz -c import sys; print(sys.version.split()[0])

  • 3.7.0: /usr/local/bin/python3
  • 3.7.0: /usr/local/bin/python3.7m
  • 2.7.15: /usr/local/bin/python
  • 2.7.15: /usr/local/bin/pythonw
  • 2.7.10: /usr/bin/python
  • 2.7.10: /usr/bin/pythonw
  • 2.7.10: /usr/bin/python2.7

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.6.6',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '18.0.0',
 'platform_system': 'Darwin',
 'platform_version': 'Darwin Kernel Version 18.0.0: Wed Aug 22 20:13:40 PDT '
                     '2018; root:xnu-4903.201.2~1/RELEASE_X86_64',
 'python_full_version': '3.6.6',
 'python_version': '3.6',
 'sys_platform': 'darwin'}

System environment variables:

  • LDFLAGS
  • rvm_bin_path
  • VIRTUALENVWRAPPER_SCRIPT
  • VIRTUALENVWRAPPER_PROJECT_FILENAME
  • TERM_PROGRAM
  • GEM_HOME
  • NVM_CD_FLAGS
  • TERM
  • SHELL
  • HISTSIZE
  • IRBRC
  • CPPFLAGS
  • TMPDIR
  • BBM_DEV
  • Apple_PubSub_Socket_Render
  • TERM_PROGRAM_VERSION
  • OLDPWD
  • MY_RUBY_HOME
  • TERM_SESSION_ID
  • PYENV_VERSION
  • LC_ALL
  • NVM_DIR
  • USER
  • CROSS_ACCOUNT_STACK_AWS_PROFILE_NAME_BBM_MASTER
  • _system_type
  • COMMAND_MODE
  • rvm_path
  • SSH_AUTH_SOCK
  • __CF_USER_TEXT_ENCODING
  • WORKON_HOME
  • PROJECT_HOME
  • rvm_prefix
  • VIRTUALENVWRAPPER_PYTHON
  • NPM_TOKEN
  • PATH
  • WERKZEUG_DEBUG_PIN
  • VIRTUALENVWRAPPER_HOOK_DIR
  • PWD
  • TOX_PLUGINS_IPDB_INSTALL
  • LANG
  • ITERM_PROFILE
  • _system_arch
  • XPC_FLAGS
  • _system_version
  • PYTEST_ADDOPTS
  • HISTCONTROL
  • XPC_SERVICE_NAME
  • rvm_version
  • PYENV_SHELL
  • SHLVL
  • HOME
  • COLORFGBG
  • CFLAGS
  • ITERM_SESSION_ID
  • LOGNAME
  • GEM_PATH
  • PKG_CONFIG_PATH
  • PROMPT_COMMAND
  • VIRTUALENVWRAPPER_WORKON_CD
  • EXTRA_CFLAGS
  • BBM_PROD
  • RUBY_VERSION
  • SECURITYSESSIONID
  • _system_name
  • EXTRA_LDFLAGS
  • COLORTERM
  • _
  • 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: /Users/craig/.pyenv/shims:/Users/craig/.rvm/gems/ruby-2.4.1/bin:/Users/craig/.rvm/gems/ruby-2.4.1@global/bin:/Users/craig/.rvm/rubies/ruby-2.4.1/bin:/Users/craig/.yarn/bin:/Users/craig/.local/bin:/Users/craig/.pyenv/shims:/usr/local/opt/openssl/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/craig/.rvm/bin
  • SHELL: /bin/bash
  • LANG: en_GB.UTF-8
  • PWD: /tmp/named-pipfile

I think this is caused by https://github.com/sarugaku/requirementslib/blob/eb8152c4394c0b447dc0ec4420f9f86f5ab596a3/src/requirementslib/models/lockfile.py#L198-L199

@duplicate-issues
Copy link

Hey @jakul,

We did a quick check and this issue looks very darn similar to

This could be a coincidence, but if any of these issues solves your problem then I did a good job 😄

If not, the maintainers will get to this issue shortly.

Cheers,
Your Friendly Neighborhood ProBot

@jakul
Copy link
Author

jakul commented Nov 15, 2018 via email

@techalchemy
Copy link
Member

Lol. Not quite, bot! This seems like a problem. Thankfully I got some actual exceptions in last release. Sorry for the bug :( we need a lot of test improvements.

@techalchemy techalchemy added Type: Vendored Dependencies This issue affects vendored dependencies within pipenv. Type: Bug 🐛 This issue is a bug. Type: Regression This issue is a regression of a previous behavior. labels Nov 19, 2018
@techalchemy techalchemy added this to the November Bugfix Release milestone Nov 19, 2018
@techalchemy techalchemy self-assigned this Nov 19, 2018
@techalchemy
Copy link
Member

I merged a fix for this I believe, if you get a moment please feel free to check the master branch and let me know

@jakul
Copy link
Author

jakul commented Nov 20, 2018

Yup, master works for me! Thanks

@vhosakot
Copy link

Saw the same error with python 3.7:

[pipenv.exceptions.PipfileNotFound]: raise exceptions.PipfileNotFound

and pipenv --python python3.7 resolved it for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug 🐛 This issue is a bug. Type: Regression This issue is a regression of a previous behavior. Type: Vendored Dependencies This issue affects vendored dependencies within pipenv.
Projects
None yet
Development

No branches or pull requests

3 participants