Duke79
Duke79

Reputation: 927

'pipenv install' fails with TypeError: must be str, not type

Here's the full error log -

C:\Dev\libpython\src>pipenv install
Creating a virtualenv for this project…
Pipfile: C:\Dev\libpython\src\Pipfile
Using C:/Python/Python36-64/python.exe (3.6.6) to create virtualenv…
Running virtualenv with interpreter C:/Python/Python36-64/python.exe
Using base prefix 'C:\\Python\\Python36-64'
New python executable in C:\Users\Pulkit\.virtualenvs\src-PtwTDfFP\Scripts\python.exe
Cannot find a wheel for pip
Installing setuptools, pip, wheel...
  Complete output from command C:\Users\Pulkit\.vir...P\Scripts\python.exe - setuptools pip wheel:
  Traceback (most recent call last):
  File "<stdin>", line 8, in <module>
ModuleNotFoundError: No module named 'pip'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 11, in <module>
ModuleNotFoundError: No module named 'pip'
----------------------------------------
...Installing setuptools, pip, wheel...done.
Traceback (most recent call last):
  File "c:\python\python36-64\lib\site-packages\virtualenv.py", line 2343, in <module>
    main()
  File "c:\python\python36-64\lib\site-packages\virtualenv.py", line 712, in main
    symlink=options.symlink)
  File "c:\python\python36-64\lib\site-packages\virtualenv.py", line 947, in create_environment
    download=download,
  File "c:\python\python36-64\lib\site-packages\virtualenv.py", line 904, in install_wheel
    call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=SCRIPT)
  File "c:\python\python36-64\lib\site-packages\virtualenv.py", line 796, in call_subprocess
    % (cmd_desc, proc.returncode))
OSError: Command C:\Users\Pulkit\.vir...P\Scripts\python.exe - setuptools pip wheel failed with error code 1

Traceback (most recent call last):
  File "c:\python\python36-64\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\python\python36-64\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Python\Python36-64\Scripts\pipenv.exe\__main__.py", line 9, in <module>
  File "c:\python\python36-64\lib\site-packages\pipenv\vendor\click\core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "c:\python\python36-64\lib\site-packages\pipenv\vendor\click\core.py", line 717, in main
    rv = self.invoke(ctx)
  File "c:\python\python36-64\lib\site-packages\pipenv\vendor\click\core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "c:\python\python36-64\lib\site-packages\pipenv\vendor\click\core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "c:\python\python36-64\lib\site-packages\pipenv\vendor\click\core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "c:\python\python36-64\lib\site-packages\pipenv\vendor\click\decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "c:\python\python36-64\lib\site-packages\pipenv\vendor\click\core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "c:\python\python36-64\lib\site-packages\pipenv\vendor\click\decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "c:\python\python36-64\lib\site-packages\pipenv\cli\command.py", line 249, in install
    editable_packages=state.installstate.editables,
  File "c:\python\python36-64\lib\site-packages\pipenv\core.py", line 1724, in do_install
    pypi_mirror=pypi_mirror,
  File "c:\python\python36-64\lib\site-packages\pipenv\core.py", line 565, in ensure_project
    pypi_mirror=pypi_mirror,
  File "c:\python\python36-64\lib\site-packages\pipenv\core.py", line 500, in ensure_virtualenv
    python=python, site_packages=site_packages, pypi_mirror=pypi_mirror
  File "c:\python\python36-64\lib\site-packages\pipenv\core.py", line 901, in do_create_virtualenv
    click.echo(crayons.blue("{0}".format(c.err)), err=True)
  File "c:\python\python36-64\lib\site-packages\pipenv\vendor\delegator.py", line 146, in err
    return self._pexpect_out
  File "c:\python\python36-64\lib\site-packages\pipenv\vendor\delegator.py", line 114, in _pexpect_out
    result += self.subprocess.after
TypeError: must be str, not type

I have tried downgrading pip from (18.1 to 9.0.1) and also downgrading pipenv, it did not resolve the issue.

This stupid policy keeps telling to add more details, hence everything after this is only a filler. I was so happy to publish my first package in pypa but then this stupid issue happened. I have wasted a lot of time already.

Upvotes: 2

Views: 410

Answers (1)

Duke79
Duke79

Reputation: 927

Manged to fix the issue temporarily by downgrading virtualenv -

pip install virtualenv==15.* --upgrade

Upvotes: 1

Related Questions