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.

AttributeError: 'str' object has no attribute 'decode'

See original GitHub issue

Continued from https://github.com/kennethreitz/pipenv/issues/541#issuecomment-329518287


This issue is likely to show up on libraries that need to support both Python 2 and 3 where pipenv is being used to manage tooling. The feature:

Tell pip we’re using the required Python version, with trickery, for dependency resolution.

is keyed off python_version = "2.7", but to test that this project works with multiple versions of Python, my build matrix also runs with version of Python 3.

  1. Install Python 2
  2. Install Python 3 and set this as your global Python version
  3. Install pipenv 7.0.2
  4. Set a required Python version of 2.7 in Pipfile
  5. Run $ pipenv install --python=python2

@kennethreitz here are some build logs demonstrating the issue: https://travis-ci.org/jacebrowning/verchew/builds/275563258

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:28 (28 by maintainers)

github_iconTop GitHub Comments

1reaction
kennethreitzcommented, Sep 14, 2017

v7.0.6 released, which fixes this strange edge case.

1reaction
kennethreitzcommented, Sep 14, 2017

trying an alternative approach first.

Read more comments on GitHub >

github_iconTop Results From Across the Web

'str' object has no attribute 'decode'. Python 3 error?
You are trying to decode an object that is already decoded. You have a str , there is no need to decode from...
Read more >
Solve the attributeerror str object has no attribute decode error
This attribute error occurs because you are trying to call the decode() function on a Python string object, which is by default already...
Read more >
Attributeerror: 'str' object has no attribute 'decode' ( Solved )
The main cause of the Attributeerror: 'str' object has no attribute 'decode' is that you are already decoding the decoded strings. Decoding is...
Read more >
AttributeError: 'str' object has no attribute 'decode' | bobbyhadz
The Python "AttributeError: 'str' object has no attribute 'decode'" occurs when we call the decode() method on a string that has already ...
Read more >
How To Solve 'Str' Object Has No Attribute 'Decode' Error
The 'str' object has no attribute 'decode' error is usually noticed in Python 3. Therefore, you should try to downgrade the Python version...
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