Install Play 1.7.1 on Windows

47 Views Asked by At

I've downloaded in C:\soft...

  • Java 8 (jdk-1.8.401)
  • Python (python-3.12.2-amd64)
  • git (v2)
  • play (play-1.7.1 imposed version)

I work on Windows (because of the migration that I have to do, of an old application).

When I execute on git

$ play

This error appears :

/c/soft/play/play: line 5: from: command not found
/c/soft/play/play: line 6: import: command not found
/c/soft/play/play: line 7: import: command not found
/c/soft/play/play: line 8: import: command not found
/c/soft/play/play: line 9: import: command not found
/c/soft/play/play: line 11: syntax error near unexpected token `os.path.join'
/c/soft/play/play: line 11: `sys.path.append(os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])), 'framework', 'pym'))'

which corresponds to

 1
 2  # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 3  # Play command line script www.playframework.com/
 4  
 5  from __future__ import print_function
 6  import sys
 7  import os
 8  import os.path
 9  import re
10
11  sys.path.append(os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])), 'framework', 'pym'))
12  
13  from play.cmdloader import CommandLoader
14  from play.application import PlayApplication
15  from play.utils import *

When I run play in a simple terminal, I get the error on another .py file:

Traceback (most recent call last):
   File "C:\soft\play\play", line 13, in <module>
     from play.cmdloader import CommandLoader
   File "C:\soft\play\framework\pym\play\cmdloader.py", line 2, in <module>
     imp import
ModuleNotFoundError: No module named 'imp'

So, it's seems to be a python problem. But what can I do if the .py files don't exist in the .zip distribution I download from the site?

This is not surprising since none of these commands are found in play\framework\pym\play\commands. But then how do I use command line project creation if the basic play script doesn't work?

Thank's for your help.

I tried with different versions of the different elements and tried to follow the installation process from the play framework installation guide. I'd like to know if I missed a step in the installation process.

1

There are 1 best solutions below

1
Ourse blanche On

It's like versions 1.7 (1.7.0 and 1.7.1) don't work for Windows (I know 1.7.1 works on Linux). I took play version 1.6.0 and was able to generate a new project.