Pipenv: Installing local package with `pipenv install '-e .' --dev` no longer works.

Created on 1 Nov 2017  Â·  6Comments  Â·  Source: pypa/pipenv

The feature described https://docs.pipenv.org/basics.html#editable-dependencies-e-g-e was broken in this commit https://github.com/kennethreitz/pipenv/commit/0a48fa090e2535041e5280511a6a2f1696de6797

In the most recent version of pipenv (8.3.1), pipenv install '-e .' --dev fails with a TypeError from this line https://github.com/kennethreitz/pipenv/blob/v8.3.1/pipenv/utils.py#L540

Since '.' is a directory and not a regular file, it fails the check on L539 os.path.isfile(req.path) and the Requirements object name is None when parsing this type of requirement which causes the exception to be raised.

Installing pipenv==8.2.7 resolved this issue for me.

Most helpful comment

quick workaround - add "cjSj384E" = {path = ".", editable = true} to your Pipfile manually where cjSj384E is the hash of path to the current directory. you can get this hash from checking the currently virtualenv name pipenv --venv

All 6 comments

Full traceback:

$ pipenv install -e .
Installing -e .…
Traceback (most recent call last):
  File "/Users/pete/Library/Python/3.6/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "/Users/pete/Library/Python/3.6/lib/python/site-packages/pipenv/vendor/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/Users/pete/Library/Python/3.6/lib/python/site-packages/pipenv/vendor/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/Users/pete/Library/Python/3.6/lib/python/site-packages/pipenv/vendor/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/pete/Library/Python/3.6/lib/python/site-packages/pipenv/vendor/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/pete/Library/Python/3.6/lib/python/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/Users/pete/Library/Python/3.6/lib/python/site-packages/pipenv/cli.py", line 1869, in install
    converted = convert_deps_from_pip(package_name)
  File "/Users/pete/Library/Python/3.6/lib/python/site-packages/pipenv/utils.py", line 540, in convert_deps_from_pip
    os.path.isfile(req.name)) and not req.vcs:
  File "/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/genericpath.py", line 30, in isfile
    st = os.stat(path)
TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType

@grets @ipmb thanks for the report. We are aware of this issue and have a fix coming. I'm going to go ahead and close this as a duplicate of #960 #939 #949 #914 #817 with a fix pending in #958:

  ◰³ tempenv-0fe31406509ec  ~/g/test-pipenv-dep   master +  pipenv install '-e .'
Courtesy Notice: Pipenv found itself running within a virtual environment, so it will automatically use that environment, instead of creating its own for any project.
Creating a Pipfile for this project…
Installing -e .…
Obtaining file:///home/hawk/git/test-pipenv-dep
Installing collected packages: test-pipenv-dep
  Running setup.py develop for test-pipenv-dep
Successfully installed test-pipenv-dep

Adding -e . to Pipfile's [packages]…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
Updated Pipfile.lock (6fc905)!

ah, just ran into this as well

quick workaround - add "cjSj384E" = {path = ".", editable = true} to your Pipfile manually where cjSj384E is the hash of path to the current directory. you can get this hash from checking the currently virtualenv name pipenv --venv

@AlJohri that's a nice workaround actually!

This is resolved in #958

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hynek picture hynek  Â·  3Comments

AkiraSama picture AkiraSama  Â·  3Comments

jeyraof picture jeyraof  Â·  3Comments

bgjelstrup picture bgjelstrup  Â·  3Comments

jakul picture jakul  Â·  3Comments