# ParaView Python on Linux needs 4 Unicode width

**URL:** https://discourse.paraview.org/t/paraview-python-on-linux-needs-4-unicode-width/772
**Category:** Development
**Created:** [October 21, 2018, 7:31pm UTC](https://discourse.paraview.org/t/paraview-python-on-linux-needs-4-unicode-width/772 "2018-10-21T19:31:29Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![banesullivan](https://discourse.paraview.org/user_avatar/discourse.paraview.org/banesullivan/32/11714_2.png) [@banesullivan](https://discourse.paraview.org/u/banesullivan)
#### Post date: [October 21, 2018, 7:31pm UTC](https://discourse.paraview.org/t/paraview-python-on-linux-needs-4-unicode-width/772/1 "2018-10-21T19:31:30Z")

</div>

Reposting an [issue from the superbuild](https://gitlab.kitware.com/paraview/paraview-superbuild/issues/88) to see if anyone has some advice:

### The issue

Currently, it appears the ParaView’s Python (Linux only) is built with 2 Unicode width which is incompatible with just about every Linux python distribution I have encountered. I noticed this when trying to import `pandas` installed via `pip` under the `PYTHONPATH` and received an error:

```auto
>>> import pandas
...
ImportError: C extension ..../pandas/_libs/tslib.so: undefined symbol: PyUnicodeUCS4_DecodeUTF8 not built. ...

```

It appears to me that this could be fixed by building `pvpython` with 4 Unicode widths, so I am curious if there is any reason why ParaView is width 2 on Linux (Windows and Mac are width 4)?

### What do I do?

I’m curious if anyone is aware of any way to address this issue. Any help would be much appreciated!

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.paraview.org/u/ben.boeckel)
#### Post date: [October 22, 2018, 12:37pm UTC](https://discourse.paraview.org/t/paraview-python-on-linux-needs-4-unicode-width/772/2 "2018-10-22T12:37:04Z")

</div>

Trying out a fix [in this MR](https://gitlab.kitware.com/paraview/paraview-superbuild/merge_requests/519).

---

<div class="post-metadata">

### Author: ![Daan\_van\_Vugt](https://discourse.paraview.org/user_avatar/discourse.paraview.org/daan_van_vugt/32/51_2.png) [@Daan\_van\_Vugt](https://discourse.paraview.org/u/Daan_van_Vugt)
#### Post date: [October 22, 2018, 2:12pm UTC](https://discourse.paraview.org/t/paraview-python-on-linux-needs-4-unicode-width/772/3 "2018-10-22T14:12:37Z")

</div>

I typically build a different python with ucs2 support (though I agree UCS4 would be nicer)

```
# Install python2 with ucs2 https://stackoverflow.com/questions/38928942/build-python-as-ucs-4-via-pyenv
export PYTHON_CONFIGURE_OPTS=--enable-unicode=ucs2
pyenv install -v 2.7.11
pyenv local 2.7.11

# Install pip
wget https://bootstrap.pypa.io/get-pip.py && ~/.pyenv/shims/python get-pip.py

# Install the same numpy paraview uses (as of writing)
~/.pyenv/versions/2.7.11/bin/pip install --user numpy==1.8.1
```

---

<div class="post-metadata">

### Author: ![banesullivan](https://discourse.paraview.org/user_avatar/discourse.paraview.org/banesullivan/32/11714_2.png) [@banesullivan](https://discourse.paraview.org/u/banesullivan)
#### Post date: [October 22, 2018, 2:23pm UTC](https://discourse.paraview.org/t/paraview-python-on-linux-needs-4-unicode-width/772/4 "2018-10-22T14:23:18Z")

</div>

Thanks, @Daan_van_Vugt, that’s a neat fix! I haven’t had any luck building PV from source against a Python env, but I think this would work if I set up the PYTHONPATH that PV sees to this environment! I’ll have to give this a try and also see if I can find a way for anaconda to do this in a similar manner.

---

<div class="post-metadata">

### Author: ![banesullivan](https://discourse.paraview.org/user_avatar/discourse.paraview.org/banesullivan/32/11714_2.png) [@banesullivan](https://discourse.paraview.org/u/banesullivan)
#### Post date: [October 24, 2018, 1:20am UTC](https://discourse.paraview.org/t/paraview-python-on-linux-needs-4-unicode-width/772/5 "2018-10-24T01:20:45Z")

</div>

@ben.boeckel, any further progress on the PV-superbuild and common-superbuild merge requests? Thanks for getting those up!

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.paraview.org/u/ben.boeckel)
#### Post date: [October 25, 2018, 3:41pm UTC](https://discourse.paraview.org/t/paraview-python-on-linux-needs-4-unicode-width/772/6 "2018-10-25T15:41:13Z")

</div>

Tests came back successfully. Waiting for a +1 (though I’ll probably just merge it if I don’t hear back by the end of the day).
