Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

python 2.7 TypeError: environment can only contain strings #209

Closed
davidovich opened this issue Oct 6, 2015 · 3 comments
Closed

python 2.7 TypeError: environment can only contain strings #209

davidovich opened this issue Oct 6, 2015 · 3 comments

Comments

@davidovich
Copy link
Contributor

I have this error on python 2.7 on Windows when at the resolve cycle.

The resolver.py module sets its unicode literals from the future import, and also wants to inject PIP_EXISTS_ACTION in the os.environ which does not accept unicode data as keys, nor values.

This makes subprocess calls issued in pip fail, because os.environ cannot contain unicode data.

Other projects have had this problem:

pallets/werkzeug#467
and
celery/django-celery#344

Other technique seen also on stackoverflow.

One suggestion is to remove the unicode_literals future import and this seems the easiest fix as it supports both python 2.7 and 3.

@davidovich
Copy link
Contributor Author

As of 1.4 this is fixed and verified.
see 3a43904
@nvie this issue can be closed.

@nvie
Copy link
Member

nvie commented Feb 21, 2016

👍

@ibobak
Copy link

ibobak commented Dec 13, 2017

This is how I fixed this problem with jupyter kernel http://ihorbobak.com/index.php/2017/12/13/pyspark-kernel-for-jupyter-in-python-2-7-windows/ but I do believe yours can be fixed the same way

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants