Pipenv: Conversion from requirements.txt to Pipfile fails

Created on 27 Sep 2017  Â·  10Comments  Â·  Source: pypa/pipenv

Hi!

I have a Pipfile in the root of my project and then a folder (subproj) that contains a requirements.txt for a subproject. I'm doing the following:

$ cd myproj
$ pipenv shell
$ cd subproj

Then I'm trying to convert a requirements.txt into a Pipfile for this subproject, executing pipenv install -r requirements.txt and I get this error message:

Requirements file provided! Importing into Pipfile…
Traceback (most recent call last):
  File "/Users/joaoalves/.local/bin/pipenv", line 11, in <module>
    load_entry_point('pipenv==8.0.6', 'console_scripts', 'pipenv')()
  File "/Users/joaoalves/.local/lib/python2.7/site-packages/pipenv/vendor/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/Users/joaoalves/.local/lib/python2.7/site-packages/pipenv/vendor/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/Users/joaoalves/.local/lib/python2.7/site-packages/pipenv/vendor/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/joaoalves/.local/lib/python2.7/site-packages/pipenv/vendor/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/joaoalves/.local/lib/python2.7/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/Users/joaoalves/.local/lib/python2.7/site-packages/pipenv/cli.py", line 1680, in install
    import_requirements(r=requirements, dev=dev)
  File "/Users/joaoalves/.local/lib/python2.7/site-packages/pipenv/cli.py", line 232, in import_requirements
    assert os.path.isfile(r)
AssertionError

I'm not sure if this is a bug _per se_ or if there is some problem in my environment. I can use virtualenv and virtualenvwrapper without any problem. Pipenv works fine too with the Pipfile that's on the root project.

Environment:

  • Mac OS Sierra 10.12.6
  • ZSH + Oh My ZSH
  • Pyenv with Python 2.7

Best regards,
João

Most helpful comment

Sorry for the bug! Thanks for noticing it :)

All 10 comments

please provide the requirements.txt file.

Closing until a requirements file is provided.

Ups, my bad. The requirements.txt is the following:

requests==2.12.1

(I know that's a simple requirements file, but this is for a workshop)

just do pipenv install from the root directory.

i know what's causing this bug, i'll fix it.

basically, this is currently from the root of the project, so,

pipenv install -r subdir/requirements.txt

even if you're in the subdir. I'm fixing it.

8.1.0 released, which fixes this!

Sorry for the bug! Thanks for noticing it :)

Thank you for being so responsive and fixing it so quickly! 🥇

Was this page helpful?
0 / 5 - 0 ratings

Related issues

erinxocon picture erinxocon  Â·  3Comments

marc-fez picture marc-fez  Â·  3Comments

konstin picture konstin  Â·  3Comments

randName picture randName  Â·  3Comments

jeyraof picture jeyraof  Â·  3Comments