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

Tutorial example not working in Python 2.7 #22

Open
Gabriel-p opened this issue Jul 27, 2018 · 2 comments
Open

Tutorial example not working in Python 2.7 #22

Gabriel-p opened this issue Jul 27, 2018 · 2 comments

Comments

@Gabriel-p
Copy link

Gabriel-p commented Jul 27, 2018

I'm testing sampyl v0.3 in a conda environment running Python 2.7.15. I tried running the simple example shown here http://matatat.org/sampyl/, and I get:

Traceback (most recent call last):
  File "/home/gabriel/Dropbox/python-test/sampyl_test.py", line 13, in <module>
    nuts = smp.NUTS(logp, start)
  File "/home/gabriel/anaconda3/envs/asteca27/lib/python2.7/site-packages/sampyl/samplers/NUTS.py", line 77, in __init__
    super(NUTS, self).__init__(logp, start, **kwargs)
  File "/home/gabriel/anaconda3/envs/asteca27/lib/python2.7/site-packages/sampyl/samplers/base.py", line 32, in __init__
    start = {unicodedata.normalize('NFKC', key): val for key, val in start.items()}
  File "/home/gabriel/anaconda3/envs/asteca27/lib/python2.7/site-packages/sampyl/samplers/base.py", line 32, in <dictcomp>
    start = {unicodedata.normalize('NFKC', key): val for key, val in start.items()}
TypeError: normalize() argument 2 must be unicode, not str

Could this be related to the oldish version of Python I'm running?

@mezaugusto
Copy link

I have the same issue in python2, and changing to python3 fixed the issue it should work nontheless as python2 is supported.

@Gabriel-p
Copy link
Author

Since @amppumas confirmed that this is an issue with Python 2.7, I'll change the title of the issue.

@Gabriel-p Gabriel-p changed the title Tutorial example not working Tutorial example not working in Python 2.7 Jul 28, 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

2 participants