question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

crayons TypeError in core.py

See original GitHub issue

I am having a special setup. I have a docker in which I create an emulated ARM rootfs using QEMU. Inside the emulated rootfs , I am going to create a virtual environment using pipenv which I can use later on my ARM target. What is happening now is that I am always receiving the following exception:

Traceback (most recent call last):
  File "/usr/local/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/pipenv/cli.py", line 416, in install
    selective_upgrade=selective_upgrade,
  File "/usr/local/lib/python3.6/site-packages/pipenv/core.py", line 1789, in do_install
    skip_requirements=skip_requirements,
  File "/usr/local/lib/python3.6/site-packages/pipenv/core.py", line 641, in ensure_project
    crayons.green(shorten_path(path_to_python)),
TypeError: __str__ returned non-string (type NoneType)

As I traced the exception, I found out that problem here is that the python_version() method returns None in my case. Then as I use docker exec to run pipenv install, I think I am mixing different shell environment, therefore crayons.green cannot convert None type to string. My proposal would be simply just use str in all crayons e.g. crayons.green(str(python_version(path_to_python)))

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

5reactions
semiversuscommented, Sep 14, 2018

Here are two other issues addressing the same problem: #2650, #1969 . And as already mentioned something in detection of used python version is broken. For me adding --system (pipenv install --system) solved the issue.

5reactions
techalchemycommented, Jul 20, 2018

Please fill out the issue template in full. The bug is not in crayons no matter how many times we see the same output. We have issue templates for a reason. I appreciate that everyone is taking time to troubleshoot, we also spent months (or years) building the library and if you can’t spend the time to fill out an issue template we can’t offer you any support.

Read more comments on GitHub >

github_iconTop Results From Across the Web

pipenv: TypeError: coercing to Unicode: need string or buffer ...
I am trying to install pyspark 2.4.0 in my project repository using pipenv. I am trying to create a virtualenv to avoid clash...
Read more >
TypeError: String Indices Must be Integers - Java2Blog
In this post, we will see about TypeError: String Indices Must be Integers in Python. You can access the characters of string by...
Read more >
How to use the pipenv.vendor.delegator.run function in pipenv | Snyk
normal(u'(this may take a few minutes)'), crayons.normal(u'...', bold=True), ) ) with spinner(): # Install Python. c = delegator.run( 'pyenv install {0} -s'.
Read more >
《Flask入门教程》第1章:安装Flask 报错,求解答
... /3.7/lib/python3.7/site-packages/pipenv/vendor/click/core.py", ... extras = _strip_extras(line) TypeError: 'module' object is not ...
Read more >
Python Examples of delegator.run - ProgramCreek.com
Source Project: pipenv Author: pypa File: core.py License: MIT License ... Script): raise TypeError("Command input must be a string, list or tuple") if ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found