Pipenv: `TypeError: can only concatenate str (not "type") to str` instead of actual error

Created on 25 Oct 2018  Â·  6Comments  Â·  Source: pypa/pipenv

Issue description

In some cases, pipenv outputs TypeError: can only concatenate str (not "type") to str instead of the actual error (or after printing out the actual error). It faces an error while handling the actual error.

Steps to replicate

Set WORKON_HOME to somewhere that current user doesn't have permission for writing to. Example:

WORKON_HOME=/opt/ pipenv install


I encountered the issue on the latest source code from the Github.

Type Vendored Dependencies

Most helpful comment

@techalchemy Hi, I found it is TIMEOUT. I made a PR https://github.com/pypa/pipenv/pull/3159 for that.

All 6 comments

I get this error by starting pipenv shell. There actually two errors I found:

ModuleNotFoundError: No module named 'pkgutil'

and

TypeError: can only concatenate str (not "type") to str

directly after running pipenv shell

C:\Users\Me\git\pdf-organize-automation>pipenv shell
Creating a virtualenv for this project…
Pipfile: C:\Users\Me\git\pdf-organize-automation\Pipfile
Using c:\users\me\appdata\local\programs\python\python37\python.exe (3.7.0) to create virtualenv…

I am not sure, what I can do

The issue is a problem with a dependency in pipenv. You can fix this by installing from the working update until the release is out: pip install git+https://github.com/pypa/pipenv.git@update-vendor#egg=pipenv

Hi @techalchemy Could you look at this issue again? I still get this issue when I installed latest master branch with commit e3ee806. Thanks.

✗ pipenv lock
Locking [dev-packages] dependencies...
✔ Success! Locking...
Traceback (most recent call last):
  File "/usr/local/bin/pipenv", line 11, in <module>
    load_entry_point('pipenv==2018.10.14.dev0', 'console_scripts', 'pipenv')()
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/cli/command.py", line 316, in lock
    pypi_mirror=state.pypi_mirror,
  File "/usr/local/lib/python2.7/dist-packages/pipenv/core.py", line 1082, in do_lock
    pypi_mirror=pypi_mirror,
  File "/usr/local/lib/python2.7/dist-packages/pipenv/utils.py", line 403, in venv_resolve_deps
    return json.loads(c.out.split("RESULTS:")[1].strip())
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/delegator.py", line 133,in out
    self.__out = self._pexpect_out
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/delegator.py", line 117,in _pexpect_out
    result += self.subprocess.after
TypeError: cannot concatenate 'str' and 'type' objects

Yikes. Any chance you can print or log the type? I’m guessing it’s an EOF still?

@techalchemy Hi, I found it is TIMEOUT. I made a PR https://github.com/pypa/pipenv/pull/3159 for that.

Hi ,

When I am trying to build pypika query for casting I am also getting same error, The code snippet will be(TypeError: can only concatenate str (not "type") to str)

col_name = 'fn.Cast(' + aliasName + '.' + columnNamevalue + ','+ SqlTypes +'.'+ castTypevalue+')'

Can any one help on this

Was this page helpful?
0 / 5 - 0 ratings