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

TypeError: coercing to Unicode: need string or buffer, NoneType found #1043

Closed
ghost opened this issue Nov 8, 2017 · 9 comments
Closed

TypeError: coercing to Unicode: need string or buffer, NoneType found #1043

ghost opened this issue Nov 8, 2017 · 9 comments

Comments

@ghost
Copy link

ghost commented Nov 8, 2017

Hi,

I'm trying to install a local setup.py into my virtual environment/Pipfile:

I get this error : TypeError: coercing to Unicode: need string or buffer, NoneType found

Do you have any idea of the problem ?

Thank you in advance

Describe your environment

Mac OS X - Sierra
Python version: 3.6.3
Pipenv version: 8.3.1

Expected result
Actual result
pipenv install -e .
Installing -e .…
Traceback (most recent call last):
  File "/usr/local/Cellar/pipenv/8.3.1/libexec/bin/pipenv", line 11, in <module>
    load_entry_point('pipenv==8.3.1', 'console_scripts', 'pipenv')()
  File "/usr/local/Cellar/pipenv/8.3.1/libexec/lib/python2.7/site-packages/pipenv/vendor/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/Cellar/pipenv/8.3.1/libexec/lib/python2.7/site-packages/pipenv/vendor/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/Cellar/pipenv/8.3.1/libexec/lib/python2.7/site-packages/pipenv/vendor/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/Cellar/pipenv/8.3.1/libexec/lib/python2.7/site-packages/pipenv/vendor/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/Cellar/pipenv/8.3.1/libexec/lib/python2.7/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/Cellar/pipenv/8.3.1/libexec/lib/python2.7/site-packages/pipenv/cli.py", line 1869, in install
    converted = convert_deps_from_pip(package_name)
  File "/usr/local/Cellar/pipenv/8.3.1/libexec/lib/python2.7/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/pipenv/8.3.1/libexec/lib/python2.7/genericpath.py", line 37, in isfile
    st = os.stat(path)
TypeError: coercing to Unicode: need string or buffer, NoneType found
Steps to replicate
brew install pipenv
pipenv --python 3.6.3
pipenv install --dev

Pipfile

[[source]]

url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"

[dev-packages]

keyring = "*"
twine = "*"
"flake8" = "*"
pytest = "*"
"pytest-cov" = "*"

[packages]

requests = "*"
click = "*"
@techalchemy
Copy link
Member

@Germione did you run pipenv install --dev or did you run pipenv install -e . in order to get this error message?

If attempting the latter, try encapsulating it in quotes: pipenv install '-e .'

@craigloftus
Copy link

I'm getting the same error with pipenv install -e ~/wagtail-extension, bisecting the versions points to the problem being introduced between 8.2.7 and 8.3.0.

Interestingly, encapsulating like pipenv install "-e /home/craig/wagtail-extensions" will cause the cli help to print, where as pipenv install "-e ~/wagtail-extensions" will trigger the reported error.

I also get the error if installing the above package on its own, like pipenv install --three -e . and pipenv install --three '-e .'.

@craigloftus
Copy link

The regression seems to have been introduced in kennethreitz@0a48fa0 which is part of https://github.com/kennethreitz/pipenv/pull/926.

@techalchemy
Copy link
Member

techalchemy commented Nov 9, 2017

@craigloftus thanks for taking the time to dig into that! We actually have a fix implemented already (see #958) that corrects that regression, I’ll see about getting it merged soon

@techalchemy
Copy link
Member

In the meantime for those of you trying to install the local project root as a package you can use the advice here: https://github.com/kennethreitz/pipenv/issues/1012#issuecomment-342898222

@bofm
Copy link

bofm commented Nov 10, 2017

On Python 3.6 the error is:

TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType

(added this comment for searchability)

@ghost
Copy link
Author

ghost commented Nov 10, 2017

@techalchemy @craigloftus : Thanks for your answers
And thanks for the advice: It's working fine !!

@techalchemy
Copy link
Member

@bofm thanks for the searchtext :p maybe will reduce the number of issues on this. @Germione thank @AlJohri since it's his fault we even implemented local file install support (#540) and he is still dropping knowledge bombs to support it!

techalchemy added a commit to techalchemy/pipenv that referenced this issue Nov 14, 2017
@techalchemy
Copy link
Member

This is now resolved in #958

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