User avatar
olivir
Posts: 99
Joined: Sun Dec 25, 2016 6:47 pm
Location: France
Contact: Twitter

How to use Python in Gnumeric ?

Tue Jan 16, 2018 1:03 pm

Hi folks,

I tried to use Python Console in Gnumeric but :

Code: Select all

E Unable to open module file "/usr/lib64/gnumeric/1.12.38/plugins/python-loader/python_loader".
  E /usr/lib64/gnumeric/1.12.38/plugins/python-loader/python_loader.so: undefined symbol: forkpty
Idem if I try to use a python function in a cell. What's that ? :?

User avatar
gimcrack
Posts: 85
Joined: Mon Jan 01, 2018 9:39 pm
Contact: Website

Re: How to use Python in Gnumeric ?

Tue Jan 16, 2018 3:38 pm

olivir wrote:
Tue Jan 16, 2018 1:03 pm
Hi folks,

I tried to use Python Console in Gnumeric but :

Code: Select all

E Unable to open module file "/usr/lib64/gnumeric/1.12.38/plugins/python-loader/python_loader".
  E /usr/lib64/gnumeric/1.12.38/plugins/python-loader/python_loader.so: undefined symbol: forkpty
Idem if I try to use a python function in a cell. What's that ? :?
https://help.gnome.org/users/gnumeric/s ... e-enabling

User avatar
olivir
Posts: 99
Joined: Sun Dec 25, 2016 6:47 pm
Location: France
Contact: Twitter

Re: How to use Python in Gnumeric ?

Thu Jan 18, 2018 9:36 am

18.3.2.1. Enabling the Python Console
You can run a Python interpreter from inside Gnumeric, but you have to turn it on. To do this you simply uncomment a line in python-loader/plugins.xml. Normally, that file lives in /usr/lib/gnumeric/$version/plugins/python-loader/, or perhaps /usr/local/lib... on Red Hat. I used to suggest making a local but you should probably make a local copy, but that was pain for little gain. So:
gnumeric --version to make sure you get the right version name for the following. (You'll have to do this for every new version of Gnumeric!)
cd ~/.gnumeric/ $version /plugins/
Edit python-loader/plugin.xml.
Uncomment the five lines starting with ui-console-menu service near the bottom (remove the "<!--" and "-->" tags around the <service...> and </service> tags.
Save the file.
Start gnumeric (same version).
Select from the Tools the Python console.
Enjoy!

I did read that before. I've checked : ui-console-menu service is uncommented in /usr/lib64/gnumeric/1.12.38/plugins/python-loader/plugin.xml.

Code: Select all

	<services>
		<service type="plugin_loader" id="python"/>
		<service type="ui" id="console" file="ui-console-menu.xml">
			<actions>
				<action name="ShowConsole">
					<label>Python console</label>
					<label xml:lang="bs">Konzola Pitona</label>
					<label xml:lang="cs">Konzola jazyka Python</label>
					<label xml:lang="de">Python-Eingabefenster</label>
					<label xml:lang="el">Κονσόλα Python</label>
					<label xml:lang="en_GB">Python console</label>
					<label xml:lang="es">Consola Python</label>
					<label xml:lang="fi">Python-pääte</label>
					<label xml:lang="fr">Console Python</label>
					<label xml:lang="gl">Consola de Python</label>
					<label xml:lang="hr">Konzola za Python</label>
					<label xml:lang="hu">Python konzol</label>
					<label xml:lang="id">Konsol Python</label>
					<label xml:lang="ja">Pythonコンソール</label>
					<label xml:lang="ko">파이썬 콘솔</label>
					<label xml:lang="lt">Python terminalas</label>
					<label xml:lang="lv">Python konsole</label>
					<label xml:lang="ml">പൈതണ് കണ്സോള്</label>
					<label xml:lang="ms">Konsol Python</label>
					<label xml:lang="nb">Python-konsoll</label>
					<label xml:lang="pl">Konsola języka Python</label>
					<label xml:lang="pt">Consola Python</label>
					<label xml:lang="pt_BR">Console Python</label>
					<label xml:lang="ru">Консоль Python</label>
					<label xml:lang="sk">Konzola Python</label>
					<label xml:lang="sl">Konzola Python</label>
					<label xml:lang="sr">Конзола Питона</label>
					<label xml:lang="sr@latin">Konzola Pitona</label>
					<label xml:lang="sv">Pythonkonsol</label>
					<label xml:lang="tr">Python konsolu</label>
					<label xml:lang="zh_CN">Python 控制台</label>
					<label xml:lang="zh_HK">Python 主控台</label>
					<label xml:lang="zh_TW">Python 主控台</label>
				</action>
			</actions>
		</service>
	</services>

Same issue if I copy plugins folder in ~/.gnumeric/ $version /plugins/ :

Code: Select all

$ gnumeric
E Unable to open module file "/home/olivier/.gnumeric/1.12.38/plugins/python-loader/python_loader".
  E /home/olivier/.gnumeric/1.12.38/plugins/python-loader/python_loader.so: undefined symbol: forkpty

Return to “Tutorials”