crossbario / crossbar

Crossbar.io - WAMP application router
https://crossbar.io/
Other
2.05k stars 274 forks source link

"Running on Windows, but cannot install IOCP Twisted reactor" #474

Closed goeddea closed 8 years ago

goeddea commented 9 years ago

With current trunk on Windows I get the following

Running on Windows, but cannot install IOCP Twisted reactor ←[34m2015-10-01T14:39:18+0200 [Controller 4832]←[39m Automatically choosing optimal Twisted reactor ←[31m2015-10-01T14:39:18+0200 [Controller 4832]←[39m Running on Windows, but cannot install IOCP Twisted reactor ←[34m2015-10-01T14:39:18+0200 [Controller 4832]←[39m Traceback (most recent call last): File "c:\Python27\lib\site-packages\autobahn-0.11.0-py2.7.egg\autobahn\twisted\choosereactor.py", line 87, in install_optimal_reactor iocpreactor.install() File "c:\Python27\lib\site-packages\twisted\internet\iocpreactor\reactor.py", line 269, in install main.installReactor(r) File "c:\Python27\lib\site-packages\twisted\internet\main.py", line 32, in installReactor raise error.ReactorAlreadyInstalledError("reactor already installed") ReactorAlreadyInstalledError: reactor already installed

Crossbar.io starts fine after this.

tlausch commented 9 years ago

which version of twisted do you use? I remember this running under py2 and windows without problems.

goeddea commented 9 years ago

@tlausch Twisted 15.4.0 on Windows 7. Checked that it's current trunk.

oberstet commented 9 years ago

hhm, 0.11.0 isn't trunk https://github.com/crossbario/crossbar/blob/master/crossbar/__init__.py#L56

goeddea commented 9 years ago

Sorry, misread by one line (color codes on Windows are confusing). Just re-checked: Occurs with 0.11.1.

tlausch commented 9 years ago

In fact I receive the exact same error when using python3.4, but that's due to twisted is lacking iocp support for py3 on windows. I tried both, a fresh install using anacondas python 2.7 and the conda pip, with the currentöy released version and afterwards the trunk cloned from github, but they are bioth installing the iocpreactor.

FYI: These are the py2 versions i am using after the fresh install. C:\projects>"..\Anaconda\Scripts\crossbar.exe" version Automatically choosing optimal Twisted reactor Running on Windows and optimal reactor (ICOP) was installed. ←[0m / `|)/ \/`/`|) /\ |) |/ \←[0m ,| __/././|)/~~| . |\/←[0m ←[0m Crossbar.io : 0.11.1←[0m Autobahn : 0.10.9←[0m UTF8 Validator : autobahn←[0m XOR Masker : autobahn←[0m JSON Codec : ujson-1.33←[0m MsgPack Codec : -←[0m Twisted : 15.4.0-IOCPReactor←[0m Python : 2.7.9←[0m/←[33m←[1mCPython←[0m OS : Windows-7-6.1.7601-SP1←[0m Machine : AMD64←[0m

XD yep color codes don't go well on winodws with crossbar, but maybe @oberstet might try using

try:
    from colorama import Fore, init
    init()
except ImportError: (...)

in _logging.py:72 which at least removes the \033 and replaces them with some color ;-)

colorama_init

goeddea commented 9 years ago

to give more information: On my work machine the full log output is

$ crossbar version
Running on Windows, but cannot install IOCP Twisted reactor
Automatically choosing optimal Twisted reactor
Running on Windows, but cannot install IOCP Twisted reactor
Traceback (most recent call last):
  File "c:\Python27\lib\site-packages\autobahn-0.11.0-py2.7.egg\autobahn\twisted\choosereactor.py", line 87, in install_optimal_reactor
    iocpreactor.install()
  File "c:\Python27\lib\site-packages\twisted\internet\iocpreactor\reactor.py", line 269, in install
    main.installReactor(r)
  File "c:\Python27\lib\site-packages\twisted\internet\main.py", line 32, in installReactor
    raise error.ReactorAlreadyInstalledError("reactor already installed")
ReactorAlreadyInstalledError: reactor already installed

←[33m←[1m     __  __  __  __  __  __      __     __←[0m
←[33m←[1m    /  `|__)/  \/__`/__`|__) /\ |__)  |/  \←[0m
←[33m←[1m    \__,|  \\__/.__/.__/|__)/~~\|  \. |\__/←[0m
←[33m←[1m                                        ←[0m
 Crossbar.io        : ←[33m←[1m0.11.1←[0m
   Autobahn         : ←[33m←[1m0.11.0←[0m
     UTF8 Validator : ←[33m←[1mwsaccel-0.6.2←[0m
     XOR Masker     : ←[33m←[1mwsaccel-0.6.2←[0m
     JSON Codec     : ←[33m←[1mujson-1.33←[0m
     MsgPack Codec  : ←[33m←[1mmsgpack-python-0.4.6←[0m
   Twisted          : ←[33m←[1m15.4.0-SelectReactor←[0m
   Python           : ←[33m←[1m2.7.10←[0m/←[33m←[1mCPython←[0m
 OS                 : ←[33m←[1mWindows-7-6.1.7601-SP1←[0m
 Machine            : ←[33m←[1mAMD64←[0m
oberstet commented 9 years ago

@hawkowl I think there are 2 issues here: a) color on windows and b) maybe some import triggered a reactor import, which breaks the reactor selection (and on Py2, IOCP should really be used, not the Select reactor.

a): lets just deactivate the whole colored logging on windows altogether (make non-colored logging the default on windows) b) this needs to be analyzed ..

oberstet commented 8 years ago

As of today, it's like this:

Hence: closing.

k7sleeper commented 7 years ago

Can someone pls help?

I've the same issue using Python 2.7 under Win7, and I dont see why this issue has been closed?

goeddea commented 7 years ago

@k7sleeper - as @oberstet said: Crossbar.io works on Windows with Python 2.7 (just tested: Win7, Python 2.7.12, but just a quick test with the hello:browser template). If your problem goes beyond the error message, then please provide us with details.

k7sleeper commented 7 years ago

Thank you for that fast reply. As I decided to use raw WebSockets for my application this problem is no longer on my focus.

I used Python 2.7.12-32 Bit on Windows 7.

Crossbar seemed to work despite the above mentioned error messages on the console.

danish-monu commented 7 years ago

@goeddea i am running into the same problem as @k7sleeper . To mention, when I run the command - "crossbar templates", only default template is returned. following is the output:

Running on Windows, but cannot install IOCP Twisted reactor Running on Windows, but cannot install IOCP Twisted reactor Traceback (most recent call last): File "c:\python27\lib\site-packages\autobahn\twisted\choosereactor.py", line 84, in install_optimal_reactor iocpreactor.install() File "c:\python27\lib\site-packages\twisted\internet\iocpreactor\reactor.py", line 270, in install main.installReactor(r) File "c:\python27\lib\site-packages\twisted\internet\main.py", line 32, in installReactor raise error.ReactorAlreadyInstalledError("reactor already installed") ReactorAlreadyInstalledError: reactor already installed

Available Crossbar.io node templates:

default A WAMP router speaking WebSocket plus a static Web server.

Please let me know what m i missing.