<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Python block in 2.50.10 with RPi and external library]]></title><description><![CDATA[<p dir="auto">Hi, I tested the block PYTHON with 2.50.10 (testing version) and RPi 3b+. Generally it works fine, however I got into troubles when using some externally installed library, particularly pysolnp (<a href="https://pypi.org/project/pysolnp/">https://pypi.org/project/pysolnp/</a>).<br />
Here is the use case and description of what I did:<br />
As the Buster brings both Python 2.7.16 and 3.7.3, I set the default Python3 like this:<br />
Edit  nano ~/.bashrc  , add  alias python='/usr/bin/python3'   and  alias pip=pip3, then run source ~/.bashrc.<br />
After that, typing python --version, it shows python 3.7.3 as required by PYTHON block in Rexygen.<br />
Then I was able to install pysolnp according official guide: pip install pysolnp.<br />
If I run any script manually (for example the initial basic example on the web <a href="https://pypi.org/project/pysolnp/">https://pypi.org/project/pysolnp/</a>), it works fine. It uses imported pysolnp library and gives the results as expected.<br />
However, if I run it within REXYGEN project, I got error in Rexygen diagnostics saying that 'no module named pysolnp was found'. When I run help('modules') from Python command line, I see pysolnp in the list of modules.<br />
Is it possible that for some reason older Python 2.7.16 is called from Rexygen environment? This would maybe explain the situtation as I didn't import pysolnp here but into 3.7.3. If this is the case, how to fix this to tell Rexygen to call python3 instead of python2? On the other hand, Rexygen would probably show different error regarding version of Python itself, because it needs Python 3.7.x according documentation.<br />
P.S. The same use case under Windows+Rexygen+pysolnp works fine.<br />
Best regards, Stepan</p>
]]></description><link>https://forum.rexygen.com/topic/132/python-block-in-2-50-10-with-rpi-and-external-library</link><generator>RSS for Node</generator><lastBuildDate>Sat, 14 Nov 2026 09:19:28 GMT</lastBuildDate><atom:link href="https://forum.rexygen.com/topic/132.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 19 Aug 2020 10:16:27 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Python block in 2.50.10 with RPi and external library on Wed, 19 Aug 2020 18:13:47 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.rexygen.com/uid/26">@stepan-ozana</a> said in <a href="/post/487">Python block in 2.50.10 with RPi and external library</a>:</p>
<blockquote>
<p dir="auto">Hi, I tested the block PYTHON with 2.50.10 (testing version) and RPi 3b+. Generally it works fine, however I got into troubles when using some externally installed library, particularly pysolnp (<a href="https://pypi.org/project/pysolnp/">https://pypi.org/project/pysolnp/</a>).<br />
Here is the use case and description of what I did:<br />
As the Buster brings both Python 2.7.16 and 3.7.3, I set the default Python3 like this:<br />
Edit  nano ~/.bashrc  , add  alias python='/usr/bin/python3'   and  alias pip=pip3, then run source ~/.bashrc.<br />
After that, typing python --version, it shows python 3.7.3 as required by PYTHON block in Rexygen.<br />
Then I was able to install pysolnp according official guide: pip install pysolnp.<br />
If I run any script manually (for example the initial basic example on the web <a href="https://pypi.org/project/pysolnp/">https://pypi.org/project/pysolnp/</a>), it works fine. It uses imported pysolnp library and gives the results as expected.<br />
However, if I run it within REXYGEN project, I got error in Rexygen diagnostics saying that 'no module named pysolnp was found'. When I run help('modules') from Python command line, I see pysolnp in the list of modules.<br />
Is it possible that for some reason older Python 2.7.16 is called from Rexygen environment? This would maybe explain the situtation as I didn't import pysolnp here but into 3.7.3. If this is the case, how to fix this to tell Rexygen to call python3 instead of python2? On the other hand, Rexygen would probably show different error regarding version of Python itself, because it needs Python 3.7.x according documentation.<br />
P.S. The same use case under Windows+Rexygen+pysolnp works fine.<br />
Best regards, Stepan</p>
</blockquote>
<p dir="auto">I made it work. It was an issue with different user accounts. I had the package installed under pi user but it has to be installed under root user. Then it works perfectly.</p>
]]></description><link>https://forum.rexygen.com/post/488</link><guid isPermaLink="true">https://forum.rexygen.com/post/488</guid><dc:creator><![CDATA[stepan.ozana]]></dc:creator><pubDate>Wed, 19 Aug 2020 18:13:47 GMT</pubDate></item></channel></rss>