[Cmb-users] python UCS2 or UCS4

David Thompson david.thompson at kitware.com
Sat Feb 11 17:13:06 EST 2017


Hi Elijah,

> ....
> I use IPython and Jupyter notebooks and would like to be able to import the smtk module so I can explore and test out more of its functionality.
> 
> Unfortunately the python 2.7 packaged with CMB appears to have been installed with 2-byte unicode characters: ...

If you need CMB compiled with different options, you will probably need to build it yourself. There is a "superbuild" project we use to build the dependencies of CMB plus CMB itself, located on gitlab at http://gitlab.kitware.com/cmb/cmb-superbuild/ . That page has build instructions. After building, you can go into its python build dir (build/superbuild/python/build), reconfigure, and then reinstall.

You may also be able to configure the superbuild to use your system's python -- I just don't remember whether that's an option or not.

Note that we don't support Python3 yet.

    David

> 
> $ /path/to/CMBpython
> 
> >>> import sysconfig
> >>> sysconfig.get_config_var('Py_UNICODE_SIZE')
> 2
> 
> This is not compatible with my system Ipython kernel...I believe Ubuntu 14.04 and later have moved to 4-byte unicode characters.
> 
> Is there a way I can build CMB where python is compiled to use 4-byte Unicode characters? I'm not sure how to set this option when building CMB with CMake.
> 
> If I was building it from source myself I could install it like so:
> 
> ./configure --enable-unicode=ucs4
> make 
> make install./configure --enable-unicode=ucs4
> 
> My thought is that if it is installed with UCS4, then it will build/install all the modules correctly and then I can access them with my system ipython by appropriately using sys.path.append("path/to/smtk").
> 
> Thanks for your time,
> Elijah
> _______________________________________________
> Cmb-users mailing list
> Cmb-users at computationalmodelbuilder.org
> http://public.kitware.com/mailman/listinfo/cmb-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmb-users/attachments/20170211/7f1e9b66/attachment.html>


More information about the Cmb-users mailing list