﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Manifold Community Site: Calling Python modules from Manifold IronPython</title><link>http://95.79.92.2:8080/forum/t165617</link><description>Manifold Community Site thread</description><image><url>http://95.79.92.2:8080/forum/images/img-logo.png</url><title>Manifold Community Site: Calling Python modules from Manifold IronPython</title><link>http://95.79.92.2:8080/forum/t165617</link></image><item><title>RE: Calling Python modules from Manifold IronPython</title><link>http://95.79.92.2:8080/forum/t165617#165618</link><description>&lt;P&gt;I’ve been making really good use of geopy (thing like censusgeocoder) in both a standard IDLE interface, and also integrating these modules with Arcpy. &lt;/P&gt;&lt;P&gt;Does anyone have the steps necessary to use ironpython inside of manifold to import modules like censusgeocode? &lt;/P&gt;&lt;P&gt;For ArcGIS, I do a &lt;B&gt;pip install censusgeocoder&lt;/B&gt; into the site-packages folder in my ArcGIS Pro path. &lt;/P&gt;&lt;P&gt;So what I’m trying to figure out is how to install the package with IronPython, and where the package should be installed. Do we need a site–packages folder inside Manifold’s &lt;B&gt;extra&lt;/B&gt; folder?  I’ve go IronPython 3.7 and copied the .dlls into the &lt;B&gt;extras&lt;/B&gt; folder. &lt;/P&gt;</description><dc:creator>artlembo</dc:creator><comments>http://95.79.92.2:8080/forum/t165617#165618</comments><guid>http://95.79.92.2:8080/forum/t165617#165618</guid><pubDate>Fri, 31 Jul 2026 17:26:23 GMT</pubDate></item><item><title>RE: Calling Python modules from Manifold IronPython</title><link>http://95.79.92.2:8080/forum/t165617#165619</link><description>&lt;P&gt;Yes. I got &lt;B&gt;censusgeocode&lt;/B&gt; running with IronPython.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I built the &lt;/SPAN&gt;&lt;SPAN&gt;current &lt;/SPAN&gt;&lt;B&gt;main&lt;/B&gt;&lt;SPAN&gt;branch &lt;/SPAN&gt;&lt;SPAN&gt;of &lt;/SPAN&gt;&lt;SPAN&gt;https://github.com/IronLanguages/ironpython3&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(it says v3.4.2 but that&amp;#39;s old release number)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I installed it to C:\Apps\ipy342net4\&lt;/P&gt;&lt;P&gt;just this fails:&lt;/P&gt;&lt;P&gt;&lt;P class='code'&gt;&lt;SPAN&gt;ipy&amp;#160;-m&amp;#160;pip&amp;#160;install&amp;#160;censusgeocode&lt;/SPAN&gt;&lt;/P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;but apparently some deps are optional.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;P class='code'&gt;C:\Apps\ipy342net4\Enter-IronPythonEnvironment.ps1&lt;/P&gt;&lt;P class='code'&gt;ipy&amp;#160;-m&amp;#160;ensurepip&lt;/P&gt;&lt;P class='code'&gt;ipy&amp;#160;-m&amp;#160;pip&amp;#160;install&amp;#160;--no-deps&amp;#160;censusgeocode&amp;#160;requests_toolbelt&amp;#160;six&lt;/P&gt;&lt;P class='code'&gt;ipy.exe&lt;/P&gt;&lt;P class='code'&gt;&amp;gt;&amp;gt;&amp;gt;&amp;#160;#&amp;#160;IronPython&amp;#160;REPL&lt;/P&gt;&lt;P class='code'&gt;import&amp;#160;censusgeocode&amp;#160;as&amp;#160;cg&lt;/P&gt;&lt;P class='code'&gt;cg.coordinates(x=-76,&amp;#160;y=41)&lt;/P&gt;&lt;P class='code'&gt;#&amp;#160;good&amp;#160;response&amp;#160;here!&lt;/P&gt;&lt;/P&gt;&lt;P&gt;There are often errors if we try to run some python package with IronPython, because if some of its  dependencies are CPython C extensions then IronPython won&amp;#39;t be able to run them.&lt;/P&gt;&lt;P&gt;&lt;P&gt;I also built current &lt;B&gt;3.6&lt;/B&gt; branch of &lt;SPAN&gt;https://github.com/IronLanguages/ironpython3&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;With 3.6 &lt;SPAN&gt;&lt;B&gt;ipy -m pip install censusgeocode&lt;/B&gt;&lt;/SPAN&gt;&lt;SPAN&gt;(without r) succeeds. But on usage errors appear. &lt;/SPAN&gt;&lt;/P&gt;&lt;/P&gt;&lt;P&gt;Also worth considering:&lt;/P&gt;&lt;P&gt;Claude Opus 5 proposed&lt;/P&gt;&lt;P&gt;The practical path is to skip the requests-based stack entirely and call the Census Geocoder API directly — it&amp;#39;s just plain HTTP GET with query-string params returning JSON, so .NET&amp;#39;s own HttpClient handles it fine without touching any of the Python HTTP layers:&lt;/P&gt;&lt;P&gt;&lt;P class='code'&gt;&lt;span class=c&gt;#python&lt;/span&gt;&lt;/P&gt;&lt;P class='code'&gt;&lt;span class=k&gt;import&lt;/span&gt;&amp;#160;clr&lt;/P&gt;&lt;P class='code'&gt;clr.AddReference(&lt;span class=s&gt;&amp;quot;System.Net.Http&amp;quot;&lt;/span&gt;)&lt;/P&gt;&lt;P class='code'&gt;&lt;span class=k&gt;from&lt;/span&gt;&amp;#160;System.Net.Http&amp;#160;&lt;span class=k&gt;import&lt;/span&gt;&amp;#160;HttpClient&lt;/P&gt;&lt;P class='code'&gt;&lt;span class=k&gt;from&lt;/span&gt;&amp;#160;System&amp;#160;&lt;span class=k&gt;import&lt;/span&gt;&amp;#160;Uri&lt;/P&gt;&lt;P class='code'&gt;&lt;span class=k&gt;import&lt;/span&gt;&amp;#160;json&lt;/P&gt;&lt;P class='code'&gt;BASE_URL&amp;#160;=&amp;#160;&lt;span class=s&gt;&amp;quot;https://geocoding.geo.census.gov/geocoder/&amp;quot;&lt;/span&gt;&lt;/P&gt;&lt;P class='code'&gt;_client&amp;#160;=&amp;#160;HttpClient()&lt;/P&gt;&lt;P class='code'&gt;&lt;span class=k&gt;def&lt;/span&gt;&amp;#160;geocode_oneline(address,&amp;#160;returntype=&lt;span class=s&gt;&amp;quot;locations&amp;quot;&lt;/span&gt;,&amp;#160;benchmark=&lt;span class=s&gt;&amp;quot;Public_AR_Current&amp;quot;&lt;/span&gt;):&lt;/P&gt;&lt;P class='code'&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;url&amp;#160;=&amp;#160;&lt;span class=s&gt;&amp;quot;{0}{1}/onelineaddress?address={2}&amp;amp;benchmark={3}&amp;amp;format=json&amp;quot;&lt;/span&gt;.format(&lt;/P&gt;&lt;P class='code'&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;BASE_URL,&amp;#160;returntype,&amp;#160;Uri.EscapeDataString(address),&amp;#160;benchmark)&lt;/P&gt;&lt;P class='code'&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;response&amp;#160;=&amp;#160;_client.GetAsync(url).Result&lt;/P&gt;&lt;P class='code'&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;response.EnsureSuccessStatusCode()&lt;/P&gt;&lt;P class='code'&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;text&amp;#160;=&amp;#160;response.Content.ReadAsStringAsync().Result&lt;/P&gt;&lt;P class='code'&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;span class=k&gt;return&lt;/span&gt;&amp;#160;json.loads(text)&lt;/P&gt;&lt;P class='code'&gt;result&amp;#160;=&amp;#160;geocode_oneline(&lt;span class=s&gt;&amp;quot;1600&amp;#160;Pennsylvania&amp;#160;Avenue,&amp;#160;Washington,&amp;#160;DC&amp;quot;&lt;/span&gt;)&lt;/P&gt;&lt;P class='code'&gt;match&amp;#160;=&amp;#160;result[&lt;span class=s&gt;&amp;quot;result&amp;quot;&lt;/span&gt;][&lt;span class=s&gt;&amp;quot;addressMatches&amp;quot;&lt;/span&gt;][0]&lt;/P&gt;&lt;P class='code'&gt;lon&amp;#160;=&amp;#160;match[&lt;span class=s&gt;&amp;quot;coordinates&amp;quot;&lt;/span&gt;][&lt;span class=s&gt;&amp;quot;x&amp;quot;&lt;/span&gt;]&lt;/P&gt;&lt;P class='code'&gt;lat&amp;#160;=&amp;#160;match[&lt;span class=s&gt;&amp;quot;coordinates&amp;quot;&lt;/span&gt;][&lt;span class=s&gt;&amp;quot;y&amp;quot;&lt;/span&gt;]&lt;/P&gt;&lt;P class='code'&gt;&lt;span class=k&gt;print&lt;/span&gt;(lat,&amp;#160;lon)&lt;/P&gt;&lt;/P&gt;</description><dc:creator>rk</dc:creator><comments>http://95.79.92.2:8080/forum/t165617#165619</comments><guid>http://95.79.92.2:8080/forum/t165617#165619</guid><pubDate>Sat, 01 Aug 2026 07:26:12 GMT</pubDate></item><item><title>RE: Calling Python modules from Manifold IronPython</title><link>http://95.79.92.2:8080/forum/t165617#165620</link><description>&lt;P&gt;I share the self-built IronPython and instructions in this OneDrive folder. (You must trust that not me nor my machine are corrupt)&lt;/P&gt;&lt;P&gt;&lt;A HREF='https://1drv.ms/f/c/bc53d61b0ca53f95/IgAPOnh5OnphTbCsuFPig2QTASC5lBzsQ46PnNNR-ifzueM?e=griZeP'&gt;https://1drv.ms/f/c/bc53d61b0ca53f95/IgAPOnh5OnphTbCsuFPig2QTASC5lBzsQ46PnNNR-ifzueM?e=griZeP&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Actually, you can use the official 3.4.2 release from &lt;/P&gt;&lt;P&gt;&lt;A HREF='https://github.com/IronLanguages/ironpython3/releases/download/v3.4.2/IronPython.3.4.2.zip'&gt;https://github.com/IronLanguages/ironpython3/releases/download/v3.4.2/IronPython.3.4.2.zip&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Works also!&lt;/P&gt;&lt;P&gt;&lt;IMG class='cons' id='i165620x0_elt' onclick="showhideImageElt('i165620x0_elt')" SRC='bRjQvMTY1NjIwL2NlbnN1c2dlb2dvZGUtcHJvb2YucG5n'&gt;&lt;/P&gt;&lt;p class='file'&gt;&lt;b&gt;Attachments:&lt;/b&gt;&lt;br&gt;&lt;a href='bRjQvMTY1NjIwL2NlbnN1c2dlb2dvZGUtcHJvb2YucG5n'&gt;&lt;img src='images/dwn-ftp.gif' align='absmiddle'&gt;&lt;/a&gt; &lt;a href='bRjQvMTY1NjIwL2NlbnN1c2dlb2dvZGUtcHJvb2YucG5n'&gt;censusgeogode-proof.png&lt;/a&gt;&lt;br&gt;&lt;/p&gt;</description><dc:creator>rk</dc:creator><comments>http://95.79.92.2:8080/forum/t165617#165620</comments><guid>http://95.79.92.2:8080/forum/t165617#165620</guid><pubDate>Sat, 01 Aug 2026 08:37:28 GMT</pubDate></item><item><title>RE: Calling Python modules from Manifold IronPython</title><link>http://95.79.92.2:8080/forum/t165617#165621</link><description>&lt;P&gt;Thanks, Rivo. I figured you would be the person to respond with a good answer, &lt;/P&gt;</description><dc:creator>artlembo</dc:creator><comments>http://95.79.92.2:8080/forum/t165617#165621</comments><guid>http://95.79.92.2:8080/forum/t165617#165621</guid><pubDate>Sat, 01 Aug 2026 14:39:23 GMT</pubDate></item><item><title>RE: Calling Python modules from Manifold IronPython</title><link>http://95.79.92.2:8080/forum/t165617#165622</link><description>&lt;P&gt;Rivo,&lt;/P&gt;&lt;P&gt;you description worked like a charm!  Thanks.  For those lurking, and for myself in the future, it really only requires the following steps (after having installed IronPython on your computer):&lt;/P&gt;&lt;P&gt;&lt;U&gt;Install Census Geocode&lt;/U&gt;:&lt;/P&gt;&lt;P&gt;from inside Command Prompt in the IronPython install directory:&lt;/P&gt;&lt;P&gt;ipy -m pip install requests&lt;/P&gt;&lt;P&gt;ipy -m pip install --no-deps censusgeocode requests_toolbelt six&lt;/P&gt;&lt;P&gt;&lt;U&gt;Script&lt;/U&gt;:&lt;/P&gt;&lt;P&gt;inside a Manifold IronPython script:&lt;/P&gt;&lt;P&gt;&lt;P class='code'&gt;&lt;SPAN&gt;def&lt;/SPAN&gt;&lt;SPAN&gt;&amp;#160;Main():&lt;/SPAN&gt;&lt;/P&gt;&lt;P class='code'&gt;&lt;SPAN&gt;&amp;#160;&lt;/SPAN&gt;&lt;SPAN&gt;import&amp;#160;sys&lt;/SPAN&gt;&lt;/P&gt;&lt;P class='code'&gt;&lt;SPAN&gt;&amp;#160;&lt;/SPAN&gt;&lt;SPAN&gt;sys.path.extend([&lt;span class=c&gt;&amp;#39;C:\\Program&amp;#160;Files\\IronPython&amp;#160;3.4\\Lib&amp;#39;,&amp;#39;C:\\Program&amp;#160;Files\\IronPython&amp;#160;3.4\\Lib\\site-packages&amp;#39;])&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class='code'&gt;&lt;SPAN&gt;&amp;#160;&lt;/SPAN&gt;&lt;SPAN&gt;import&amp;#160;censusgeocode&amp;#160;as&amp;#160;cg&lt;/SPAN&gt;&lt;/P&gt;&lt;P class='code'&gt;&lt;SPAN&gt;&amp;#160;&lt;/SPAN&gt;&lt;SPAN&gt;result&amp;#160;=&amp;#160;cg.onelineaddress(&lt;span class=s&gt;&amp;quot;1600&amp;#160;Pennsylvania&amp;#160;Ave&amp;#160;NW,&amp;#160;Washington,&amp;#160;DC&amp;quot;&lt;/span&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class='code'&gt;&lt;SPAN&gt;&amp;#160;&lt;/SPAN&gt;&lt;SPAN&gt;coordinates&amp;#160;=&amp;#160;result[0][&lt;span class=c&gt;&amp;#39;coordinates&amp;#39;]&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class='code'&gt;&lt;SPAN&gt;&amp;#160;&lt;/SPAN&gt;&lt;SPAN&gt;Manifold.Application.Log(str(coordinates))&lt;/SPAN&gt;&lt;/P&gt;&lt;/P&gt;</description><dc:creator>artlembo</dc:creator><comments>http://95.79.92.2:8080/forum/t165617#165622</comments><guid>http://95.79.92.2:8080/forum/t165617#165622</guid><pubDate>Sat, 01 Aug 2026 16:45:46 GMT</pubDate></item></channel></rss>