Re: Fail to import the 'stackless' module

Jeff Senn <[email protected]> Fri, 25 Jul 2014 08:12:59 -0400
Newsgroups gmane.comp.python.stackless
Message-ID <[email protected]>
--===============7650617883886517896==
Content-Type: multipart/alternative; boundary="Apple-Mail=_16A9D059-66B5-447A-B0B9-A55A96E5A4C5"


--Apple-Mail=_16A9D059-66B5-447A-B0B9-A55A96E5A4C5
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=windows-1252

I suspected.  Possibly these are not enabled because those ports are not =
as well tested as the others =97
or possibly it has just been overlooked.  Given the reminder, I looked =
and have this in my local copy:

#elif defined(__GNUC__) && defined(__arm__) && defined(__thumb__)
#elif defined(__GNUC__) && defined(__arm32__)
#elif defined(__GNUC__) && defined(__ARM__)

Perhaps we can get someone to commit those, as it seems like there is at =
least a fair chance that
those ports will work.  (Though I have no experience with an ARM-thumb =
variant)

On Jul 24, 2014, at 8:32 PM, Bin Huang <[email protected]> wrote:

> Hi Jeff,
>=20
> You are actually right. In fact, stackless is not enabled by default =
when it is compiled for ARM architecture. I don't know why the =
definition for "__arm__" or "__arm32__" is missing.
>=20
> Here is how ''STACKLESS" is defined in "Stackless/stackless.h" in =
stackless-2.6.5:
>=20
> =
--------------------------------------------------------------------------=
----
> #define STACKLESS
>=20
> #ifdef STACKLESS_OFF
> #undef STACKLESS
>         /* an option to switch it off */
> #elif defined(MS_WIN32) && !defined(MS_WIN64) && defined(_M_IX86)
>         /* MS Visual Studio on X86 */
> #elif defined(_WIN64) && defined(_M_X64)
>         /* microsoft on 64 bit x64 thingies */
> #elif defined(__GNUC__) && defined(__i386__)
>         /* gcc on X86 */
> #elif defined(__GNUC__) && defined(__amd64__)
>         /* gcc on AMD64 */
> #elif defined(__GNUC__) && defined(__PPC__) && defined(__linux__)
>         /* gcc on PowerPC */
> #elif defined(__GNUC__) && defined(__ppc__) && defined(__APPLE__)
>         /* Apple MacOS X on PowerPC */
> #elif defined(__GNUC__) && defined(sparc) && defined(sun)
>         /* SunOs on sparc */
> #elif defined(__GNUC__) && defined(__s390__) && defined(__linux__)
>         /* Linux/S390 */
> #elif defined(__GNUC__) && defined(__s390x__) && defined(__linux__)
>         /* Linux/S390 zSeries */
> #elif defined(__GNUC__) && defined(__mips__) && defined(__linux__)
>         /* MIPS */
> #else
>         /* no supported platform */
> #undef STACKLESS
> #endif
> =
--------------------------------------------------------------------------=
----
>=20
> If you take a close look at it, there is no definition for "__arm__" =
or "__arm32__". So I have to manually add that definition to the header =
file.=20
>=20
> Now the problem is solved. I want to thank everyone who helped!
>=20
> Bin
>=20
>=20
> On Thu, Jul 24, 2014 at 7:37 PM, Jeff Senn <[email protected]> wrote:
>=20
> On Jul 24, 2014, at 2:47 PM, Bin Huang <[email protected]> wrote:
>=20
>> Hi Anselm,
>>=20
>> The reason I used Stackless 2.6.5 is because my project needs to =
support the execution of a subset of the Python 2.6 bytecodes.=20
>>=20
>> But I did try 2.7.8 as you suggested. Interestingly, I had the same =
problem with the Stackless 2.7.8 on my ARM platform.=20
>>=20
>> Specifically, here is the output I got:
>>=20
>> =
--------------------------------------------------------------------------=
---------------------------
>> root@192:/opt/stackless-278/bin# ./python
>> Python 2.7.8 (default, Feb 18 1970, 19:12:51)=20
>                        ^^^^^^^^^^^^^
> I think this is a clue.  If your compile options were right for =
compiling with stackless enabled it would=20
> not say =93default=94 here =97 it would say =93Stackless=85<something>=85=
."
>=20
>> [GCC 4.6.3] on linux2
>> Type "help", "copyright", "credits" or "license" for more =
information.
>> >>> import stackless
>> Traceback (most recent call last):
>>   File "<stdin>", line 1, in <module>
>>   File "/opt/stackless-278/lib/python2.7/stackless.py", line 8, in =
<module>
>>     import _stackless
>> ImportError: No module named _stackless
>> =
--------------------------------------------------------------------------=
---------------------------
>>=20
>> Is there a method I can get verbose error message in Python? I =
googled it but did not get any useful tips.
>>=20
>> Any comments?
>>=20
>> Thanks.
>>=20
>> Bin
>>=20
>>=20
>> On Thu, Jul 24, 2014 at 4:19 AM, Anselm Kruis =
<[email protected]> wrote:
>> Hi Bin,
>>=20
>> Why do you use such an old version? Did you already try 2.7.8? It =
contains many fixes, not available in 2.6.
>>=20
>> > necessary bits to build some modules.  When I tried to import the =
'stackless'
>> > module, the system reported an error, "no module named stackless", =
to me.
>> Probably some internal error occurd during the initialisation of the =
module. The import mechanism of Python reports such errors as =
ImportErrors.
>>=20
>> Cheers
>>   Anselm
>>=20
>>=20
>>=20
>> -----Original message-----
>> From:   Bin Huang <[email protected]>
>> Sent:   Thu 24-07-2014 06:32
>> Subject:        [Stackless] Fail to import the 'stackless' module
>> To:     The Stackless Python Mailing List <[email protected]>;
>> > Hi list,
>> >
>> > I have compiled stackless-2.6.5 for an ARM platform (ARMv7 =
architecture). No
>> > error occurred during the compilation except that the system failed =
to find the
>> > necessary bits to build some modules.  When I tried to import the =
'stackless'
>> > module, the system reported an error, "no module named stackless", =
to me.=20
>> >
>> > Specifically, the error message looks like this:
>> >
>> > =
--------------------------------------------------------------------------=
------
>> > ----------------------------
>> > root@192:/opt/stackless-2.6.5/bin# ./python
>> > Python 2.6.5 (unknown, Feb 18 1970, 02:43:59)=20
>> > [GCC 4.6.3] on linux3
>> > Type "help", "copyright", "credits" or "license" for more =
information.
>> > >>> import stackless
>> > Traceback (most recent call last):
>> >   File "<stdin>", line 1, in <module>
>> > ImportError: No module named stackless
>> > >>>=20
>> > =
--------------------------------------------------------------------------=
------
>> > ----------------------------
>> >
>> > Also, I took the same source files and compiled them (with the same
>> > configuration) for an X86 workstation. That worked well and I did =
not have any
>> > problem with importing the 'stackless' module.
>> >
>> > I think Stackless-2.6.5 supports ARMv7 architecture. Otherwise, I =
shouldn't be
>> > able to launch the interpreter.=20
>> >
>> > I really don't have any clue here. I wonder if someone can offer me =
some
>> > insights. Thanks in advance.=20
>> >
>> > Bin
>> > =20
>> >
>> > _______________________________________________
>> >
>> > Stackless mailing list
>> >
>> > [email protected]
>> >
>> > http://www.stackless.com/mailman/listinfo/stackless
>> >
>> >
>> --
>> Vorstandsvorsitzender/Chairman of the board of management:
>> Gerd-Lothar Leonhart
>> Vorstand/Board of Management:
>> Dr. Bernd Finkbeiner, Michael Heinrichs, Dr. Arno Steitz
>> Vorsitzender des Aufsichtsrats/
>> Chairman of the Supervisory Board:
>> Philippe Miltin
>> Sitz/Registered Office: Tuebingen
>> Registergericht/Registration Court: Stuttgart
>> Registernummer/Commercial Register No.: HRB 382196
>> _______________________________________________
>> Stackless mailing list
>> [email protected]
>> http://www.stackless.com/mailman/listinfo/stackless
>>=20
>> _______________________________________________
>> Stackless mailing list
>> [email protected]
>> http://www.stackless.com/mailman/listinfo/stackless
>=20
>=20
> _______________________________________________
> Stackless mailing list
> [email protected]
> http://www.stackless.com/mailman/listinfo/stackless
>=20
> _______________________________________________
> Stackless mailing list
> [email protected]
> http://www.stackless.com/mailman/listinfo/stackless


--Apple-Mail=_16A9D059-66B5-447A-B0B9-A55A96E5A4C5
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=windows-1252

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html =
charset=3Dwindows-1252"></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">I =
suspected. &nbsp;Possibly these are not enabled because those ports are =
not as well tested as the others =97<div>or possibly it has just been =
overlooked. &nbsp;Given the reminder, I looked and have this in my local =
copy:</div><div><br></div><div><div>#elif defined(__GNUC__) &amp;&amp; =
defined(__arm__) &amp;&amp; defined(__thumb__)</div><div>#elif =
defined(__GNUC__) &amp;&amp; defined(__arm32__)</div><div>#elif =
defined(__GNUC__) &amp;&amp; =
defined(__ARM__)</div><div><br></div></div><div>Perhaps we can get =
someone to commit those, as it seems like there is at least a fair =
chance that</div><div>those ports will work. &nbsp;(Though I have no =
experience with an ARM-thumb =
variant)</div><div><br></div><div><div><div>On Jul 24, 2014, at 8:32 PM, =
Bin Huang &lt;<a =
href=3D"mailto:[email protected]">[email protected]</a>&gt; =
wrote:</div><br class=3D"Apple-interchange-newline"><blockquote =
type=3D"cite"><div dir=3D"ltr">Hi Jeff,<div><br></div><div>You are =
actually right. In fact, stackless is not enabled by default when it is =
compiled for ARM architecture. I don't know why the definition for =
"__arm__" or "__arm32__" is missing.</div>
<div><br></div><div>Here is how ''STACKLESS" is defined in =
"Stackless/stackless.h" in =
stackless-2.6.5:</div><div><br></div><div>--------------------------------=
----------------------------------------------</div>
<div><div>#define STACKLESS</div><div><br></div><div>#ifdef =
STACKLESS_OFF</div><div>#undef STACKLESS</div><div>&nbsp; &nbsp; &nbsp; =
&nbsp; /* an option to switch it off */</div><div>#elif =
defined(MS_WIN32) &amp;&amp; !defined(MS_WIN64) &amp;&amp; =
defined(_M_IX86)</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; /* MS Visual Studio on X86 =
*/</div><div>#elif defined(_WIN64) &amp;&amp; =
defined(_M_X64)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; /* microsoft on 64 =
bit x64 thingies */</div><div>#elif defined(__GNUC__) &amp;&amp; =
defined(__i386__)</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; /* gcc on X86 */</div><div>#elif =
defined(__GNUC__) &amp;&amp; defined(__amd64__)</div><div>&nbsp; &nbsp; =
&nbsp; &nbsp; /* gcc on AMD64 */</div><div>#elif defined(__GNUC__) =
&amp;&amp; defined(__PPC__) &amp;&amp; defined(__linux__)</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; /* gcc on PowerPC */</div><div>#elif =
defined(__GNUC__) &amp;&amp; defined(__ppc__) &amp;&amp; =
defined(__APPLE__)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; /* Apple MacOS =
X on PowerPC */</div><div>#elif defined(__GNUC__) &amp;&amp; =
defined(sparc) &amp;&amp; defined(sun)</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; /* SunOs on sparc */</div><div>#elif =
defined(__GNUC__) &amp;&amp; defined(__s390__) &amp;&amp; =
defined(__linux__)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; /* Linux/S390 =
*/</div><div>#elif defined(__GNUC__) &amp;&amp; defined(__s390x__) =
&amp;&amp; defined(__linux__)</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; /* Linux/S390 zSeries =
*/</div><div>#elif defined(__GNUC__) &amp;&amp; defined(__mips__) =
&amp;&amp; defined(__linux__)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; /* =
MIPS */</div><div>#else</div><div>&nbsp; &nbsp; &nbsp; &nbsp; /* no =
supported platform */</div>
<div>#undef =
STACKLESS</div><div>#endif</div></div><div>-------------------------------=
-----------------------------------------------</div><div><br></div><div>I=
f you take a close look at it, there is no definition for "__arm__" or =
"__arm32__". So I have to manually add that definition to the header =
file.&nbsp;</div>
<div><br></div><div>Now the problem is solved. I want to thank everyone =
who helped!</div><div><br></div><div>Bin</div></div><div =
class=3D"gmail_extra"><br><br><div class=3D"gmail_quote">On Thu, Jul 24, =
2014 at 7:37 PM, Jeff Senn <span dir=3D"ltr">&lt;<a =
href=3D"mailto:[email protected]" =
target=3D"_blank">[email protected]</a>&gt;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 =
.8ex;border-left:1px #ccc solid;padding-left:1ex"><div =
style=3D"word-wrap:break-word"><br><div><div class=3D""><div>On Jul 24, =
2014, at 2:47 PM, Bin Huang &lt;<a href=3D"mailto:[email protected]" =
target=3D"_blank">[email protected]</a>&gt; wrote:</div>
<br><blockquote type=3D"cite"><div dir=3D"ltr">Hi =
Anselm,<div><br></div><div>The reason I used Stackless 2.6.5 is because =
my project needs to support the&nbsp;execution&nbsp;of a subset of the =
Python 2.6 bytecodes.&nbsp;</div><div><br></div>
<div>But I did try 2.7.8 as you suggested. Interestingly, I had the same =
problem with the Stackless 2.7.8 on my ARM platform.&nbsp;</div>
<div><br></div><div>Specifically, here is the output I =
got:</div><div><br></div><div>--------------------------------------------=
---------------------------------------------------------</div><div><div>r=
oot@192:/opt/stackless-278/bin# ./python</div>

<div>Python 2.7.8 (default, Feb 18 1970, =
19:12:51)&nbsp;</div></div></div></blockquote></div>&nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp;^^^^^^^^^^^^^</div><div>I think this is a clue. &nbsp;If your =
compile options were right for compiling with stackless enabled it =
would&nbsp;</div>
<div>not say =93default=94 here =97 it would say =
=93Stackless=85&lt;something&gt;=85."</div><div><div =
class=3D"h5"><div><br></div><div><blockquote type=3D"cite"><div =
dir=3D"ltr"><div><div>[GCC 4.6.3] on linux2</div><div>Type "help", =
"copyright", "credits" or "license" for more information.</div>
<div>&gt;&gt;&gt; import stackless</div>
<div>Traceback (most recent call last):</div><div>&nbsp; File =
"&lt;stdin&gt;", line 1, in &lt;module&gt;</div><div>&nbsp; File =
"/opt/stackless-278/lib/python2.7/stackless.py", line 8, in =
&lt;module&gt;</div><div>

&nbsp; &nbsp; import _stackless</div><div>ImportError: No module named =
_stackless</div></div><div>-----------------------------------------------=
------------------------------------------------------<br></div><div><br><=
/div><div>Is there a method I can get verbose error message in Python? I =
googled it but did not get any useful tips.</div>

<div><br></div><div>Any =
comments?</div><div><br></div><div>Thanks.</div><div><br></div><div>Bin</d=
iv></div><div class=3D"gmail_extra"><br><br><div class=3D"gmail_quote">On =
Thu, Jul 24, 2014 at 4:19 AM, Anselm Kruis <span dir=3D"ltr">&lt;<a =
href=3D"mailto:[email protected]" =
target=3D"_blank">[email protected]</a>&gt;</span> wrote:<br>

<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 =
.8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Bin,<br>
<br>
Why do you use such an old version? Did you already try 2.7.8? It =
contains many fixes, not available in 2.6.<br>
<div><br>
&gt; necessary bits to build some modules. &nbsp;When I tried to import =
the 'stackless'<br>
&gt; module, the system reported an error, "no module named stackless", =
to me.<br>
</div>Probably some internal error occurd during the initialisation of =
the module. The import mechanism of Python reports such errors as =
ImportErrors.<br>
<br>
Cheers<br>
&nbsp; Anselm<br>
<div><br>
<br>
<br>
-----Original message-----<br>
From: &nbsp; Bin Huang &lt;<a href=3D"mailto:[email protected]" =
target=3D"_blank">[email protected]</a>&gt;<br>
Sent: &nbsp; Thu <a href=3D"tel:24-07-2014%2006" value=3D"+12407201406" =
target=3D"_blank">24-07-2014 06</a>:32<br>
Subject: &nbsp; &nbsp; &nbsp; &nbsp;[Stackless] Fail to import the =
'stackless' module<br>
To: &nbsp; &nbsp; The Stackless Python Mailing List &lt;<a =
href=3D"mailto:[email protected]" =
target=3D"_blank">[email protected]</a>&gt;;<br>
&gt; Hi list,<br>
&gt;<br>
&gt; I have compiled stackless-2.6.5 for an ARM platform (ARMv7 =
architecture). No<br>
&gt; error occurred during the compilation except that the system failed =
to find the<br>
&gt; necessary bits to build some modules. &nbsp;When I tried to import =
the 'stackless'<br>
&gt; module, the system reported an error, "no module named stackless", =
to me.&nbsp;<br>
&gt;<br>
&gt; Specifically, the error message looks like this:<br>
&gt;<br>
&gt; =
--------------------------------------------------------------------------=
------<br>
&gt; ----------------------------<br>
&gt; root@192:/opt/stackless-2.6.5/bin# ./python<br>
&gt; Python 2.6.5 (unknown, Feb 18 1970, 02:43:59)&nbsp;<br>
&gt; [GCC 4.6.3] on linux3<br>
&gt; Type "help", "copyright", "credits" or "license" for more =
information.<br>
&gt; &gt;&gt;&gt; import stackless<br>
&gt; Traceback (most recent call last):<br>
&gt; &nbsp; File "&lt;stdin&gt;", line 1, in &lt;module&gt;<br>
&gt; ImportError: No module named stackless<br>
&gt; &gt;&gt;&gt;&nbsp;<br>
&gt; =
--------------------------------------------------------------------------=
------<br>
&gt; ----------------------------<br>
&gt;<br>
&gt; Also, I took the same source files and compiled them (with the =
same<br>
&gt; configuration) for an X86 workstation. That worked well and I did =
not have any<br>
&gt; problem with importing the 'stackless' module.<br>
&gt;<br>
&gt; I think Stackless-2.6.5 supports ARMv7 architecture. Otherwise, I =
shouldn't be<br>
&gt; able to launch the interpreter.&nbsp;<br>
&gt;<br>
&gt; I really don't have any clue here. I wonder if someone can offer me =
some<br>
&gt; insights. Thanks in advance.&nbsp;<br>
&gt;<br>
&gt; Bin<br>
&gt; &nbsp;<br>
&gt;<br>
</div>&gt; _______________________________________________<br>
&gt;<br>
&gt; Stackless mailing list<br>
&gt;<br>
&gt; <a href=3D"mailto:[email protected]" =
target=3D"_blank">[email protected]</a><br>
&gt;<br>
&gt; <a href=3D"http://www.stackless.com/mailman/listinfo/stackless" =
target=3D"_blank">http://www.stackless.com/mailman/listinfo/stackless</a><=
br>
&gt;<br>
&gt;<br>
--<br>
Vorstandsvorsitzender/Chairman of the board of management:<br>
Gerd-Lothar Leonhart<br>
Vorstand/Board of Management:<br>
Dr. Bernd Finkbeiner, Michael Heinrichs, Dr. Arno Steitz<br>
Vorsitzender des Aufsichtsrats/<br>
Chairman of the Supervisory Board:<br>
Philippe Miltin<br>
Sitz/Registered Office: Tuebingen<br>
Registergericht/Registration Court: Stuttgart<br>
Registernummer/Commercial Register No.: HRB 382196<br>
_______________________________________________<br>
Stackless mailing list<br>
<a href=3D"mailto:[email protected]" =
target=3D"_blank">[email protected]</a><br>
<a href=3D"http://www.stackless.com/mailman/listinfo/stackless" =
target=3D"_blank">http://www.stackless.com/mailman/listinfo/stackless</a><=
/blockquote></div><br></div>
_______________________________________________<br>Stackless mailing =
list<br><a href=3D"mailto:[email protected]" =
target=3D"_blank">[email protected]</a><br><a =
href=3D"http://www.stackless.com/mailman/listinfo/stackless" =
target=3D"_blank">http://www.stackless.com/mailman/listinfo/stackless</a><=
/blockquote>
=
</div><br></div></div></div><br>__________________________________________=
_____<br>
Stackless mailing list<br>
<a href=3D"mailto:[email protected]">[email protected]</a><br>=

<a href=3D"http://www.stackless.com/mailman/listinfo/stackless" =
target=3D"_blank">http://www.stackless.com/mailman/listinfo/stackless</a><=
br></blockquote></div><br></div>
_______________________________________________<br>Stackless mailing =
list<br><a =
href=3D"mailto:[email protected]">[email protected]</a><br>htt=
p://www.stackless.com/mailman/listinfo/stackless</blockquote></div><br></d=
iv></body></html>=

--Apple-Mail=_16A9D059-66B5-447A-B0B9-A55A96E5A4C5--


--===============7650617883886517896==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Stackless mailing list
[email protected]
http://www.stackless.com/mailman/listinfo/stackless
--===============7650617883886517896==--