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

Install problem in v0.4 with python-3.6 #289

Closed
yurivict opened this issue Mar 26, 2018 · 13 comments
Closed

Install problem in v0.4 with python-3.6 #289

yurivict opened this issue Mar 26, 2018 · 13 comments

Comments

@yurivict
Copy link

===>  Configuring for py36-OpenFermion-0.4
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "setup.py", line 22, in <module>
    long_description = open('README.rst').read()
  File "/usr/local/lib/python3.6/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 6126: ordinal not in range(128)

Succeeds with python-2.7

@babbush
Copy link
Contributor

babbush commented Mar 26, 2018

Hmm, haven't seen this one before. You run into this while trying to install the develop branch?

@yurivict
Copy link
Author

You run into this while trying to install the develop branch?

No, it's with version 0.4.

@babbush babbush changed the title Fails with python-3.6 Install problem in v0.4 with python-3.6 Mar 26, 2018
@kevinsung
Copy link
Collaborator

@yurivict Would you mind trying again after replacing the line

long_description = open('README.rst').read()

with

long_description = open('README.rst', encoding='utf-8').read()

in setup.py?

@kevinsung
Copy link
Collaborator

@yurivict wait... I just realized you can't do that if you're installing from pip; you'd need to get the source code (for instance, by cloning this repository) and install it from source.

@kevinsung
Copy link
Collaborator

kevinsung commented Mar 26, 2018

The problem seems to be that on some systems (including @yurivict 's), Python uses the ASCII encoding by default to read files, but we probably didn't limit ourselves to a 128-character alphabet when writing the README. So perhaps we should update setup.py to explicitly specify reading with UTF-8 (by making the change I mentioned above).

@babbush
Copy link
Contributor

babbush commented Mar 26, 2018

If you make that change and Travis doesn't complain, I'll happily merge.

@babbush
Copy link
Contributor

babbush commented Mar 26, 2018

@yurivict would you mind trying to install the develop branch and letting us know if @kevinsung 's PR solves your problem?

@yurivict
Copy link
Author

would you mind trying to install the develop branch and letting us know if @kevinsung 's PR solves your problem?

===>  Configuring for py27-OpenFermion-0.4
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "setup.py", line 22, in <module>
    long_description = open('README.rst', encoding='utf-8').read()
TypeError: 'encoding' is an invalid keyword argument for this function
*** Error code 1

@kevinsung
Copy link
Collaborator

Wow it turns out that Python 2.7 does not support the encoding keyword argument to open. How did my PR pass Travis?!

@kevinsung
Copy link
Collaborator

Wait this can probably be fixed with __future__. Incoming PR...

@babbush
Copy link
Contributor

babbush commented Mar 26, 2018

@yurivict would you mind trying to install the develop branch one more time? PR #291 may have resolved it. I cannot replicate this error on my machine so your input is crucial.

@yurivict
Copy link
Author

Yes, now the problem is gone.

@babbush
Copy link
Contributor

babbush commented Mar 26, 2018

Excellent we'll close the issue then. Thanks @kevinsung !

@babbush babbush closed this as completed Mar 26, 2018
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