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

Error check_setup.py #37

Open
pyAstroDude opened this issue Jul 3, 2019 · 3 comments
Open

Error check_setup.py #37

pyAstroDude opened this issue Jul 3, 2019 · 3 comments

Comments

@pyAstroDude
Copy link

When I run the check_setup.py I get the following error:
Traceback (most recent call last):
File "check_setup.py", line 41, in
status, pkg.ljust(13), version_installed)
UnicodeEncodeError: 'ascii' codec can't encode character '\u2713' in position 1: ordinal not in range(128)

Note that I am using a Mac OS X 10.13.6, with miniconda installation; conda version 4.7.5 and python version 3.6.8

@pyAstroDude
Copy link
Author

In the print statement I did
status.encode("utf-8")

which got rid of the error but the output is messed up i.e. cannot print the check mark

here is my output:
[b'\xe2\x9c\x93'] scikit-image 0.15.0
[b'\xe2\x9c\x93'] numpy 1.16.4
[b'\xe2\x9c\x93'] scipy 1.2.1
[b'\xe2\x9c\x93'] matplotlib 3.1.0
[b'\xe2\x9c\x93'] notebook 5.7.8
[b'X'] scikit-learn Not installed

@alexdesiqueira
Copy link
Member

Hi @pyAstroDude, I can't reproduce the error (Ubuntu-ish Linux, Anaconda with conda version 4.7.10, Python version 3.7.3):

$ python check_setup.py 
[✓] scikit-image  0.16.dev0
[✓] numpy         1.16.4
[✓] scipy         1.3.0
[✓] matplotlib    3.1.0
[✓] notebook      6.0.0
[✓] scikit-learn  0.21.2

@scikit-image/core is there anyone with a Mac or a different Python distro that can reproduce this? Thanks!

@lagru
Copy link
Member

lagru commented Jul 31, 2019

Can't reproduce on Arch-like Linux with miniconda (conda 4.7.10) and Python 3.6.9. @pyAstroDude, do you get the same behavior inside a brand-new conda environment maybe with Python 3.7?

status.encode("utf-8") actually encodes the string in bytes which you don't want. Could this error stem from the unicode support of your shell? Where does the error occur if your separate the print- and format statements into two separate statements? E.g.

s = '[{}] {:<11} {}'.format(status, pkg.ljust(13), version_installed)
print(s)

What happens if you copy this into a python interpreter inside your shell?

>>> print(b"\xe2\x9c\x93".decode("utf-8"))

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

No branches or pull requests

3 participants