<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>13147</bug_id>
          
          <creation_ts>2019-01-23 10:14:45 +0000</creation_ts>
          <short_desc>ImportError: No module named site OpenEmbedded requires &apos;python&apos; to be python v2 (&gt;= 2.7.3), not python v3.</short_desc>
          <delta_ts>2021-04-29 15:25:04 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>core</component>
          <version>2.6.1</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>OBSOLETE</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>3.3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Robert Berger">pokylinux</reporter>
          <assigned_to name="Paul Eggleton">bluelightning</assigned_to>
          <cc>brennana</cc>
    
    <cc>kai.kang</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>ross.burton</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>82837</commentid>
    <comment_count>0</comment_count>
    <who name="Robert Berger">pokylinux</who>
    <bug_when>2019-01-23 10:14:45 +0000</bug_when>
    <thetext>I&apos;m using a pre-release 2.6.1 version + extensible SDK.

When I run this from the extensible SDK (not bitbake cooker modus) I get:

+ devtool add nettoe https://github.com/RobertBerger/nettoe.git
+ press &lt;ENTER&gt; to go on

NOTE: Starting bitbake server...
ImportError: No module named site
OpenEmbedded requires &apos;python&apos; to be python v2 (&gt;= 2.7.3), not python v3.
Please upgrade your python v2.
NOTE: Starting bitbake server...
NOTE: Fetching git://github.com/RobertBerger/nettoe.git;protocol=https...

host# source environment-setup-armv7a-neon-poky-linux-gnueabi

host# which python3
/opt/ext-sdk/poky/2.6.1/multi-v7-ml/imx6q-phytec-mira-rdk-nand/buildtools/sysroots/x86_64-pokysdk-linux/usr/bin/python3

host# python3 --version
Python 3.5.6

host# which python
/usr/bin/python

host# python --version
Python 2.7.12

I thought we got rid of Python2 a long time ago for OE/Yocto.

Do I need to add Python 2 to my SDK now?

I am confused about the &quot;upgrade&quot; error.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82838</commentid>
    <comment_count>1</comment_count>
    <who name="Robert Berger">pokylinux</who>
    <bug_when>2019-01-23 10:26:23 +0000</bug_when>
    <thetext>Looks like it&apos;s bitbake, which comes with the SDK which complains about the Python version and not necessarily devtool.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82845</commentid>
    <comment_count>2</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2019-01-24 15:44:00 +0000</bug_when>
    <thetext>That message isn&apos;t bitbake but oe-core:

scripts/oe-buildenv-internal:    echo &gt;&amp;2 &quot;OpenEmbedded requires &apos;python&apos; to be python v2 (&gt;= 2.7.3), not python v3.&quot;

And indeed, OE still hard-requires Python 2 to be present because too many upstream still assume that Python 2 is present.  A few months ago I removed Py2 to see what broke and a not-insignificant amount of the system wouldn&apos;t build.

Maybe for 2.8 enough of the ecosystem will have migrated to Python 3 that we won&apos;t need to enforce this requirement, but for now you&apos;ll need both.

The good question is why you&apos;re getting an exception although the system claims to have python present.  Can you run python interactively and import site?  Is there a python binary inside the eSDK?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82864</commentid>
    <comment_count>3</comment_count>
    <who name="Robert Berger">pokylinux</who>
    <bug_when>2019-01-25 11:52:51 +0000</bug_when>
    <thetext>(In reply to comment #2)

&gt; The good question is why you&apos;re getting an exception although the system
&gt; claims to have python present.  Can you run python interactively and import
&gt; site?

That&apos;s without the eSDK environment:

python
Python 2.7.12 (default, Nov 19 2016, 06:48:10) 
[GCC 5.4.0 20160609] on linux2
Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.
&gt;&gt;&gt; import site
&gt;&gt;&gt; 

That&apos;s with the eSDK environment:

source environment-setup-armv7a-neon-poky-linux-gnueabi 
SDK environment now set up; additionally you may now run devtool to perform development tasks.
Run devtool --help for further details.
student@e450-1:/opt/ext-sdk/poky/2.6.1/multi-v7-ml/imx6q-phytec-mira-rdk-nand⟫ python
Python 2.7.12 (default, Nov 19 2016, 06:48:10) 
[GCC 5.4.0 20160609] on linux2
Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.
&gt;&gt;&gt; import site
&gt;&gt;&gt; 

⟫which python
/usr/bin/python
⟫which python2
/usr/bin/python2
⟫which python2.7
/usr/bin/python2.7
⟫which python3
/opt/ext-sdk/poky/2.6.1/multi-v7-ml/imx6q-phytec-mira-rdk-nand/buildtools/sysroots/x86_64-pokysdk-linux/usr/bin/python3

&gt; Is there a python binary inside the eSDK?

I checked in buildtools:

⟫find | grep python3$
./sysroots/x86_64-pokysdk-linux/usr/bin/python3

⟫ find | grep python2$

nothing

⟫ find | grep python$

nothing

in tmp/sysroots/x86_64:
./usr/bin/python-native/python2.7
./usr/bin/python-native/python2

in tmp/sysroots/x86_64:
./usr/bin/nativepython3</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82868</commentid>
    <comment_count>4</comment_count>
    <who name="Stephen K Jolley">sjolley.yp.pm</who>
    <bug_when>2019-01-25 17:03:00 +0000</bug_when>
    <thetext>Ross, it appears you NEEDINFO question has been answered. If you have questions put it back in NEEDINFO.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87023</commentid>
    <comment_count>5</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2020-04-16 05:09:47 +0000</bug_when>
    <thetext>Bouncing to Paul as this is SDK related and he can look at it.  Note this is an old bug so may be obsolete by now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88029</commentid>
    <comment_count>6</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2020-08-25 10:54:52 +0000</bug_when>
    <thetext>You can reproduce this bug with:

wget http://downloads.yoctoproject.org/releases/yocto/yocto-2.6.4/toolchain/x86_64/poky-glibc-x86_64-core-image-sato-armv5e-toolchain-ext-2.6.4.sh

then cd and source the env file, then

devtool add nettoe https://github.com/RobertBerger/nettoe.git

and you will see:

richard@jet:/tmp/rptest2$ devtool add nettoe https://github.com/RobertBerger/nettoe.git
NOTE: Starting bitbake server...
ImportError: No module named site
OpenEmbedded requires &apos;python&apos; to be python v2 (&gt;= 2.7.3), not python v3.
Please upgrade your python v2.
NOTE: Starting bitbake server...

but the command does complete successfully. The successful completion is probably why the automated tests don&apos;t catch it.

So the bug was definitely in 2.6.4.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>90170</commentid>
    <comment_count>7</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2021-04-29 15:25:04 +0000</bug_when>
    <thetext>python2 is no longer supported and 2.6.1 is in community support mode.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>