can't run crossbar under Windows python 3.4.3 (Name Error: twisted\...\lockfile,py)

367 views
Skip to first unread message

Gelonida Gel

unread,
May 5, 2015, 7:29:17 AM5/5/15
to cross...@googlegroups.com
Hi,


The quick version:
=============
- first pip install crossbar  fails ( NameError: name 'file' is not defined )
- second pip install crossbar seems successful
- crossbar init --appdir tst is successful
- crossbar start fails with an error ( NameError: name 'file' is not defined )

slightly longer version:
=================

the exception when running crossbar start is :

(pyxb) d:\tmp\tst>crossbar start
Traceback (most recent call last):
  File "c:\pyxb\Scripts\crossbar-script.py", line 9, in <module>
    load_entry_point('crossbar==0.10.4', 'console_scripts', 'crossbar')()
  File "c:\pyxb\lib\site-packages\crossbar\controller\cli.py", line 665, in run
    options.func(options)
  File "c:\pyxb\lib\site-packages\crossbar\controller\cli.py", line 369, in run_command_start
    reactor = install_reactor(options.reactor, options.debug)
  File "c:\pyxb\lib\site-packages\autobahn\twisted\choosereactor.py", line 131, in install_reactor
    import txaio
  File "c:\pyxb\lib\site-packages\txaio\__init__.py", line 99, in <module>
    from txaio.tx import *  # noqa
  File "c:\pyxb\lib\site-packages\txaio\tx.py", line 28, in <module>
    from twisted.internet.defer import maybeDeferred, Deferred, DeferredList
  File "c:\pyxb\lib\site-packages\twisted\internet\defer.py", line 29, in <module>
    from twisted.python import lockfile, log, failure
  File "c:\pyxb\lib\site-packages\twisted\python\lockfile.py", line 52, in <module>
    _open = file
NameError: name 'file' is not defined



The long version:
=============
For some local testing I'd like to run crossbar on windows.

I freshly installed python 3.4.3

I freshly installed virtualenv
c:\Python34\Scripts\pip.exe install virtualenv

I create a new virutalenv:
c:\Python34\Scripts\virtualenv.exe c:\pyxb

I activate it:
c:\pyxb\Scripts\activate

I try to install crossbar:
pip install crossbar

the first lines look good, but then things seem to go wrong:

    reading manifest file 'autobahn.egg-info\SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    writing manifest file 'autobahn.egg-info\SOURCES.txt'
    Copying autobahn.egg-info to c:\pyxb\Lib\site-packages\autobahn-0.10.3-py3.4.egg-info
    running install_scripts
    writing list of installed files to 'C:\Users\klausf\AppData\Local\Temp\pip-2p87y0px-record\install-record.txt'
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\klausf\AppData\Local\Temp\pip-build-ovy5zx3b\autobahn\setup.py", line 215, in <module>
        from twisted.internet import reactor
      File "c:\pyxb\lib\site-packages\twisted\internet\reactor.py", line 38, in <module>
        from twisted.internet import default
      File "c:\pyxb\lib\site-packages\twisted\internet\default.py", line 56, in <module>
        install = _getInstallFunction(platform)
      File "c:\pyxb\lib\site-packages\twisted\internet\default.py", line 50, in _getInstallFunction
        from twisted.internet.selectreactor import install
      File "c:\pyxb\lib\site-packages\twisted\internet\selectreactor.py", line 18, in <module>
        from twisted.internet import posixbase
      File "c:\pyxb\lib\site-packages\twisted\internet\posixbase.py", line 24, in <module>
        from twisted.internet import error, udp, tcp
      File "c:\pyxb\lib\site-packages\twisted\internet\udp.py", line 53, in <module>
        from twisted.internet import base, defer, address
      File "c:\pyxb\lib\site-packages\twisted\internet\base.py", line 23, in <module>
        from twisted.internet import fdesc, main, error, abstract, defer, threads
      File "c:\pyxb\lib\site-packages\twisted\internet\defer.py", line 29, in <module>
        from twisted.python import lockfile, log, failure
      File "c:\pyxb\lib\site-packages\twisted\python\lockfile.py", line 52, in <module>
        _open = file
    NameError: name 'file' is not defined

What could be the issue?

Only a few packets were sucessfully installed:
(pyxb) C:\pyxb>pip freeze
autobahn==0.10.3
six==1.9.0
Twisted==15.1.0
txaio==1.0.0
zope.interface==4.1.2


Calling pip install crossbar a second time pretends to be successful

I'm having now:
(pyxb) C:\pyxb>pip freeze
autobahn==0.10.3
cffi==0.9.2
characteristic==14.3.0
crossbar==0.10.4
cryptography==0.8.2
Jinja2==2.7.3
MarkupSafe==0.23
mistune==0.5.1
netaddr==0.7.14
pyasn1==0.1.7
pyasn1-modules==0.0.5
pycparser==2.12
Pygments==2.0.2
pyOpenSSL==0.15.1
PyTrie==0.2
PyYAML==3.11
requests==2.7.0
service-identity==14.0.0
shutilwhich==1.1.0
six==1.9.0
treq==15.0.0
Twisted==15.1.0
txaio==1.0.0
zope.interface==4.1.2

crossbar init --appdir tst
seems to work

crossbar start
fails with
(pyxb) d:\tmp\tst>crossbar start
Traceback (most recent call last):
  File "c:\pyxb\Scripts\crossbar-script.py", line 9, in <module>
    load_entry_point('crossbar==0.10.4', 'console_scripts', 'crossbar')()
  File "c:\pyxb\lib\site-packages\crossbar\controller\cli.py", line 665, in run
    options.func(options)
  File "c:\pyxb\lib\site-packages\crossbar\controller\cli.py", line 369, in run_command_start
    reactor = install_reactor(options.reactor, options.debug)
  File "c:\pyxb\lib\site-packages\autobahn\twisted\choosereactor.py", line 131, in install_reactor
    import txaio
  File "c:\pyxb\lib\site-packages\txaio\__init__.py", line 99, in <module>
    from txaio.tx import *  # noqa
  File "c:\pyxb\lib\site-packages\txaio\tx.py", line 28, in <module>
    from twisted.internet.defer import maybeDeferred, Deferred, DeferredList
  File "c:\pyxb\lib\site-packages\twisted\internet\defer.py", line 29, in <module>
    from twisted.python import lockfile, log, failure
  File "c:\pyxb\lib\site-packages\twisted\python\lockfile.py", line 52, in <module>
    _open = file
NameError: name 'file' is not defined

Any ideas???
 

 


Roger Erens

unread,
May 6, 2015, 9:55:45 AM5/6/15
to cross...@googlegroups.com
Hi Gel,

Twisted is not yet ready for use with Python3. Use Python 2.7.9 instead.

See

Gelonida Gel

unread,
May 6, 2015, 11:51:33 AM5/6/15
to cross...@googlegroups.com
Thanks a lot Roger,

I got confused by the fact, that crossbar clients written in python can be written without twisted (just with asyncio)

So if I understand correctly:
- Crossbar itself depends on twisted, which is still  not ready for python3
- Only the python autobahnclients connecting to crossbar can be written in python3 with asyncio or in python2 with twisteds or trollius (asyncio-port)

Is that right?

Alexander Gödde

unread,
May 7, 2015, 5:35:13 AM5/7/15
to cross...@googlegroups.com, gelo...@gmail.com
Hi Gelonida,

that is correct - Crossbar, due to its reliance on Twisted, currently does not run under Python 3.

This is changing though - we're supporting the porting of Twisted to Python 3, and Crossbar.io on Python 3 should be a reality soon.

Regards,

Alex

Harold Short

unread,
Sep 2, 2015, 3:06:44 PM9/2/15
to Crossbar, gelo...@gmail.com
When running from source, Crossbar now seems to run okay under Python 3.4 on both OSX 10.10.5 and Ubuntu 14.04.

Installing on Windows seems to complete without errors, but running Crossbar there still gives the "name 'file' is not defined" error.

Feels like progress! I'm looking forward to Crossbar/Twisted support for Python 3 on Windows.

Regards,

Harold

Tobias Oberstein

unread,
Sep 2, 2015, 6:01:46 PM9/2/15
to cross...@googlegroups.com, gelo...@gmail.com
Harold,

thanks for reporting back! Yeah, we've made huge progress .. Python 3
credits go mainly to Hawkie for working on CB, and for working on
Twisted (Tavendo/Crossbar.io sponsored this work also).

Rgd the issue: could you please file an issue on Crossbar.io/GitHub
including a complete traceback (log output)?

The 0.11 release is due very soon, and we might have the chance to fix
this before. Probably trivial.

Cheers,
/Tobias

PS: if you have some minutes to spare:

- does the colored logging work on Windows for you?

- does Ctrl-C'ing CB work robustly?

- if you have a CB running with multiple workers, killing any of the
workers (or the controller) should make the whole node shutdown, and
shutdown all the (other) workers along
> --
> You received this message because you are subscribed to the Google
> Groups "Crossbar" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to crossbario+...@googlegroups.com
> <mailto:crossbario+...@googlegroups.com>.
> To post to this group, send email to cross...@googlegroups.com
> <mailto:cross...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/crossbario/a6c4bdc4-8f3a-4eff-b430-e7e74d588ee9%40googlegroups.com
> <https://groups.google.com/d/msgid/crossbario/a6c4bdc4-8f3a-4eff-b430-e7e74d588ee9%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

tobias...@t-online.de

unread,
Sep 15, 2015, 4:33:25 PM9/15/15
to Crossbar, gelo...@gmail.com
Hey Tobias,

since I ran into the same problem few minutes ago and didn't find the issue on CB,
There is a ticket on twisted for this: 


C:\Anaconda3\Scripts>crossbar version
Traceback (most recent call last):
  File "c:\anaconda3\lib\runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\anaconda3\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Anaconda3\Scripts\crossbar.exe\__main__.py", line 9, in <module>
  File "c:\anaconda3\lib\site-packages\crossbar\controller\cli.py", line 822, in run
    reactor = install_reactor(options.reactor, debug)
  File "c:\anaconda3\lib\site-packages\autobahn\twisted\choosereactor.py", line 133, in install_reactor
    import txaio
  File "C:\Users\coro\AppData\Roaming\Python\Python34\site-packages\txaio\__init__.py", line 110, in <module>
    from txaio.tx import *  # noqa
  File "C:\Users\coro\AppData\Roaming\Python\Python34\site-packages\txaio\tx.py", line 28, in <module>
    from twisted.internet.defer import maybeDeferred, Deferred, DeferredList
  File "c:\anaconda3\lib\site-packages\twisted\internet\defer.py", line 29, in <module>
    from twisted.python import lockfile, failure
  File "c:\anaconda3\lib\site-packages\twisted\python\lockfile.py", line 52, in <module>
    _open = file
NameError: name 'file' is not defined.

To answer your question, there isn't any color on the windows prompt.
Cannot verify the CTRL+C since CB ist not running yet ;-)

Regards,

Tobias

Alexander Gödde

unread,
Sep 17, 2015, 5:05:48 AM9/17/15
to Crossbar, gelo...@gmail.com
Hi tobias!

I've added this as an issue in the Crossbar repo (https://github.com/crossbario/crossbar/issues/462), with links to both this conversation and the twisted issue. Thanks for reporting this!

Regards,

Alex

tobias...@t-online.de

unread,
Sep 17, 2015, 5:08:38 AM9/17/15
to Crossbar, gelo...@gmail.com
Thanks alex.
I'm really looking forward to install this technology in our labroratories.

Regards,
Tobias
Reply all
Reply to author
Forward
0 new messages