This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2010年07月02日 13:43 by ot, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| mp.diff | paul.moore, 2010年07月03日 08:58 | |||
| Messages (8) | |||
|---|---|---|---|
| msg109109 - (view) | Author: Giuseppe Ottaviano (ot) | Date: 2010年07月02日 13:43 | |
With a fresh install from python-2.7rc2.amd64.msi (rc1 is also affected) multiprocessing gives the following error: Python 2.7rc2 (r27rc2:82154, Jun 22 2010, 21:22:29) [MSC v.1500 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import multiprocessing >>> multiprocessing.Pool() Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Python27\lib\multiprocessing\__init__.py", line 227, in Pool return Pool(processes, initializer, initargs, maxtasksperchild) File "C:\Python27\lib\multiprocessing\pool.py", line 89, in __init__ self._setup_queues() File "C:\Python27\lib\multiprocessing\pool.py", line 181, in _setup_queues from .queues import SimpleQueue File "C:\Python27\lib\multiprocessing\queues.py", line 22, in <module> from multiprocessing.synchronize import Lock, BoundedSemaphore, Semaphore, Condition File "C:\Python27\lib\multiprocessing\synchronize.py", line 22, in <module> from multiprocessing.forking import assert_spawning, Popen File "C:\Python27\lib\multiprocessing\forking.py", line 158, in <module> from ._multiprocessing import win32, Connection, PipeConnection ImportError: No module named _multiprocessing I noticed that _multiprocessing.lib is not in Lib/multiprocessing/ but in libs/, so I don't know why there is a relative import here. Changing all the occurrences to from _multiprocessing import ... everything works fine. |
|||
| msg109125 - (view) | Author: Benjamin Peterson (benjamin.peterson) * (Python committer) | Date: 2010年07月02日 20:05 | |
Martin, any ideas? |
|||
| msg109163 - (view) | Author: Martin v. Löwis (loewis) * (Python committer) | Date: 2010年07月03日 08:37 | |
Here is the problem: there is no module multiprocessing._multiprocessing; _multiprocessing is a global module. However, multiprocessing/__init__.py imports _multiprocessing, providing multiprocessing._multiprocessing as a valid attribute. sys.modules['multiprocessing._multiprocessing'] is None. Now, on Windows, for some reason, from ._multiprocessing import win32 is used. In 2.6, this used to work. In 2.7, due to r81380, it stopped working (i.e. if I revert r81380, it works again). Adding Brett to the nosy list, as he made this change. |
|||
| msg109164 - (view) | Author: Paul Moore (paul.moore) * (Python committer) | Date: 2010年07月03日 08:43 | |
Martin's analysis (and the description of the commit he refers to) indicates that the correct fix is Cuiseppe's suggestion to change the relative imports to absolute: from _multiprocessing import ... as the previous code was only working because, as a result of the bug fixed in r81380, from ._multiprocessing was falling back to this form anyway. |
|||
| msg109165 - (view) | Author: Paul Moore (paul.moore) * (Python committer) | Date: 2010年07月03日 08:58 | |
Here's a patch implementing the suggested change. test_multiprocessing passes. I am just running the full test suite now. |
|||
| msg109169 - (view) | Author: Paul Moore (paul.moore) * (Python committer) | Date: 2010年07月03日 09:21 | |
Full test suite also looks OK. |
|||
| msg109178 - (view) | Author: Jesse Noller (jnoller) * (Python committer) | Date: 2010年07月03日 12:15 | |
the patch looks good to me - unless someone beats me to it, I'm going to commit it shortly to fix 2.7 |
|||
| msg109180 - (view) | Author: Jesse Noller (jnoller) * (Python committer) | Date: 2010年07月03日 12:26 | |
Pushed it in r82489 - worked for me on Linux and OS/X. Please let me know if anything else comes up. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:03 | admin | set | github: 53390 |
| 2010年07月03日 12:26:47 | jnoller | set | status: open -> closed messages: + msg109180 |
| 2010年07月03日 12:15:43 | jnoller | set | messages: + msg109178 |
| 2010年07月03日 09:21:23 | paul.moore | set | messages: + msg109169 |
| 2010年07月03日 08:58:09 | paul.moore | set | files:
+ mp.diff keywords: + patch messages: + msg109165 |
| 2010年07月03日 08:43:21 | paul.moore | set | nosy:
+ paul.moore messages: + msg109164 |
| 2010年07月03日 08:37:14 | loewis | set | nosy:
+ brett.cannon messages: + msg109163 |
| 2010年07月03日 03:39:24 | ncoghlan | set | nosy:
+ jnoller |
| 2010年07月02日 20:05:25 | benjamin.peterson | set | nosy:
+ loewis messages: + msg109125 |
| 2010年07月02日 14:02:33 | eric.araujo | set | nosy:
+ eric.araujo resolution: accepted components: + Build, - Library (Lib) |
| 2010年07月02日 14:01:13 | georg.brandl | set | priority: high -> release blocker |
| 2010年07月02日 14:01:06 | georg.brandl | set | priority: normal -> high assignee: benjamin.peterson nosy: + benjamin.peterson |
| 2010年07月02日 13:43:14 | ot | create | |