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

Trying to install module chat, but i get another error as below, please show me how to fix it.
Thank you very much

    frappe@scm-u-sky:~/frappe-bench$ pip install chat
Collecting chat
  Using cached chat-1.0.5.dev80.tar.gz
Requirement already satisfied: pbr==3.1.1 in /usr/local/lib/python2.7/dist-packages (from chat)
Requirement already satisfied: jieba==0.38 in /usr/local/lib/python2.7/dist-packages (from chat)
Requirement already satisfied: numpy==1.12.1 in /usr/local/lib/python2.7/dist-packages (from chat)
Requirement already satisfied: py2neo==3.1.2 in /usr/local/lib/python2.7/dist-packages (from chat)
Requirement already satisfied: requests==2.12.1 in /usr/local/lib/python2.7/dist-packages (from chat)
Requirement already satisfied: xlrd==1.0.0 in /usr/local/lib/python2.7/dist-packages (from chat)
Requirement already satisfied: xlwt==1.2.0 in /usr/local/lib/python2.7/dist-packages (from chat)
Requirement already satisfied: pypinyin==0.22.0 in /usr/local/lib/python2.7/dist-packages (from chat)
Requirement already satisfied: enum34; python_version < "3.4" in /usr/local/lib/python2.7/dist-packages (from pypinyin==0.22.0->chat)
Building wheels for collected packages: chat
  Running setup.py bdist_wheel for chat ... error
  Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-5asEUh/chat/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpyuyKsapip-wheel- --python-tag cp27:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-2.7
  creating build/lib.linux-x86_64-2.7/chat
  copying chat/tts.py -> build/lib.linux-x86_64-2.7/chat
  copying chat/qa.py -> build/lib.linux-x86_64-2.7/chat
  copying chat/server.py -> build/lib.linux-x86_64-2.7/chat
  copying chat/__init__.py -> build/lib.linux-x86_64-2.7/chat
  copying chat/upload.py -> build/lib.linux-x86_64-2.7/chat
  copying chat/download.py -> build/lib.linux-x86_64-2.7/chat
  copying chat/testcase.py -> build/lib.linux-x86_64-2.7/chat
  copying chat/semantic.py -> build/lib.linux-x86_64-2.7/chat
  copying chat/api.py -> build/lib.linux-x86_64-2.7/chat
  copying chat/word2pinyin.py -> build/lib.linux-x86_64-2.7/chat
  copying chat/database.py -> build/lib.linux-x86_64-2.7/chat
  copying chat/kg.py -> build/lib.linux-x86_64-2.7/chat
  copying chat/client.py -> build/lib.linux-x86_64-2.7/chat
  copying chat/qa_no_scenes.py -> build/lib.linux-x86_64-2.7/chat
  copying chat/mytools.py -> build/lib.linux-x86_64-2.7/chat
  running egg_info
  writing requirements to chat.egg-info/requires.txt
  writing chat.egg-info/PKG-INFO
  writing top-level names to chat.egg-info/top_level.txt
  writing dependency_links to chat.egg-info/dependency_links.txt
  [pbr] Reusing existing SOURCES.txt
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-build-5asEUh/chat/setup.py", line 6, in <module>
      setuptools.setup(setup_requires=['pbr'], pbr=True)
    File "/usr/local/lib/python2.7/dist-packages/setuptools/__init__.py", line 129, in setup
      return distutils.core.setup(**attrs)
    File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
      dist.run_commands()
    File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
      self.run_command(cmd)
    File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
      cmd_obj.run()
    File "/usr/local/lib/python2.7/dist-packages/wheel/bdist_wheel.py", line 204, in run
      self.run_command('build')
    File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
      self.distribution.run_command(command)
    File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
      cmd_obj.run()
    File "/usr/lib/python2.7/distutils/command/build.py", line 128, in run
      self.run_command(cmd_name)
    File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
      self.distribution.run_command(command)
    File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
      cmd_obj.run()
    File "/usr/local/lib/python2.7/dist-packages/setuptools/command/build_py.py", line 53, in run
      self.build_package_data()
    File "/usr/local/lib/python2.7/dist-packages/setuptools/command/build_py.py", line 118, in build_package_data
      for package, src_dir, build_dir, filenames in self.data_files:
    File "/usr/local/lib/python2.7/dist-packages/setuptools/command/build_py.py", line 66, in __getattr__
      self.data_files = self._get_data_files()
    File "/usr/local/lib/python2.7/dist-packages/setuptools/command/build_py.py", line 82, in _get_data_files
      self.analyze_manifest()
    File "/usr/local/lib/python2.7/dist-packages/setuptools/command/build_py.py", line 138, in analyze_manifest
      self.run_command('egg_info')
    File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
      self.distribution.run_command(command)
    File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
      cmd_obj.run()
    File "/usr/local/lib/python2.7/dist-packages/setuptools/command/egg_info.py", line 278, in run
      self.find_sources()
    File "/usr/local/lib/python2.7/dist-packages/pbr/packaging.py", line 517, in find_sources
      for entry in open(manifest_filename, 'r').read().split('\n'):
  UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 5935: ordinal not in range(128)

  ----------------------------------------
  Failed building wheel for chat
  Running setup.py clean for chat
Failed to build chat
Installing collected packages: chat
  Running setup.py install for chat ... error
    Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-5asEUh/chat/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-__pCW9-record/install-record.txt --single-version-externally-managed --compile:
    running install
    [pbr] Generating AUTHORS
    [pbr] AUTHORS complete (0.0s)
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-2.7
    creating build/lib.linux-x86_64-2.7/chat
    copying chat/tts.py -> build/lib.linux-x86_64-2.7/chat
    copying chat/qa.py -> build/lib.linux-x86_64-2.7/chat
    copying chat/server.py -> build/lib.linux-x86_64-2.7/chat
    copying chat/__init__.py -> build/lib.linux-x86_64-2.7/chat
    copying chat/upload.py -> build/lib.linux-x86_64-2.7/chat
    copying chat/download.py -> build/lib.linux-x86_64-2.7/chat
    copying chat/testcase.py -> build/lib.linux-x86_64-2.7/chat
    copying chat/semantic.py -> build/lib.linux-x86_64-2.7/chat
    copying chat/api.py -> build/lib.linux-x86_64-2.7/chat
    copying chat/word2pinyin.py -> build/lib.linux-x86_64-2.7/chat
    copying chat/database.py -> build/lib.linux-x86_64-2.7/chat
    copying chat/kg.py -> build/lib.linux-x86_64-2.7/chat
    copying chat/client.py -> build/lib.linux-x86_64-2.7/chat
    copying chat/qa_no_scenes.py -> build/lib.linux-x86_64-2.7/chat
    copying chat/mytools.py -> build/lib.linux-x86_64-2.7/chat
    running egg_info
    writing requirements to chat.egg-info/requires.txt
    writing chat.egg-info/PKG-INFO
    writing top-level names to chat.egg-info/top_level.txt
    writing dependency_links to chat.egg-info/dependency_links.txt
    [pbr] Reusing existing SOURCES.txt
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-5asEUh/chat/setup.py", line 6, in <module>
        setuptools.setup(setup_requires=['pbr'], pbr=True)
      File "/usr/local/lib/python2.7/dist-packages/setuptools/__init__.py", line 129, in setup
        return distutils.core.setup(**attrs)
      File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
        dist.run_commands()
      File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
        self.run_command(cmd)
      File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
      File "/usr/local/lib/python2.7/dist-packages/pbr/packaging.py", line 200, in run
        return du_install.install.run(self)
      File "/usr/lib/python2.7/distutils/command/install.py", line 601, in run
        self.run_command('build')
      File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
        self.distribution.run_command(command)
      File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
      File "/usr/lib/python2.7/distutils/command/build.py", line 128, in run
        self.run_command(cmd_name)
      File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
        self.distribution.run_command(command)
      File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
      File "/usr/local/lib/python2.7/dist-packages/setuptools/command/build_py.py", line 53, in run
        self.build_package_data()
      File "/usr/local/lib/python2.7/dist-packages/setuptools/command/build_py.py", line 118, in build_package_data
        for package, src_dir, build_dir, filenames in self.data_files:
      File "/usr/local/lib/python2.7/dist-packages/setuptools/command/build_py.py", line 66, in __getattr__
        self.data_files = self._get_data_files()
      File "/usr/local/lib/python2.7/dist-packages/setuptools/command/build_py.py", line 82, in _get_data_files
        self.analyze_manifest()
      File "/usr/local/lib/python2.7/dist-packages/setuptools/command/build_py.py", line 138, in analyze_manifest
        self.run_command('egg_info')
      File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
        self.distribution.run_command(command)
      File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
      File "/usr/local/lib/python2.7/dist-packages/setuptools/command/egg_info.py", line 278, in run
        self.find_sources()
      File "/usr/local/lib/python2.7/dist-packages/pbr/packaging.py", line 517, in find_sources
        for entry in open(manifest_filename, 'r').read().split('\n'):
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 5935: ordinal not in range(128)

    ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-5asEUh/chat/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-__pCW9-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-5asEUh/chat/

chat package from PIP has nothing to do with recent addition of chat to Frappe. Which version of Frappe do you have?

1 Like

Not sure which version of my site.
I did bench update from v9 and it asked me to upgrade to v10, then i got that error.

Please show the output of bench version

please see below:

frappe@scm-u-sky:~/frappe-bench$ bench version
erpnext 10.0.4
frappe 10.0.5
frappe@scm-u-sky:~/frappe-bench$

Thanks. I’ve just checked the instance with same versions and there is no any error.

Do you use in your instance any script other than latin?

Not really, i am not using any custom script, all is default.

That is the flat installation with default data only.

I mean alphabet other than Latin (e.g. Arabic, Chinese, Cyrillic etc.) You have a Unicode-related error:

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

Ah, i see.
But, my site is only using English.

Then probably you should file an issue to GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript

1 Like

well, seems it’s fixed by DEV. Thanks @DEV

The log is attached below:

  frappe@scm-u-sky:~/frappe-bench$ bench update
INFO:bench.utils:updating bench
INFO:bench.utils:git pull
remote: Counting objects: 4, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 4 (delta 3), reused 1 (delta 1), pack-reused 0
Unpacking objects: 100% (4/4), done.
From https://github.com/frappe/bench
   b3bc4a6..76aff28  master     -> origin/master
Updating b3bc4a6..76aff28
Fast-forward
 requirements.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
remote: Counting objects: 115, done.
remote: Compressing objects: 100% (30/30), done.
remote: Total 115 (delta 87), reused 81 (delta 76), pack-reused 9
Receiving objects: 100% (115/115), 37.66 KiB | 0 bytes/s, done.
Resolving deltas: 100% (87/87), completed with 44 local objects.
From https://github.com/frappe/frappe
   0c3eb1ece..995a384d4  develop    -> upstream/develop
INFO:bench.utils:./env/bin/pip install Pillow
Requirement already satisfied: Pillow in ./env/lib/python2.7/site-packages
Requirement already satisfied: olefile in ./env/lib/python2.7/site-packages (from Pillow)
INFO:bench.app:pulling frappe
INFO:bench.utils:git pull  upstream develop
From https://github.com/frappe/frappe
 * branch                develop    -> FETCH_HEAD
Updating 0c3eb1ece..995a384d4
Fast-forward
 .../chat/doctype/chat_profile/test_chat_profile.py |  89 ++--
 frappe/commands/utils.py                           |   1 -
 frappe/desk/form/assign_to.py                      |   5 +-
 frappe/hooks.py                                    |   2 +-
 frappe/public/css/chat.css                         |   7 +
 frappe/public/css/tree.css                         |  40 +-
 frappe/public/js/frappe/chat.js                    |  14 +-
 frappe/public/js/frappe/dom.js                     |   5 +
 frappe/public/js/frappe/form/grid.js               |  65 ---
 frappe/public/js/frappe/ui/dialog.js               |   2 +-
 frappe/public/js/frappe/ui/sidebar.js              |  17 +-
 frappe/public/js/frappe/ui/tags.js                 |   5 +-
 frappe/public/js/frappe/ui/toolbar/navbar.html     |   6 +-
 frappe/public/js/frappe/ui/toolbar/toolbar.js      |   2 +-
 frappe/public/js/frappe/ui/tree.js                 | 446 ++++++++++-----------
 .../public/js/frappe/views/reports/report_view.js  | 100 ++++-
 frappe/public/js/frappe/views/treeview.js          |  64 ++-
 frappe/public/js/lib/frappe-datatable.js           |   2 +-
 frappe/public/less/chat.less                       |  18 +
 frappe/public/less/tree.less                       |  35 +-
 frappe/share.py                                    |   5 +-
 socketio.js                                        |   9 -
 22 files changed, 510 insertions(+), 429 deletions(-)
INFO:bench.utils:find . -name "*.pyc" -delete
INFO:bench.app:pulling erpnext
INFO:bench.utils:git pull  upstream develop
remote: Counting objects: 48, done.
remote: Compressing objects: 100% (23/23), done.
remote: Total 48 (delta 44), reused 26 (delta 25), pack-reused 0
Unpacking objects: 100% (48/48), done.
From https://github.com/frappe/erpnext
 * branch                develop    -> FETCH_HEAD
   ddd5bf736..c33788a91  develop    -> upstream/develop
Updating ddd5bf736..c33788a91
Fast-forward
 erpnext/config/healthcare.py                       | 31 +++++------
 .../test_student_attendance_tool.js                |  2 +-
 .../doctype/consultation/consultation.js           | 54 -------------------
 .../doctype/consultation/consultation.json         | 63 +---------------------
 .../doctype/consultation/consultation.py           |  4 +-
 erpnext/healthcare/doctype/lab_test/lab_test.py    |  2 +-
 .../patient_appointment/patient_appointment.json   |  4 +-
 .../patient_medical_record.json                    |  4 +-
 .../healthcare/doctype/vital_signs/vital_signs.py  | 14 ++---
 erpnext/hr/doctype/salary_slip/test_salary_slip.js |  2 +-
 erpnext/public/js/controllers/transaction.js       |  2 +-
 erpnext/stock/doctype/item/item.json               |  3 +-
 .../test_stock_reconciliation.js                   |  1 +
 13 files changed, 38 insertions(+), 148 deletions(-)
INFO:bench.utils:find . -name "*.pyc" -delete
Updating Python libraries...
INFO:bench.utils:./env/bin/pip install --upgrade pip
Requirement already up-to-date: pip in ./env/lib/python2.7/site-packages
INFO:bench.utils:./env/bin/pip install -q -r /home/frappe/.bench/requirements.txt
INFO:bench.utils:./env/bin/pip install -q -r ./apps/frappe/requirements.txt
INFO:bench.utils:./env/bin/pip install -q -r ./apps/erpnext/requirements.txt
Updating node libraries...
INFO:bench.utils:npm install
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN frappe@ No description
Backing up sites...
Patching sites... 


…(b41fb7345e21ea1c)
Success
Updating DocTypes for frappe : [========================================]
Updating DocTypes for erpnext : [========================================]
Syncing help database…
Wrote css/frappe-web.css - 68.04 KB
Wrote js/frappe-web.min.js - 219.63 KB
Wrote js/control.min.js - 78.35 KB
Wrote js/dialog.min.js - 119.06 KB
Wrote css/desk.min.css - 312.86 KB
Wrote css/frappe-rtl.css - 32.5 KB
Wrote js/libs.min.js - 1.12 MB
Wrote js/desk.min.js - 538.81 KB
Wrote css/module.min.css - 2.08 KB
Wrote css/form.min.css - 4.47 KB
Wrote js/form.min.js - 195.33 KB
Wrote css/list.min.css - 13.23 KB
Wrote js/list.min.js - 185.2 KB
Wrote css/report.min.css - 9.03 KB
Wrote js/report.min.js - 326.24 KB
Wrote js/web_form.min.js - 247.55 KB
Wrote css/web_form.css - 24.42 KB
Wrote js/print_format_v3.min.js - 23.39 KB
Wrote css/erpnext.css - 8 KB
Wrote js/erpnext-web.min.js - 3.79 KB
Wrote js/erpnext.min.js - 163.62 KB
Wrote js/item-dashboard.min.js - 7.86 KB
sudo: unable to resolve host scm-u-sky
INFO:bench.utils:sudo supervisorctl restart frappe-bench-workers: frappe-bench-web:
sudo: unable to resolve host scm-u-sky
frappe-bench-workers:frappe-bench-frappe-schedule: stopped
frappe-bench-workers:frappe-bench-frappe-long-worker-0: stopped
frappe-bench-workers:frappe-bench-frappe-short-worker-0: stopped
frappe-bench-workers:frappe-bench-frappe-default-worker-0: stopped
frappe-bench-web:frappe-bench-node-socketio: stopped
frappe-bench-web:frappe-bench-frappe-web: stopped
frappe-bench-workers:frappe-bench-frappe-schedule: started
frappe-bench-workers:frappe-bench-frappe-default-worker-0: started
frappe-bench-workers:frappe-bench-frappe-long-worker-0: started
frappe-bench-workers:frappe-bench-frappe-short-worker-0: started
frappe-bench-web:frappe-bench-frappe-web: started
frappe-bench-web:frappe-bench-node-socketio: started
________________________________________________________________________________
Bench: Deployment tool for Frappe and ERPNext (https://erpnext.org).
Open source depends on your contributions, so please contribute bug reports, patches, fixes or cash and be a part of the community
()
You have new mail in /var/mail/frappe