Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Inability to start PyScrabble server on Linux

Help
Zoltan
2006-10-28
2013-04-16
  • Zoltan
    Zoltan
    2006-10-28

    Hi,

    I am trying to start PyScrabble server on Linux OS (Mandriva 2007.0 distribution). I have downloaded pyscrabble-1.4.1.src.zip and installed it with "python setup.py install". However, after I try running "/usr/bin/server_console.py", I get the following error:

    ------------------ 8< ------------------
    Traceback (most recent call last):
      File "/usr/bin/server_console.py", line 8, in ?
        from pyscrabble.net.server import ScrabbleServerFactory
      File "/usr/bin/pyscrabble.py", line 4, in ?
        gtk2reactor.install()
      File "/usr/lib/python2.4/site-packages/twisted/internet/gtk2reactor.py", line 270, in install
        installReactor(reactor)
      File "/usr/lib/python2.4/site-packages/twisted/internet/main.py", line 23, in installReactor
        assert not sys.modules.has_key('twisted.internet.reactor'), \ AssertionError: reactor already installed
    ------------------ 8< ------------------

    Obviously there is a problem with Twisted Python error handling. For that, I asked for help on its mailing list. Hence, I edited "/usr/bin/pyscrabble.py" and commented out line "gtk2reactor.install()" hoping that there's no need to install an already installed reactor :-) However, after starting "pyscrabble.py" again, I get new error:

    ------------------ 8< ------------------
    Traceback (most recent call last):
      File "/usr/bin/pyscrabble.py", line 8, in ?
        from pyscrabble.constants import LOCALE_DIR,LOCALE_DOMAIN,CONFIG_DIR
      File "/usr/bin/pyscrabble.py", line 8, in ?
        from pyscrabble.constants import LOCALE_DIR,LOCALE_DOMAIN,CONFIG_DIR
    ImportError: No module named constants
    ------------------ 8< ------------------

    However, file "constants.py" is installed in "/usr/lib/python2.4/site-packages/pyscrabble/", compiled into .pyc, with permissions 644. There I am not sure what is wrong and why pyscrabble.py does not find pyscrabble.constants.

    Here is my configuration:

    OS: Linux (kernel 2.6.17-5mdv, glibc 2.4)
    Python: 2.4.3
    Python Twisted: 2.4.0
    Nevow: 0.9.0
    PYTHONHOME: /usr/lib/python2.4
    PYTHONPATH: /usr/lib/python2.4:/usr/lib/python2.4/lib-dynload:/usr/lib/python2.4/site-packages:/usr/lib/python2.4/site-packages/twisted

    Please let me know what I did wrong.

    If more information is required, I'll gladly provide it.

    Thanks in advance,
    Zoltan

     
    • Kevin Conaway
      Kevin Conaway
      2006-10-30

      Hi Zoltan,

      You shouldn't comment out the 'gtk2reactor.install()' line or any others for that matter.

      When you start the server_console script, it shouldn't have anything to do with the pyscrabble.py script or the gtk2reactor, so I'm not sure why you're getting that error.  Perhaps you could try to download the zip file and just run 'python server_console.py' from that directory?

      Thanks,

      Kevin

       
    • Zoltan
      Zoltan
      2006-10-31

      Hi Kevin,

      First, thanks a lot for your help! I followed your advice with regards to unZIPping source archive of PyScrabble and here are my results (I run Mandriva Linux 2007.0):

      - Case 1: Unzip pyscrabble-1.4.1-src.zip, run "python setup.py build ;  python setup.py install" - not good.

      If my ${PYTHONHOME} environment variable is set to "/usr/lib/python2.4" (where my Python is really installed), then I get error from installer "Invalid Python installation". It assumes Makefile is in "/usr/lib/python2.4/lib/python2.4/config", when in fact it is in "/usr/lib/python2.4/config" (where it should be).
      In that case build process and installation process run OK.
      PyScrabble files are installed under "/usr/lib/python2.4/lib/python2.4/site-packages/pyscrabble", which is wrong. Setting ${PYTHONHOME} to just "/usr" corrects the installation path problem.
      Files "server_console.py" and "pyscrabble.py" go to "/usr/bin" . However, running them from there gives me error "reactor already installed" which I already complained about. I have no idea why it happens.

      I tried adding "." to my ${PYTHONHOME}, but it does not seem to matter. Also, a minor thign that seems to help is running "dos2unix" command on all Python files. Without it, issuing " ./server_console.py" gives error " : no such file or directory".

      - Case 2: Unzip pyscrabble-1.4.1-src.zip, then just _move_ PyScrabble directory to ${PYTHONHOME}/site-packages - good.

      If I do not install PyScrabble, but just move its directory to ${PYTHONHOME}/site-packages/pyscrabble (so, neither building nor installing!) and run "server_console.py" or "pyscrabble.py" _from_there_, then everything works. No error about already installed reactor. Therefore, I made a small shell script under /usr/local/bin that just changes directory to where pyscrabble.py is and starts it. Server starts OK as well.

      I would like to hear experiences from other Linux users. It is possible, however, that I did something terribly wrong, so I could not install PyScrabble properly.

      As someone in some other thread pointed out, possibility of registering to non-public PyScrabble server would be REALLY nice.

      Kevin, please let me know if you need more information about my installation of PyScrabble - and thanks for a great program!

      Regards,
      Zoltan

       
      • Kevin Conaway
        Kevin Conaway
        2006-10-31

        Hi Zoltan,

        Thanks for hanging in there.  I promise that the next release will include the ability to use the register functionality on non-public servers.  Is there any particular reason you don't want to play on the public server though?

        Regarding the install, you shouldn't need to fiddle with $PYTHONHOME, the interpreter knows where it is.  I'm sad to say that the install is broken at the moment, mostly due to poor planning on my part.

        It basically boils down to a python path conflict between the actual pyscrabble code package in $PYTHONHOME/lib/site-packages and the pyscrabble.py script in /usr/local/bin.  I hope to have this fixed in the next version as well.

        If you're running straight from the zip file, you shouldn't need to put it in $PYTHONHOME/lib/site-packages or anywhere else, you can play it where it lies, so to speak.  E.g.:

        1.) Unzip pyscrabble-<version<.zip to ~
        2.) cd ~/pyscrabble-<version>
        3.) python server_console.py

        Please let me know if you have other issues.  Thanks for playing!

        Kevin

         
    • Zoltan
      Zoltan
      2006-10-31

      Hi Kevin,

      Thanks again for quick email! First, I like having things run on my computer so that I can fiddle and experiment with various options, configurations etc. By the way, if Pyscrabble server is included, why not using it? :-) However, the main reason is that I would like to make Pyscrabble understand Serbian language, both in localization and in game. Hence, I need server on my computer to play with.

      As for putting Pyscrabble in $PYTHONHOME/site-packages ... well, I like my programs to be neat and tidy and to reside where they should. :-)

      I do not have big issues at the moment - I wrote a little SysV style shell script for starting/stopping the server. I would also like to tweak server_console.py a bit, mainly to adjust it better to Linux environment. Of course, in true spirit of Open Source, I'll submit patches :-)

      And naturally I'll write here if I have further questions.

       
      • Kevin Conaway
        Kevin Conaway
        2006-10-31

        Hi Zoltan,

        I'd be happy to get your help adding support for a Serbian translation.  Its a 3 step process:

        1.) I need a dictionary of serbian words
        2.) You would need to eidt a translation file which i would send you.  Its basically a template with the english phrases listed, you would then add the corresponding Serbian translation.
        3.) I would need to find the proper scores for all the letters in the Serbian(?) alphabet.  Is it listed here? http://en.wikipedia.org/wiki/Scrabble_letter_distributions

        None of this requires code changes.

        Let me know,

        Kevin

         
    • Dimi
      Dimi
      2007-05-07

      I just downloaded pyscrabble-1.6.2-src.zip, unziped it and tried python setup.py install, but got this error:
      $ python setup.py install
      Traceback (most recent call last):
        File "setup.py", line 10, in ?
          import pkg_resources
      ImportError: No module named pkg_resources

      I have installed all required packages.
      I'd like to install PyScrabbel on my testing-/webserver, because I'm invloved with a website that would like to host there own games, including Scrabble.

      I've also sent an e-mail about translating to Dutch.

       
    • It seems that PyScrabble doesn't like working on Gentoo. [I wrote an ebuild because I don't like having Python applications lying around my $HOME.]

      aphrael@kitsune ~ $ pyscrabble-main.py
      Traceback (most recent call last):
        File "/usr/bin/pyscrabble-main.py", line 12, in ?
          l = manager.LocaleManager()
        File "/usr/lib/python2.4/site-packages/pyscrabble/manager.py", line 418, in __init__
          self.loadLocales()
        File "/usr/lib/python2.4/site-packages/pyscrabble/manager.py", line 435, in loadLocales
          self.setLocale()
        File "/usr/lib/python2.4/site-packages/pyscrabble/manager.py", line 441, in setLocale
          x = OptionManager()
        File "/usr/lib/python2.4/site-packages/pyscrabble/manager.py", line 161, in __init__
          self.loadOptions()
        File "/usr/lib/python2.4/site-packages/pyscrabble/manager.py", line 170, in loadOptions
          dist.ensure_config_dir( r["config"].path )
        File "/usr/lib/python2.4/site-packages/pyscrabble/dist.py", line 86, in ensure_config_dir
          os.makedirs(dir)
        File "/usr/lib/python2.4/os.py", line 159, in makedirs
          mkdir(name, mode)
      OSError: [Errno 13] Permission denied: '/usr/share/pyscrabble/config'

      is the relevant output.

      Also, a note: I am told that you can use os.path.expanduser() to find out what the user's $HOME is for the purposes of configuration. The only downside to that is that it doesn't work on Windows.

       
      • Kevin Conaway
        Kevin Conaway
        2007-06-04

        Run python setup.py install to install the data into /usr/share.  You can also run python setup.py help to customize the installation location for the data.

        Kevin

         
    • Hi,

      I've just bought an acer aspire one. Linux is completely new to me.

      I downloaded the pyscrabble-1.6.2-src zip file.

      I unzipped the file, changed to the relevant directory, and entered the command: python server_console.py

      I got the error message: "No module named pkg_resources", so I installed setuptools.

      On the second try, I got the error message: "No module named twisted.internet", so I installed python-twisted-web.

      On the third try, I got the error message: "No module named nevow", so I installed python-nevow

      On the last try, I got the error message: "No module named pyscrabble"

      Seems like I'm going around in circles. Any ideas about what I should do next? Or is pyscrabble not designed for this machine?

      Thanks!

      David

       
  • I've followed all of this too and have gotten the same circles everyone else is getting and I'm running on Debian/Lenny..
    Kevin obviously you're missing something big for most Linux users. I wish I had the answers, but I'm an old hunt n peck hack who has forgotten more than he ever learned and at this point my brain is only screaming to give up, but that's not who I am..
    Any ideas when you might have this issue fixed?

    Thanks,
    Marty…old, old dude.

     
  • I have to tell you.. I'm used to chasing down missing dependencies and so on, but at my age I get a bit tired of it and this thing is asking everyone in essence to completely learn python language just to play a game of scrabble.
    You really need to head back to the drawing board on this one my friend. This has become a push button world, not a wait to learn a new language to play a game world.
    I'm not trying to give you a hard time, but the vast majority of the programs I run these days are complete and ready to go out of the box. This isn't even close or at least not close for Linux users.
    I'll give it a shot some other time, but for now it's only taking up space on my hard drive and I'm to old to start learning a program language from scratch.

    Best of luck on this..
    Marty

     
  • Kevin Conaway
    Kevin Conaway
    2010-05-29

    Hi Marty,

    Sorry you wasted your time.  As it says both on the main page and the downloads page, I haven't worked on this project for over 3 years.  I simply don't have the time or resources to do so anymore.

    Sincerely,

    Kevin Conaway