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: can only concatenate str (not "type") to str` instead of actual error #3102

aidin36 opened this issue Oct 25, 2018 · 6 comments


Copy link

@aidin36 aidin36 commented Oct 25, 2018

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.

Copy link

@equaliser0 equaliser0 commented Oct 26, 2018

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

ModuleNotFoundError: No module named 'pkgutil'


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

Copy link

@techalchemy techalchemy commented Oct 27, 2018

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+

Copy link

@jxltom jxltom commented Nov 1, 2018

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/", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/cli/", line 316, in lock
  File "/usr/local/lib/python2.7/dist-packages/pipenv/", line 1082, in do_lock
  File "/usr/local/lib/python2.7/dist-packages/pipenv/", 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/", line 133,in out
    self.__out = self._pexpect_out
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/", line 117,in _pexpect_out
    result += self.subprocess.after
TypeError: cannot concatenate 'str' and 'type' objects
Copy link

@techalchemy techalchemy commented Nov 3, 2018

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

Copy link

@jxltom jxltom commented Nov 4, 2018

@techalchemy Hi, I found it is TIMEOUT. I made a PR #3159 for that.

Copy link

@namanipradeep namanipradeep commented Apr 6, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

5 participants