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

UnicodeDecodeError when installing ansible #623

Closed
marcinkuzminski opened this Issue Sep 21, 2017 · 5 comments

Comments

Projects
None yet
4 participants
@marcinkuzminski
Copy link

marcinkuzminski commented Sep 21, 2017

Hi,

I installed pipenv 7.4.3, and trying to install ansible (pipenv install ansible) i get this traceback:

Adding ansible to Pipfile's [packages]…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
Traceback (most recent call last):
  File "/Users/marcink/.virtualenvs/cli/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "/Users/marcink/.virtualenvs/cli/lib/python2.7/site-packages/pipenv/vendor/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/Users/marcink/.virtualenvs/cli/lib/python2.7/site-packages/pipenv/vendor/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/Users/marcink/.virtualenvs/cli/lib/python2.7/site-packages/pipenv/vendor/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/marcink/.virtualenvs/cli/lib/python2.7/site-packages/pipenv/vendor/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/marcink/.virtualenvs/cli/lib/python2.7/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/Users/marcink/.virtualenvs/cli/lib/python2.7/site-packages/pipenv/cli.py", line 1555, in install
    do_lock(system=system)
  File "/Users/marcink/.virtualenvs/cli/lib/python2.7/site-packages/pipenv/cli.py", line 965, in do_lock
    project=project
  File "/Users/marcink/.virtualenvs/cli/lib/python2.7/site-packages/pipenv/utils.py", line 222, in resolve_deps
    resolved_tree = resolver.resolve()
  File "/Users/marcink/.virtualenvs/cli/lib/python2.7/site-packages/piptools/resolver.py", line 107, in resolve
    has_changed, best_matches = self._resolve_one_round()
  File "/Users/marcink/.virtualenvs/cli/lib/python2.7/site-packages/piptools/resolver.py", line 195, in _resolve_one_round
    for dep in self._iter_dependencies(best_match):
  File "/Users/marcink/.virtualenvs/cli/lib/python2.7/site-packages/piptools/resolver.py", line 274, in _iter_dependencies
    dependencies = self.repository.get_dependencies(ireq)
  File "/Users/marcink/.virtualenvs/cli/lib/python2.7/site-packages/piptools/repositories/pypi.py", line 145, in get_dependencies
    self._dependencies_cache[ireq] = reqset._prepare_file(self.finder, ireq)
  File "/Users/marcink/.virtualenvs/cli/lib/python2.7/site-packages/pipenv/patched/pip/req/req_set.py", line 620, in _prepare_file
    session=self.session, hashes=hashes)
  File "/Users/marcink/.virtualenvs/cli/lib/python2.7/site-packages/pipenv/patched/pip/download.py", line 821, in unpack_url
    hashes=hashes
  File "/Users/marcink/.virtualenvs/cli/lib/python2.7/site-packages/pipenv/patched/pip/download.py", line 663, in unpack_http_url
    unpack_file(from_path, location, content_type, link)
  File "/Users/marcink/.virtualenvs/cli/lib/python2.7/site-packages/pipenv/patched/pip/utils/__init__.py", line 605, in unpack_file
    untar_file(filename, location)
  File "/Users/marcink/.virtualenvs/cli/lib/python2.7/site-packages/pipenv/patched/pip/utils/__init__.py", line 551, in untar_file
    path = os.path.join(location, fn)
  File "/Users/marcink/.virtualenvs/cli/lib/python2.7/posixpath.py", line 73, in join
    path += '/' + b
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe3 in position 66: ordinal not in range(128)
@techalchemy

This comment has been minimized.

Copy link
Member

techalchemy commented Sep 21, 2017

Is your locale set up correctly? From the command line what is the value of the following command: echo $LANG && echo $LC_CTYPE && echo $LC_MESSAGES && echo $LC_COLLATE

These need to be set to "en_us.UTF-8" in your .bash_profile or equivalent file

@marcinkuzminski

This comment has been minimized.

Copy link
Author

marcinkuzminski commented Sep 21, 2017

Hi,

The output of these is:

en_GB.UTF-8
en_GB.UTF-8

So last two aren't set. But why pip works, virtualenv works and pipenv throws an error ?

@kenneth-reitz

This comment has been minimized.

Copy link
Contributor

kenneth-reitz commented Sep 21, 2017

pip issue, not pipenv issue

@AlJohri

This comment has been minimized.

Copy link
Contributor

AlJohri commented Sep 21, 2017

@marcinkuzminski more specifically, this seems like a pip-tools issue

related issues:

if you read through some of the issues, people have a lot of issues reproducing this bug.

10 minutes later and the same command doesn't give exception. Everything is 100% the same. Git reset same.
jazzband/pip-tools#439 (comment)

Unfortunately, after fixing it once with @byjott's approach, I was unable to reproduce - if you're debugging, watch out! I can reproduce at-will now though, if anyone would like more info.
jazzband/pip-tools#433 (comment)

@kenneth-reitz

This comment has been minimized.

Copy link
Contributor

kenneth-reitz commented Sep 21, 2017

let's get this fixed in pip-tools then!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.