1

I have no problems with using pip/install pyramid_mongodb on a production server. However, when it comes to pyramid_jinja2, this problem keeps popping up and it's driving me nuts. I have used pip/install and easy_install, but both doesn't seem to work.

I'm using python3.3

How should I resolve this?

root@vre [/home/vrnet/public_html/env]# sudo -u vrnet ./bin/pip install pyramid_jinja2

Downloading/unpacking pyramid-jinja2
  Running setup.py egg_info for package pyramid-jinja2
    Traceback (most recent call last):
      File "<string>", line 16, in <module>
      File "/home/vrnet/public_html/env/build/pyramid-jinja2/setup.py", line 21, in <module>
        CHANGES = open(os.path.join(here, 'CHANGES.txt')).read()
      File "/home/vrnet/public_html/env/lib64/python3.3/encodings/ascii.py", line 26, in decode
        return codecs.ascii_decode(input, self.errors)[0]
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 131: ordinal not in range(128)
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 16, in <module>

  File "/home/vrnet/public_html/env/build/pyramid-jinja2/setup.py", line 21, in <module>

    CHANGES = open(os.path.join(here, 'CHANGES.txt')).read()

  File "/home/vrnet/public_html/env/lib64/python3.3/encodings/ascii.py", line 26, in decode

    return codecs.ascii_decode(input, self.errors)[0]

UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 131: ordinal not in range(128)

----------------------------------------
Command python setup.py egg_info failed with error code 1 in /home/vrnet/public_html/env/build/pyramid-jinja2
Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Gino
  • 951
  • 1
  • 12
  • 24
  • Weird problem. I am running Python 3.3 and I can't reproduce this, using both **easy_install** and **pip**. – tshepang Feb 17 '13 at 19:35
  • I'm running python3.3 as well on a production server running on CentOS 64. I've tried out root@vre [/home/vrnet/public_html/env]# sudo -u vrnet ./bin/easy_install pyramid_jinja2. It is still the same problem: File "/home/vrnet/public_html/env/lib64/python3.3/encodings/ascii.py", line 26, in decode – Gino Feb 18 '13 at 02:47

1 Answers1

1

The package changelog has non-ascii characters in the file, breaking the package installation. I've filed a bug report about this.

You'll have to take that up with the developers, or switch to Python 2 or a different template engine instead.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
  • in that case, how should I resolve the issue. The production server has python2.6.6 installed – Gino Feb 17 '13 at 15:33
  • @Gino: if your server has 2.6 installed you *definitely* should not be using Python 3 to develop. Install Python 2.6 instead. – Martijn Pieters Feb 17 '13 at 15:34
  • thanks martijn, is there a reason not to use python3, but instead 2.6? – Gino Feb 17 '13 at 15:48
  • @Gino: Because python 3 syntax is *not* backwards compatible. If your server is running Python 2.6 only, then you need to write 2.6 compatible code for that server. – Martijn Pieters Feb 17 '13 at 15:49
  • 1
    @martjin, I was looking at this http://stackoverflow.com/questions/1534210/use-different-python-version-with-virtualenv, wouldn't setting up a virtualenv solve the issue? Sorry, I do not have much experience with python prior to this. – Gino Feb 17 '13 at 16:04
  • Hm... I stumbled upon this http://docs.pylonsproject.org/projects/pyramid/en/1.3-branch/whatsnew-1.3.html, it states that Many Pyramid add-ons are already Python 3 compatible. For example, pyramid_debugtoolbar, pyramid_jinja2, pyramid_exclog.... – Gino Feb 17 '13 at 16:07
  • @Gino: Yes, it is py 3 ready, I already updated my answer to state this is a bug in the packaging. I filed an issue with the project. – Martijn Pieters Feb 17 '13 at 16:11