RSS feed
  • web.py: error: No socket could be created

    This error message most often occurrs when trying to run web.py on an invalid address and port. An example of an invalid address would be example.net, instead of a proper ip address like 98.228.37.242.

    Other Causes:

    Was just trying to get a simple web.py test running:

    import web
     
    urls = (
      '/x', 'X',
    )
     
    class X :
      def GET(self) :
        return 'x'
     
    app = web.application(urls, globals())
    app.run()

    but I kept getting the error:

    error: No socket could be created

    The problem was that due to the way web.py loading works, you need to have the creation and running of the app only occur if this is the main entry point of the program. Otherwise, the class loader in web.py will reload this file again later, and wind up spawning a new server when its intent was simply to load a class:

    if __name__ == '__main__' :
      app = web.application(urls, globals())
      app.run()
  • PiCloud Simulation: OSError: [errno 13] permission denied

    I tried running a PiCloud simulation on Ubuntu 10.04 on linode and got the following error:

    OSError: [errno 13] permission denied

    I found the solution here:

    add the following line to your fstab and reboot:

    none /dev/shm tmpfs rw,nosuid,nodev,noexec 0 0

    If you don't want to reboot, a temporary fix might be:

    sudo chgrp $GROUP /dev/shm
    sudo chmod g+w /dev/shm

    That last part might not be the best way to do it, but it worked for me.

  • ImportError: No module named controllers.index

    Fix: create empty file: appname/appname/controllers/__init__.py

    Anytime I tried to load a page in my pylons app, I received the error message: ImportError: No module named controllers.index I had just deleted all of the .pyc files because I was getting wrong magic number errors, and somehow this problem resulted.