Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows multiprocessing ImportError- No module named diamond #187

Open
pschuermann opened this issue May 12, 2015 · 1 comment
Open

Windows multiprocessing ImportError- No module named diamond #187

pschuermann opened this issue May 12, 2015 · 1 comment

Comments

@pschuermann
Copy link

Installing latest diamond via pip on windows

C:\Users\xyz>pip install diamond
Downloading/unpacking diamond
  Running setup.py (path:c:\users\xyz\appdata\local\temp\pip_build_xyz\diamond\setup.py) egg_info for package diamond

    warning: no previously-included files found matching 'conf\*.conf'
    warning: no previously-included files matching '*\tests\*' found anywhere in distribution
    warning: no previously-included files matching '*' found under directory 'src\collectors\*\test'
Requirement already satisfied (use --upgrade to upgrade): ConfigObj in c:\python27\lib\site-packages (from diamond)
Requirement already satisfied (use --upgrade to upgrade): psutil in c:\python27\lib\site-packages (from diamond)
Requirement already satisfied (use --upgrade to upgrade): six in c:\python27\lib\site-packages (from ConfigObj->diamond)

Installing collected packages: diamond
  Running setup.py install for diamond

    warning: no previously-included files found matching 'conf\*.conf'
    warning: no previously-included files matching '*\tests\*' found anywhere in distribution
    warning: no previously-included files matching '*' found under directory 'src\collectors\*\test'
Successfully installed diamond
Cleaning up…

Prereqs:

C:\Users\xyz>pip list
configobj (5.0.6)
diamond (4.0.41)
elasticsearch (1.4.0)
jsonpickle (0.9.2)
pip (1.5.6)
psutil (2.1.3)
setuptools (7.0)
six (1.8.0)
urllib3 (1.10.2)

Starting with unmodified windows example config fails:

C:\Users\xyz>C:\Python27\python.exe "C:\Python27\Scripts\diamond" -c "C:\Program Files\diamond\conf\diamond.conf" --skip-change-user --skip-fork -l
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Python27\lib\multiprocessing\forking.py", line 380, in main
    prepare(preparation_data)
  File "C:\Python27\lib\multiprocessing\forking.py", line 489, in prepare
    file, path_name, etc = imp.find_module(main_name, dirs)
ImportError: No module named diamond
1431422385.95   [MainProcess:ERROR]     Unhandled exception:
1431422385.95   [MainProcess:ERROR]     C:\Python27\Scripts\diamond:299
1431422385.95   [MainProcess:ERROR]     traceback: Traceback (most recent call last):
  File "C:\Python27\Scripts\diamond", line 276, in main
    server = Server(configfile=options.configfile)
  File "C:\Python27\lib\site-packages\diamond\server.py", line 58, in __init__
    self.manager = multiprocessing.Manager()
  File "C:\Python27\lib\multiprocessing\__init__.py", line 99, in Manager
    m.start()
  File "C:\Python27\lib\multiprocessing\managers.py", line 528, in start
    self._address = reader.recv()
EOFError

1431422385.95   [MainProcess:ERROR]     C:\Python27\Scripts\diamond:300

Any advice how to get the latest diamond version running on windows?

@docwhat
Copy link
Contributor

docwhat commented May 27, 2015

If you copy the Scripts\diamond to Scripts\diamond-cli.py and run that, then it fixes this.

It's because the multiprocessing module tries to re-import the Scripts\diamond module and fails because it doesn't end in .py.

Renaming Scripts\diamond to Scripts\diamond.py breaks things because you can't import the rest of the diamond library. Altogether, the way the multiprocessing stuff works on Windows is confusing and brittle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants