<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Morpheus &amp; python3.10 in HPE Morpheus Enterprise Software</title>
    <link>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/morpheus-python3-10/m-p/7249348#M2522</link>
    <description>&lt;P&gt;Nick,&lt;/P&gt;
&lt;P&gt;I got this to work.  Thanks for the help.&lt;/P&gt;
&lt;P&gt;I will add that there was one additional thing.  I had to add a symlink from the new virtualenv 20.14.1 back to /usr/local/bin for morpheus because the morpheus-local user in its PATH is looking for it in this PATH  echo $PATH&lt;BR /&gt;
/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin&lt;/P&gt;
&lt;P&gt;and could not find it.&lt;/P&gt;
&lt;P&gt;Morpheus runs python tasks just fine now.  Now I will go thru an upgrade process and see what breaks.&lt;/P&gt;
&lt;P&gt;I would add it would be nice if, since there can be multiple python envs, it would be nice if Morpheus python task had the ability to source a different venv from the task,  We can specify the python binary already but the venv, it would be nice if that was seemless or we could specify from the  python task at least.  Enhancement request??&lt;/P&gt;
&lt;P&gt;Tks,&lt;/P&gt;
&lt;P&gt;Dave&lt;/P&gt;</description>
    <pubDate>Thu, 05 May 2022 13:47:15 GMT</pubDate>
    <dc:creator />
    <dc:date>2022-05-05T13:47:15Z</dc:date>
    <item>
      <title>Morpheus &amp; python3.10</title>
      <link>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/morpheus-python3-10/m-p/7249345#M2519</link>
      <description>&lt;P&gt;anyone know where in morpheus I reconfigure to have it use a different version of python than what is installed with the python3-virtualenv package, which is python3.6, I have the binary to python3.10 referenced in the python task but the log still complains about python3.6 site-packages libraries.&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2022 19:37:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/morpheus-python3-10/m-p/7249345#M2519</guid>
      <dc:creator />
      <dc:date>2022-05-03T19:37:43Z</dc:date>
    </item>
    <item>
      <title>Re: Morpheus &amp; python3.10</title>
      <link>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/morpheus-python3-10/m-p/7249346#M2520</link>
      <description>&lt;P&gt;RHEL 8 and derivatives ship with virtualenv 15.1.0 which isn’t compatible with Python 3.10.  I &lt;EM&gt;&lt;STRONG&gt;do not&lt;/STRONG&gt;&lt;/EM&gt; recommend the following workaround for a production system because of potential conflicts with future yum updates, but upgrading the system virtualenv seems to work:&lt;/P&gt;
&lt;PRE style="background : #f0f1f2;"&gt;&lt;CODE class="lang-auto"&gt;[ncelebic@nc-vmware-morphtdbuilds-3072 ~]$ cat /etc/os-release
NAME="CentOS Stream"
VERSION="8"
&amp;lt;snip&amp;gt;

[ncelebic@nc-vmware-morphtdbuilds-3072 ~]$ virtualenv -p /usr/local/bin/python3.10 venv
Running virtualenv with interpreter /usr/local/bin/python3.10
&amp;lt;snip&amp;gt;
Using base prefix '/usr/local'
New python executable in /home/ncelebic/venv/bin/python3.10
Not overwriting existing python script /home/ncelebic/venv/bin/python (you must use /home/ncelebic/venv/bin/python3.10)
Traceback (most recent call last):
&amp;lt;snip&amp;gt;
AttributeError: module 'sysconfig' has no attribute '_get_default_scheme'. Did you mean: 'get_default_scheme'?

[ncelebic@nc-vmware-morphtdbuilds-3072 ~]$ sudo pip3 install -U virtualenv
WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3 install --user` instead.
Collecting virtualenv
&amp;lt;snip&amp;gt;
Installing collected packages: typing-extensions, zipp, importlib-metadata, six, platformdirs, filelock, importlib-resources, distlib, virtualenv
Successfully installed distlib-0.3.4 filelock-3.4.1 importlib-metadata-4.8.3 importlib-resources-5.4.0 platformdirs-2.4.0 six-1.16.0 typing-extensions-4.1.1 virtualenv-20.14.1 zipp-3.6.0

[ncelebic@nc-vmware-morphtdbuilds-3072 ~]$ virtualenv -p /usr/local/bin/python3.10 venv
created virtual environment CPython3.10.4.final.0-64 in 922ms
  creator CPython3Posix(dest=/home/ncelebic/venv, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/ncelebic/.local/share/virtualenv)
    added seed packages: pip==22.0.4, setuptools==62.1.0, wheel==0.37.1
  activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator

[ncelebic@nc-vmware-morphtdbuilds-3072 ~]$ source venv/bin/activate
(venv) [ncelebic@nc-vmware-morphtdbuilds-3072 ~]$ which python
~/venv/bin/python
(venv) [ncelebic@nc-vmware-morphtdbuilds-3072 ~]$ python -V
Python 3.10.4
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 04 May 2022 13:50:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/morpheus-python3-10/m-p/7249346#M2520</guid>
      <dc:creator />
      <dc:date>2022-05-04T13:50:27Z</dc:date>
    </item>
    <item>
      <title>Re: Morpheus &amp; python3.10</title>
      <link>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/morpheus-python3-10/m-p/7249347#M2521</link>
      <description>&lt;P&gt;Can you post a snippet of Morpheus complaining about python3.6 site-packages?  It sounds odd.  We test with Python installed at the system level, so I’m curious as to how Python 3.10 was installed and what base OS it is.&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2022 20:15:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/morpheus-python3-10/m-p/7249347#M2521</guid>
      <dc:creator />
      <dc:date>2022-05-03T20:15:32Z</dc:date>
    </item>
    <item>
      <title>Re: Morpheus &amp; python3.10</title>
      <link>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/morpheus-python3-10/m-p/7249348#M2522</link>
      <description>&lt;P&gt;Nick,&lt;/P&gt;
&lt;P&gt;I got this to work.  Thanks for the help.&lt;/P&gt;
&lt;P&gt;I will add that there was one additional thing.  I had to add a symlink from the new virtualenv 20.14.1 back to /usr/local/bin for morpheus because the morpheus-local user in its PATH is looking for it in this PATH  echo $PATH&lt;BR /&gt;
/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin&lt;/P&gt;
&lt;P&gt;and could not find it.&lt;/P&gt;
&lt;P&gt;Morpheus runs python tasks just fine now.  Now I will go thru an upgrade process and see what breaks.&lt;/P&gt;
&lt;P&gt;I would add it would be nice if, since there can be multiple python envs, it would be nice if Morpheus python task had the ability to source a different venv from the task,  We can specify the python binary already but the venv, it would be nice if that was seemless or we could specify from the  python task at least.  Enhancement request??&lt;/P&gt;
&lt;P&gt;Tks,&lt;/P&gt;
&lt;P&gt;Dave&lt;/P&gt;</description>
      <pubDate>Thu, 05 May 2022 13:47:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/morpheus-python3-10/m-p/7249348#M2522</guid>
      <dc:creator />
      <dc:date>2022-05-05T13:47:15Z</dc:date>
    </item>
    <item>
      <title>Re: Morpheus &amp; python3.10</title>
      <link>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/morpheus-python3-10/m-p/7249349#M2523</link>
      <description>&lt;P&gt;Nick,&lt;/P&gt;
&lt;P&gt;This is exactly what I had done.&lt;/P&gt;
&lt;P&gt;which pip3&lt;BR /&gt;
/usr/bin/pip3&lt;BR /&gt;
[ec2-user@ip-172-31-4-28 ~]$ pip3 -V&lt;BR /&gt;
pip 22.0.4 from /usr/local/lib/python3.10/site-packages/pip (python 3.10)&lt;BR /&gt;
[ec2-user@ip-172-31-4-28 ~]$ pip3 list | grep virtualenv&lt;BR /&gt;
virtualenv         20.14.1&lt;BR /&gt;
[ec2-user@ip-172-31-4-28 ~]$ virtualenv -p /usr/local/bin/python3.10 venv&lt;BR /&gt;
created virtual environment CPython3.10.4.final.0-64 in 770ms&lt;BR /&gt;
creator CPython3Posix(dest=/home/ec2-user/venv, clear=False, no_vcs_ignore=False, global=False)&lt;BR /&gt;
seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/ec2-user/.local/share/virtualenv)&lt;BR /&gt;
added seed packages: pip==22.0.4, setuptools==62.1.0, wheel==0.37.1&lt;BR /&gt;
activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator&lt;BR /&gt;
[ec2-user@ip-172-31-4-28 ~]$ which python&lt;BR /&gt;
/usr/bin/which: no python in (/home/ec2-user/.rvm/gems/ruby-3.1.1/bin:/home/ec2-user/.rvm/gems/ruby-3.1.1@global/bin:/home/ec2-user/.rvm/rubies/ruby-3.1.1/bin:/home/ec2-user/.local/bin:/home/ec2-user/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/ec2-user/.rvm/bin)&lt;BR /&gt;
[ec2-user@ip-172-31-4-28 ~]$ source venv/bin/activate&lt;BR /&gt;
(venv) [ec2-user@ip-172-31-4-28 ~]$ which python&lt;BR /&gt;
~/venv/bin/python&lt;BR /&gt;
(venv) [ec2-user@ip-172-31-4-28 ~]$ python -V&lt;BR /&gt;
Python 3.10.4&lt;/P&gt;
&lt;P&gt;But executing a python script in the python task in Morpheus I get the following error:&lt;/P&gt;
&lt;P&gt;Task Execution Failed on Attempt 1&lt;BR /&gt;
Error Initializing virtualenv…Make sure it’s installed and configured properly on the appliance…&lt;BR /&gt;
/usr/lib/python3.6/site-packages/virtualenv.py:25: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives&lt;BR /&gt;
import distutils.sysconfig&lt;BR /&gt;
/usr/lib/python3.6/site-packages/virtualenv.py:25: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead&lt;BR /&gt;
import distutils.sysconfig&lt;BR /&gt;
Traceback (most recent call last):&lt;BR /&gt;
File “/usr/lib/python3.6/site-packages/virtualenv.py”, line 2376, in&lt;BR /&gt;
main()&lt;BR /&gt;
File “/usr/lib/python3.6/site-packages/virtualenv.py”, line 705, in main&lt;BR /&gt;
create_environment(home_dir,&lt;BR /&gt;
File “/usr/lib/python3.6/site-packages/virtualenv.py”, line 933, in create_environment&lt;BR /&gt;
py_executable = os.path.abspath(install_python(&lt;BR /&gt;
File “/usr/lib/python3.6/site-packages/virtualenv.py”, line 1467, in install_python&lt;BR /&gt;
fix_local_scheme(home_dir, symlink)&lt;BR /&gt;
File “/usr/lib/python3.6/site-packages/virtualenv.py”, line 1550, in fix_local_scheme&lt;BR /&gt;
if sysconfig._get_default_scheme() == ‘posix_local’:&lt;BR /&gt;
AttributeError: module ‘sysconfig’ has no attribute ‘_get_default_scheme’. Did you mean: ‘get_default_scheme’?&lt;BR /&gt;
Using base prefix ‘/usr/local’&lt;BR /&gt;
New python executable in /var/opt/morpheus/morpheus-ui/workspace/py-56894519-39e4-41e5-a3bc-587080258ba3/bin/python3.10&lt;BR /&gt;
Also creating executable in /var/opt/morpheus/morpheus-ui/workspace/py-56894519-39e4-41e5-a3bc-587080258ba3/bin/python&lt;BR /&gt;
Running virtualenv with interpreter /usr/local/bin/python3.10&lt;/P&gt;
&lt;P&gt;screenshot of the task in Python attached,  does it need additional command arguments??&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;&lt;DIV class="lightbox-wrapper"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://community.hpe.com/t5/image/serverpage/image-id/150245iD230159306CB6BB7/image-size/large?v=v2&amp;amp;px=2000" role="button" title="c905d516507cba50b656e7fbcfb6a759a521c570.png" alt="c905d516507cba50b656e7fbcfb6a759a521c570.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 May 2022 15:04:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/morpheus-python3-10/m-p/7249349#M2523</guid>
      <dc:creator />
      <dc:date>2022-05-04T15:04:37Z</dc:date>
    </item>
    <item>
      <title>Re: Morpheus &amp; python3.10</title>
      <link>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/morpheus-python3-10/m-p/7249350#M2524</link>
      <description>&lt;P&gt;I overlooked something.  Even running pip as root didn’t overwrite /bin/virtualenv, which is fine.  I followed the breadcrumbs to &lt;CODE style="background : #f0f1f2;"&gt;alternatives&lt;/CODE&gt; and this workaround seems to work: &lt;CODE style="background : #f0f1f2;"&gt;sudo alternatives --install /usr/bin/virtualenv python-virtualenv /usr/local/bin/virtualenv 10000&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;That won’t overwrite anything, but place a higher priority alternative over the system virtualenv.&lt;/P&gt;</description>
      <pubDate>Wed, 04 May 2022 16:56:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/morpheus-python3-10/m-p/7249350#M2524</guid>
      <dc:creator />
      <dc:date>2022-05-04T16:56:57Z</dc:date>
    </item>
    <item>
      <title>Re: Morpheus &amp; python3.10</title>
      <link>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/morpheus-python3-10/m-p/7249351#M2525</link>
      <description>&lt;P&gt;The error output:&lt;/P&gt;
&lt;P&gt;Task Execution Failed on Attempt 1&lt;BR /&gt;
Error Initializing virtualenv…Make sure it’s installed and configured properly on the appliance…&lt;BR /&gt;
/usr/lib/python3.6/site-packages/virtualenv.py:25: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives&lt;BR /&gt;
import distutils.sysconfig&lt;BR /&gt;
/usr/lib/python3.6/site-packages/virtualenv.py:25: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead&lt;BR /&gt;
import distutils.sysconfig&lt;BR /&gt;
Traceback (most recent call last):&lt;BR /&gt;
File “/usr/lib/python3.6/site-packages/virtualenv.py”, line 2376, in&lt;BR /&gt;
main()&lt;BR /&gt;
File “/usr/lib/python3.6/site-packages/virtualenv.py”, line 705, in main&lt;BR /&gt;
create_environment(home_dir,&lt;BR /&gt;
File “/usr/lib/python3.6/site-packages/virtualenv.py”, line 933, in create_environment&lt;BR /&gt;
py_executable = os.path.abspath(install_python(&lt;BR /&gt;
File “/usr/lib/python3.6/site-packages/virtualenv.py”, line 1467, in install_python&lt;BR /&gt;
fix_local_scheme(home_dir, symlink)&lt;BR /&gt;
File “/usr/lib/python3.6/site-packages/virtualenv.py”, line 1550, in fix_local_scheme&lt;BR /&gt;
if sysconfig._get_default_scheme() == ‘posix_local’:&lt;BR /&gt;
AttributeError: module ‘sysconfig’ has no attribute ‘_get_default_scheme’. Did you mean: ‘get_default_scheme’?&lt;BR /&gt;
Using base prefix ‘/usr/local’&lt;BR /&gt;
New python executable in /var/opt/morpheus/morpheus-ui/workspace/py-03802947-a21b-4eef-a598-3f7b8a1f0034/bin/python3.10&lt;BR /&gt;
Also creating executable in /var/opt/morpheus/morpheus-ui/workspace/py-03802947-a21b-4eef-a598-3f7b8a1f0034/bin/python&lt;BR /&gt;
Running virtualenv with interpreter /usr/local/bin/python3.10&lt;/P&gt;
&lt;P&gt;How was python 3.10 installed?&lt;/P&gt;
&lt;P&gt;downloaded the source code and compiled it.  OS is RHEL 8.&lt;BR /&gt;
Installed the package python3-virtualenv prior to the python3.10 install.  Everything worked fine with python3.6.8, is there something specific besides referencing the python3.10 binary in the python task that is needed to satisfy the virtualenv for the diff version of python?&lt;/P&gt;</description>
      <pubDate>Wed, 04 May 2022 12:40:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/morpheus-python3-10/m-p/7249351#M2525</guid>
      <dc:creator />
      <dc:date>2022-05-04T12:40:32Z</dc:date>
    </item>
    <item>
      <title>Re: Morpheus &amp; python3.10</title>
      <link>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/morpheus-python3-10/m-p/7249352#M2526</link>
      <description>&lt;P&gt;Hi Dave,&lt;/P&gt;
&lt;P&gt;It’s definitely something that’s been on my personal wishlist.  If you put it in the ideas section, I would vote for it, but I’ve got my own ways of poking people here.&lt;/P&gt;</description>
      <pubDate>Thu, 05 May 2022 14:00:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/morpheus-python3-10/m-p/7249352#M2526</guid>
      <dc:creator />
      <dc:date>2022-05-05T14:00:21Z</dc:date>
    </item>
  </channel>
</rss>

