Gateone.py can't import onoff #214

Open
tommis opened this Issue Feb 28, 2013 · 12 comments

Comments

Projects
None yet
4 participants
@tommis

tommis commented Feb 28, 2013

I get 'ImportError:No module named onoff' when i run gateone.py. It's correctly located in /opt/lib/python2.7/site-packages/onoff/onoff.py.

@jmwright

This comment has been minimized.

Show comment Hide comment
@jmwright

jmwright Feb 28, 2013

And you installed GateOne using setup.py? If so, did you remove the old install first? I've had problems that were caused by both of those things.

And you installed GateOne using setup.py? If so, did you remove the old install first? I've had problems that were caused by both of those things.

@tommis

This comment has been minimized.

Show comment Hide comment
@tommis

tommis Feb 28, 2013

I installed it through the aur (arch user repository) and I haven't installed this before. Sorry for forgetting.

I can't also import onoff trough the python shell.

tommis commented Feb 28, 2013

I installed it through the aur (arch user repository) and I haven't installed this before. Sorry for forgetting.

I can't also import onoff trough the python shell.

@jmwright

This comment has been minimized.

Show comment Hide comment
@jmwright

jmwright Feb 28, 2013

Do you know what version you're getting through aur?

I would probably try to grab the latest version from git (or the zip) and try to install that. If that works maybe it's something with the install script from aur?

Do you know what version you're getting through aur?

I would probably try to grab the latest version from git (or the zip) and try to install that. If that works maybe it's something with the install script from aur?

@liftoff

This comment has been minimized.

Show comment Hide comment
@liftoff

liftoff Feb 28, 2013

Owner

This is caused because the latest git code installs termio.py, terminal.py, and onoff.py as their own modules independent of Gate One. I'll be implementing a workaround to allow it to work out of the Gate One directory in the next commit.

Owner

liftoff commented Feb 28, 2013

This is caused because the latest git code installs termio.py, terminal.py, and onoff.py as their own modules independent of Gate One. I'll be implementing a workaround to allow it to work out of the Gate One directory in the next commit.

@tommis

This comment has been minimized.

Show comment Hide comment
@tommis

tommis Feb 28, 2013

Thanks.

tommis commented Feb 28, 2013

Thanks.

@jmwright

This comment has been minimized.

Show comment Hide comment
@jmwright

jmwright Feb 28, 2013

I had assumed that since onoff.py was in /opt/lib/python2.7/site-packages/onoff/ the aur script was installing it as a module already.

I had assumed that since onoff.py was in /opt/lib/python2.7/site-packages/onoff/ the aur script was installing it as a module already.

@liftoff

This comment has been minimized.

Show comment Hide comment
@liftoff

liftoff Feb 28, 2013

Owner

@jmwright It all depends on what's in your $PYTHONPATH or sys.path. Check it:

python -c "import sys; print(sys.path)"

If /opt/lib/python2.7/site-packages is listed then it shouldn't be giving you errors about not being able to import onoff.

Owner

liftoff commented Feb 28, 2013

@jmwright It all depends on what's in your $PYTHONPATH or sys.path. Check it:

python -c "import sys; print(sys.path)"

If /opt/lib/python2.7/site-packages is listed then it shouldn't be giving you errors about not being able to import onoff.

liftoff added a commit that referenced this issue Mar 1, 2013

gateone.js: Fixed a bug where GateOne.User stuff wasn't working due t…
…o the 'prefix' variable being set incorrectly.

gateone.py:  Fixed a bug where themes were not being synchronized with the client properly (it was using the modification time of the wrong file).
gateone.py:  You can run Gate One out of the git clone directory again.  Installing via setup.py is not necessary.  This should close issue #214 (#214).
gateone.py:  Changed the way 'gateone' settings are detected so as to avoid accidentally overwriting a 10server.conf that may simply have a syntax error (related to issue #213).
app_terminal.py:  Fixed a bug where if you had a syntax error in your 50terminal.conf it would overwrite the file.  This should close issue #213 (#213).
Themes:  Just a few tweaks here and there to make stuff look better.
@lipidity

This comment has been minimized.

Show comment Hide comment
@lipidity

lipidity Mar 2, 2013

Contributor

I believe this error is fixed now. However, there is another. I don't know if it's related.

ImportError: cannot import name terminal

That is from File "/opt/gateone/applications/terminal/plugins/html/html.py", line 49, from termio import terminal

from termio import terminal in a python2 shell gives the same error; import termio works fine.

Contributor

lipidity commented Mar 2, 2013

I believe this error is fixed now. However, there is another. I don't know if it's related.

ImportError: cannot import name terminal

That is from File "/opt/gateone/applications/terminal/plugins/html/html.py", line 49, from termio import terminal

from termio import terminal in a python2 shell gives the same error; import termio works fine.

@liftoff

This comment has been minimized.

Show comment Hide comment
@liftoff

liftoff Mar 2, 2013

Owner

I just pushed a commit that should fix this... Please grab the latest code and let me know how it goes.

Owner

liftoff commented Mar 2, 2013

I just pushed a commit that should fix this... Please grab the latest code and let me know how it goes.

@jmwright

This comment has been minimized.

Show comment Hide comment
@jmwright

jmwright Mar 4, 2013

I'm able to run GateOne on CentOS 6.3 without installing it now, which I believe is related to the error lipidity was seeing above.

jmwright commented Mar 4, 2013

I'm able to run GateOne on CentOS 6.3 without installing it now, which I believe is related to the error lipidity was seeing above.

@liftoff

This comment has been minimized.

Show comment Hide comment
@liftoff

liftoff Mar 4, 2013

Owner

@lipidity Can you confirm that it works out of the directory without having to install? If so, just close this issue.

Owner

liftoff commented Mar 4, 2013

@lipidity Can you confirm that it works out of the directory without having to install? If so, just close this issue.

@lipidity

This comment has been minimized.

Show comment Hide comment
@lipidity

lipidity Mar 4, 2013

Contributor

I've always been installing from the Arch Linux package, which runs python2 setup.py install --root="$pkgdir".

The webpage loads but can't connect to a websocket. I still get the following errors:

[I 130304 21:59:40 app_terminal:375] Active Terminal Plugins: bookmarks, convenience, example, html, logging, logging_plugin, notice, playback, ssh
[E 130304 21:59:40 iostream:314] Uncaught exception, closing connection.
    Traceback (most recent call last):
      File "/usr/lib/python2.7/site-packages/tornado/iostream.py", line 311, in wrapper
        callback(*args)
      File "/usr/lib/python2.7/site-packages/tornado/httpserver.py", line 268, in _on_headers
        self.request_callback(self._request)
      File "/usr/lib/python2.7/site-packages/tornado/web.py", line 1395, in __call__
        handler = spec.handler_class(self, request, **spec.kwargs)
      File "./gateone.py", line 893, in __init__
        WebSocketHandler.__init__(self, application, request, **kwargs)
      File "/usr/lib/python2.7/site-packages/tornado/websocket.py", line 81, in __init__
        **kwargs)
      File "/usr/lib/python2.7/site-packages/tornado/web.py", line 131, in __init__
        self.initialize(**kwargs)
      File "./gateone.py", line 989, in initialize
        instance.initialize()
      File "/opt/gateone/applications/terminal/app_terminal.py", line 380, in initialize
        imported = load_modules(self.plugins['py'])
      File "/opt/gateone/utils.py", line 979, in load_modules
        imported = __import__(module, None, None, [''])
      File "/opt/gateone/applications/terminal/plugins/html/html.py", line 49, in <module>
        from termio import terminal
    ImportError: cannot import name terminal
[E 130304 21:59:40 ioloop:435] Exception in callback <tornado.stack_context._StackContextWrapper object at 0x197a208>
    Traceback (most recent call last):
      File "/usr/lib/python2.7/site-packages/tornado/ioloop.py", line 421, in _run_callback
        callback()
      File "/usr/lib/python2.7/site-packages/tornado/iostream.py", line 311, in wrapper
        callback(*args)
      File "/usr/lib/python2.7/site-packages/tornado/httpserver.py", line 268, in _on_headers
        self.request_callback(self._request)
      File "/usr/lib/python2.7/site-packages/tornado/web.py", line 1395, in __call__
        handler = spec.handler_class(self, request, **spec.kwargs)
      File "./gateone.py", line 893, in __init__
        WebSocketHandler.__init__(self, application, request, **kwargs)
      File "/usr/lib/python2.7/site-packages/tornado/websocket.py", line 81, in __init__
        **kwargs)
      File "/usr/lib/python2.7/site-packages/tornado/web.py", line 131, in __init__
        self.initialize(**kwargs)
      File "./gateone.py", line 989, in initialize
        instance.initialize()
      File "/opt/gateone/applications/terminal/app_terminal.py", line 380, in initialize
        imported = load_modules(self.plugins['py'])
      File "/opt/gateone/utils.py", line 979, in load_modules
        imported = __import__(module, None, None, [''])
      File "/opt/gateone/applications/terminal/plugins/html/html.py", line 49, in <module>
        from termio import terminal
    ImportError: cannot import name terminal
[E 130304 21:59:40 iostream:314] Uncaught exception, closing connection.
    Traceback (most recent call last):
      File "/usr/lib/python2.7/site-packages/tornado/iostream.py", line 311, in wrapper
        callback(*args)
      File "/usr/lib/python2.7/site-packages/tornado/websocket.py", line 226, in on_connection_close
        if self.ws_connection:
    AttributeError: 'ApplicationWebSocket' object has no attribute 'ws_connection'
[E 130304 21:59:40 ioloop:435] Exception in callback <tornado.stack_context._StackContextWrapper object at 0x197a158>
    Traceback (most recent call last):
      File "/usr/lib/python2.7/site-packages/tornado/ioloop.py", line 421, in _run_callback
        callback()
      File "/usr/lib/python2.7/site-packages/tornado/iostream.py", line 311, in wrapper
        callback(*args)
      File "/usr/lib/python2.7/site-packages/tornado/websocket.py", line 226, in on_connection_close
        if self.ws_connection:
    AttributeError: 'ApplicationWebSocket' object has no attribute 'ws_connection'
^C[I 130304 21:59:43 gateone:3523] Caught KeyboardInterrupt.  Killing sessions...
[I 130304 21:59:43 gateone:3527] pid file removed.
Contributor

lipidity commented Mar 4, 2013

I've always been installing from the Arch Linux package, which runs python2 setup.py install --root="$pkgdir".

The webpage loads but can't connect to a websocket. I still get the following errors:

[I 130304 21:59:40 app_terminal:375] Active Terminal Plugins: bookmarks, convenience, example, html, logging, logging_plugin, notice, playback, ssh
[E 130304 21:59:40 iostream:314] Uncaught exception, closing connection.
    Traceback (most recent call last):
      File "/usr/lib/python2.7/site-packages/tornado/iostream.py", line 311, in wrapper
        callback(*args)
      File "/usr/lib/python2.7/site-packages/tornado/httpserver.py", line 268, in _on_headers
        self.request_callback(self._request)
      File "/usr/lib/python2.7/site-packages/tornado/web.py", line 1395, in __call__
        handler = spec.handler_class(self, request, **spec.kwargs)
      File "./gateone.py", line 893, in __init__
        WebSocketHandler.__init__(self, application, request, **kwargs)
      File "/usr/lib/python2.7/site-packages/tornado/websocket.py", line 81, in __init__
        **kwargs)
      File "/usr/lib/python2.7/site-packages/tornado/web.py", line 131, in __init__
        self.initialize(**kwargs)
      File "./gateone.py", line 989, in initialize
        instance.initialize()
      File "/opt/gateone/applications/terminal/app_terminal.py", line 380, in initialize
        imported = load_modules(self.plugins['py'])
      File "/opt/gateone/utils.py", line 979, in load_modules
        imported = __import__(module, None, None, [''])
      File "/opt/gateone/applications/terminal/plugins/html/html.py", line 49, in <module>
        from termio import terminal
    ImportError: cannot import name terminal
[E 130304 21:59:40 ioloop:435] Exception in callback <tornado.stack_context._StackContextWrapper object at 0x197a208>
    Traceback (most recent call last):
      File "/usr/lib/python2.7/site-packages/tornado/ioloop.py", line 421, in _run_callback
        callback()
      File "/usr/lib/python2.7/site-packages/tornado/iostream.py", line 311, in wrapper
        callback(*args)
      File "/usr/lib/python2.7/site-packages/tornado/httpserver.py", line 268, in _on_headers
        self.request_callback(self._request)
      File "/usr/lib/python2.7/site-packages/tornado/web.py", line 1395, in __call__
        handler = spec.handler_class(self, request, **spec.kwargs)
      File "./gateone.py", line 893, in __init__
        WebSocketHandler.__init__(self, application, request, **kwargs)
      File "/usr/lib/python2.7/site-packages/tornado/websocket.py", line 81, in __init__
        **kwargs)
      File "/usr/lib/python2.7/site-packages/tornado/web.py", line 131, in __init__
        self.initialize(**kwargs)
      File "./gateone.py", line 989, in initialize
        instance.initialize()
      File "/opt/gateone/applications/terminal/app_terminal.py", line 380, in initialize
        imported = load_modules(self.plugins['py'])
      File "/opt/gateone/utils.py", line 979, in load_modules
        imported = __import__(module, None, None, [''])
      File "/opt/gateone/applications/terminal/plugins/html/html.py", line 49, in <module>
        from termio import terminal
    ImportError: cannot import name terminal
[E 130304 21:59:40 iostream:314] Uncaught exception, closing connection.
    Traceback (most recent call last):
      File "/usr/lib/python2.7/site-packages/tornado/iostream.py", line 311, in wrapper
        callback(*args)
      File "/usr/lib/python2.7/site-packages/tornado/websocket.py", line 226, in on_connection_close
        if self.ws_connection:
    AttributeError: 'ApplicationWebSocket' object has no attribute 'ws_connection'
[E 130304 21:59:40 ioloop:435] Exception in callback <tornado.stack_context._StackContextWrapper object at 0x197a158>
    Traceback (most recent call last):
      File "/usr/lib/python2.7/site-packages/tornado/ioloop.py", line 421, in _run_callback
        callback()
      File "/usr/lib/python2.7/site-packages/tornado/iostream.py", line 311, in wrapper
        callback(*args)
      File "/usr/lib/python2.7/site-packages/tornado/websocket.py", line 226, in on_connection_close
        if self.ws_connection:
    AttributeError: 'ApplicationWebSocket' object has no attribute 'ws_connection'
^C[I 130304 21:59:43 gateone:3523] Caught KeyboardInterrupt.  Killing sessions...
[I 130304 21:59:43 gateone:3527] pid file removed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment