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 while installing for Python3.3 #62

Open
hjwp opened this issue Oct 22, 2015 · 11 comments
Open

UnicodeDecodeError while installing for Python3.3 #62

hjwp opened this issue Oct 22, 2015 · 11 comments

Comments

@hjwp
Copy link

hjwp commented Oct 22, 2015

Just came across this

File "/usr/lib/python3.3/distutils/dist.py", line 930, in run_commands[50/4922]
  self.run_command(cmd)
File "/usr/lib/python3.3/distutils/dist.py", line 949, in run_command
  cmd_obj.run()
File "/usr/local/lib/python3.3/dist-packages/numpy/distutils/command/egg_info.p
  self.run_command("build_src")
File "/usr/lib/python3.3/distutils/cmd.py", line 313, in run_command
  self.distribution.run_command(command)
File "/usr/lib/python3.3/distutils/dist.py", line 949, in run_command
  cmd_obj.run()
File "/usr/local/lib/python3.3/dist-packages/numpy/distutils/command/build_src.
  self.build_sources()
File "/usr/local/lib/python3.3/dist-packages/numpy/distutils/command/build_src.
  self.build_extension_sources(ext)
File "/usr/local/lib/python3.3/dist-packages/numpy/distutils/command/build_src.
  sources = self.f2py_sources(sources, ext)
File "/usr/local/lib/python3.3/dist-packages/numpy/distutils/command/build_src.
  ['-m', ext_name]+f_sources)
File "/usr/local/lib/python3.3/dist-packages/numpy/f2py/f2py2e.py", line 361, i
  postlist=callcrackfortran(files, options)
File "/usr/local/lib/python3.3/dist-packages/numpy/f2py/f2py2e.py", line 283, i
  postlist=crackfortran.crackfortran(files)
File "/usr/local/lib/python3.3/dist-packages/numpy/f2py/crackfortran.py", line
  readfortrancode(files, crackline)
File "/usr/local/lib/python3.3/dist-packages/numpy/f2py/crackfortran.py", line
  l=fin.readline()
File "/usr/lib/python3.3/fileinput.py", line 354, in readline
  self._buffer = self._file.readlines(self._bufsize)
File "/usr/lib/python3.3/encodings/ascii.py", line 26, in decode
  return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xce in position 5125: ordinal not in range(128)
@hjwp
Copy link
Author

hjwp commented Oct 22, 2015

Happens for pymc==2.3.2 thru pymc==2.3.6, for Python 3.4 and 3.3. Python 2.7 installs ok.

@fonnesbeck
Copy link
Member

Can you post the code that generates this error? I'd like to try to replicate it here.

@hjwp
Copy link
Author

hjwp commented Oct 22, 2015

Just pip install pymc (in a Python 3.3/3.4 virtualenv, or use pip-3.4, or whatever is available in your env to pip install for a particular python version...)

@fonnesbeck
Copy link
Member

I can't replicate this with Anaconda Python 3.3 in a virtualenv:

Collecting pymc
  Downloading pymc-2.3.6.tar.gz (348kB)
    100% |████████████████████████████████| 352kB 414kB/s 
Building wheels for collected packages: pymc
  Running setup.py bdist_wheel for pymc
  Stored in directory: /Users/fonnescj/Library/Caches/pip/wheels/b4/12/14/094b6184fc97f474640caba446f451335daaf32c5b547e1c87
Successfully built pymc
Installing collected packages: pymc
Successfully installed pymc-2.3.6

@hjwp
Copy link
Author

hjwp commented Oct 23, 2015

I'm on Ubuntu. I think it's fairly consistent, not something to do with my setup. I can repro it in a minimal dockerfile:

FROM ubuntu:trusty
RUN apt-get update
RUN apt-get install -y python3-dev python3-pip 
RUN apt-get install -y python3-numpy python3-matplotlib
RUN pip3 install pymc

@hjwp
Copy link
Author

hjwp commented Oct 23, 2015

Here's the full output from the minimal repro run: http://pastebin.com/9SEww4CT

@weijy026a
Copy link

when I install pymc in windows platform use “pip install pymc", it will report this error:

 File "c:\Python34\lib\site-packages\numpy\f2py\crackfortran.py", line 336, in readfortrancode
    l=fin.readline()
  File "c:\Python34\lib\fileinput.py", line 363, in readline
    self._buffer = self._file.readlines(self._bufsize)
UnicodeDecodeError: 'gbk' codec can't decode byte 0xa1 in position 6844: illegal multibyte sequence

@hjwp
Copy link
Author

hjwp commented Oct 28, 2015

I fixed it by setting the LANG environment variable(s):

LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_ALL=en_US.UTF-8

But it might be nice to get it working without that...

@fonnesbeck
Copy link
Member

We do have a .cfg file for Debian installs. Would it work to put these there?

@mr-mcox
Copy link

mr-mcox commented Aug 1, 2016

Ran into the same issue myself on a Mac (10.11) using Python 3.5. hjwp's environment variable fix worked for me to successfully install. pymc-devs/pymc#62 (comment)

@mgdreamingstar
Copy link

#62 (comment) did't work for me. I got the same error:
UnicodeDecodeError: 'gbk' codec can't decode byte 0xa1 in position 6844: illegal multibyte sequence

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

5 participants