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

pipenv install -e . fails with “stat: can't specify None for path argument” #1037

Closed
motet-a opened this issue Nov 6, 2017 · 6 comments

Comments

@motet-a
Copy link

motet-a commented Nov 6, 2017

This happens when I run pipenv install -e . in an empty directory:

$ mkdir etiusrantesiunateruinate
$ cd etiusrantesiunateruinate
$ pipenv install -e .
Creating a virtualenv for this project…
⠋Using base prefix '/usr'
New python executable in /home/antoine/.local/share/virtualenvs/etiusrantesiunateruinate-Qd-Qq2kN/bin/python3
Also creating executable in /home/antoine/.local/share/virtualenvs/etiusrantesiunateruinate-Qd-Qq2kN/bin/python
Installing setuptools, pip, wheel...done.

Virtualenv location: /home/antoine/.local/share/virtualenvs/etiusrantesiunateruinate-Qd-Qq2kN
Creating a Pipfile for this project…
Installing -e .…
Traceback (most recent call last):
  File "/home/antoine/.local/bin//pipenv", line 11, in <module>
    sys.exit(cli())
  File "/home/antoine/.local/lib/python3.5/site-packages/pipenv/vendor/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/antoine/.local/lib/python3.5/site-packages/pipenv/vendor/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/antoine/.local/lib/python3.5/site-packages/pipenv/vendor/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/antoine/.local/lib/python3.5/site-packages/pipenv/vendor/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/antoine/.local/lib/python3.5/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/antoine/.local/lib/python3.5/site-packages/pipenv/cli.py", line 1880, in install
    converted = convert_deps_from_pip(package_name)
  File "/home/antoine/.local/lib/python3.5/site-packages/pipenv/utils.py", line 547, in convert_deps_from_pip
    os.path.isfile(req.name)) and not req.vcs:
  File "/usr/lib/python3.5/genericpath.py", line 30, in isfile
    st = os.stat(path)
TypeError: stat: can't specify None for path argument

Environment

$ cat /etc/debian_version 
buster/sid
$ python3 -V
Python 3.5.4
$ pipenv --version
pipenv, version 8.3.2
@techalchemy
Copy link
Member

This is a know issue related to several others which I dont have time to link, but you can work around it for your use case by enclosing in single quotes: pipenv install ‘-e .’

@motet-a
Copy link
Author

motet-a commented Nov 6, 2017

I have the same issue with pipenv install '-e .', pipenv install "-e .", pipenv install -e /some/absolute/path/, pipenv install -e /some/absolute/path and so on. It doesn't look like an argument parsing issue, does it?

@techalchemy
Copy link
Member

@motet-a er sorry,. I responded before I had my coffee this morning. You can't pipenv install -e . in an empty directory because there is nothing to install. This is the same as if you pip install -e .. Both commands can only install a directory with a setup.py file, aka a python package. In this case it is not an argument parsing issue, it is an issue with not having something to install.

pipenv install must be passed either a package to install, or nothing (if there is a Pipfile in your directory already). There is an additional bug that affects installing local paths, but that doesn't impact -e .

It is on our to-do list to improve the error messaging on this.

 ~  mkdir /tmp/test
 ~  cd /tmp/test
 /t/test  pip install -e .
Directory '.' is not installable. File 'setup.py' not found.

@motet-a
Copy link
Author

motet-a commented Nov 6, 2017

Thanks!

@wooyek
Copy link

wooyek commented Nov 22, 2017

pip install -e . works fine but pipenv-8.3.2 fails.

janusz@hagrid 🐍 django-opt-out-dRWm0dFI /d/w/w/django-opt-out >ls setup.*
setup.cfg  setup.py*
janusz@hagrid 🐍 django-opt-out-dRWm0dFI /d/w/w/django-opt-out >pipenv install -e .  
Installing -e .…
Traceback (most recent call last):
  File "/home/janusz/.local/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "/data/janusz/.local/venvs/pipenv/lib/python3.5/site-packages/pipenv/vendor/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/data/janusz/.local/venvs/pipenv/lib/python3.5/site-packages/pipenv/vendor/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/data/janusz/.local/venvs/pipenv/lib/python3.5/site-packages/pipenv/vendor/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/data/janusz/.local/venvs/pipenv/lib/python3.5/site-packages/pipenv/vendor/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/data/janusz/.local/venvs/pipenv/lib/python3.5/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/janusz/.local/venvs/pipenv/lib/python3.5/site-packages/pipenv/cli.py", line 1869, in install
    converted = convert_deps_from_pip(package_name)
  File "/home/janusz/.local/venvs/pipenv/lib/python3.5/site-packages/pipenv/utils.py", line 540, in convert_deps_from_pip
    os.path.isfile(req.name)) and not req.vcs:
  File "/home/janusz/.local/venvs/pipenv/lib/python3.5/genericpath.py", line 30, in isfile
    st = os.stat(path)
TypeError: stat: can't specify None for path argument

Any suggestions?

@techalchemy
Copy link
Member

@wooyek your issue is not the same as this one but is a duplicate of #1104 #1028 #1012 #945 #939 and all the way back to #540. It is fixed in master by #958 and #1095 and you can use this workaround if you need: https://github.com/kennethreitz/pipenv/issues/1012#issuecomment-342898222

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants