Adding thread module support to Ubuntu 3 for Python3

Chris Angelico rosuav at gmail.com
Mon Jun 23 17:50:35 EDT 2014


On Tue, Jun 24, 2014 at 6:34 AM,  <kenakahn at gmail.com> wrote:
> On Monday, June 23, 2014 4:12:34 PM UTC-4, kena... at gmail.com wrote:
>> What package do I need to install to get thread support (import thread) for Python 3 running under ubuntu 3?
>
> Found it.  The import statement changed to "import _thread" for python3.

Actually, that should give you a strong hint that you shouldn't be
using that module. The leading underscore says that the module is
private/internal. The thread module's docstring under Python 2
suggests that you should instead be using "import threading", which
works on both versions.

ChrisA



More information about the Python-list mailing list