Re: start_ipython() and multiprocessing

Thomas Kluyver <[email protected]> Thu, 13 Jul 2017 09:23:49 +0200
Newsgroups gmane.comp.python.ipython.devel
Message-ID <CAOvn4qiZSQjO4eQODAxNXAVNZbVRiDSJj+vABsHTLnBYUK7R5Q@mail.gmail.com>
--===============6569343034642927979==
Content-Type: multipart/alternative; boundary="94eb2c19e3682b771d05542dd260"

--94eb2c19e3682b771d05542dd260
Content-Type: text/plain; charset="UTF-8"

Hi Hugo,

See the 'safe importing of main module' section here:

https://docs.python.org/3/library/multiprocessing.html#the-spawn-and-forkserver-start-methods

Best wishes,
Thomas

On 12 July 2017 at 22:33, Hugo Gagnon <[email protected]
> wrote:

> Hi,
>
> When I do "import multiprocessing; p = multiprocessing.Pool()" in IPython
> everything works fine. However when I put "import IPython;
> IPython.start_ipython()" in say "test.py" and then do "$python test.py" and
> try starting a pool with the above command the prompt starts "multiplying
> itself" and sometimes crashes.
>
> I use Anaconda 4.4.0 Python 2.7.13 IPython 5.3.0 on Windows 7.
>
> --
>   Hugo Gagnon
> _______________________________________________
> IPython-dev mailing list
> [email protected]
> https://mail.python.org/mailman/listinfo/ipython-dev
>

--94eb2c19e3682b771d05542dd260
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div><div><div>Hi Hugo,<br><br></div>See the &#39;safe imp=
orting of main module&#39; section here:<br><br><a href=3D"https://docs.pyt=
hon.org/3/library/multiprocessing.html#the-spawn-and-forkserver-start-metho=
ds">https://docs.python.org/3/library/multiprocessing.html#the-spawn-and-fo=
rkserver-start-methods</a><br><br></div>Best wishes,<br></div>Thomas<br></d=
iv><div class=3D"gmail_extra"><br><div class=3D"gmail_quote">On 12 July 201=
7 at 22:33, Hugo Gagnon <span dir=3D"ltr">&lt;<a href=3D"mailto:freesoftwar=
[email protected]" target=3D"_blank">[email protected]=
tmail.fm</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,<br>
<br>
When I do &quot;import multiprocessing; p =3D multiprocessing.Pool()&quot; =
in IPython everything works fine. However when I put &quot;import IPython; =
IPython.start_ipython()&quot; in say &quot;test.py&quot; and then do &quot;=
$python test.py&quot; and try starting a pool with the above command the pr=
ompt starts &quot;multiplying itself&quot; and sometimes crashes.<br>
<br>
I use Anaconda 4.4.0 Python 2.7.13 IPython 5.3.0 on Windows 7.<br>
<br>
--<br>
=C2=A0 Hugo Gagnon<br>
______________________________<wbr>_________________<br>
IPython-dev mailing list<br>
<a href=3D"mailto:[email protected]">[email protected]</a><br>
<a href=3D"https://mail.python.org/mailman/listinfo/ipython-dev" rel=3D"nor=
eferrer" target=3D"_blank">https://mail.python.org/<wbr>mailman/listinfo/ip=
ython-dev</a><br>
</blockquote></div><br></div>

--94eb2c19e3682b771d05542dd260--

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

_______________________________________________
IPython-dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/ipython-dev

--===============6569343034642927979==--