GAE Go Windows - "Cannot run program", "is not a valid Win32 application" - windows

I've been trying to run a GAE Go project I developed on my Mac on my Windows machine with GoClipse after installing and configuring the appropriate SDKs and so forth. When attempting to run the project, I get this error:
Exception occurred executing command line. Cannot run program
"C:\GoogleAppEngine\dev_appserver.py" (in directory
"D:\Golang\workspace\Project\src\pkg"): CreateProcess
error=193, %1 is not a valid Win32 application
How can I fix that error in order to run my project?

While the below configuration works on the Mac as it has Python installed by default, Windows requires a different configuration.
On Mac the GoClipse External Tools Configuration would be:
Location: /GoogleAppEngine/dev_appserver.py
Working Directory: ${workspace_loc:/Project/src/pkg}
Arguments: .
The Windows configuration should look like:
Location: C:\Python27\Python.exe
Working Directory:
Arguments: C:\GoogleAppEngine\dev_appserver.py "${workspace_loc:/Project/src/pkg}"

Trying to run .py (Which IMO is a Python file?) wont work directly on windows. You will need to install Python and then pass the above filename to Python something like (I don't know Python so don't go by exact syntax, you might need to look around)
python "C:\GoogleAppEngine\dev_appserver.py
The reason it's working on Mac is because Python comes pre-installed on mac as cited here But on windows it doesn't. So you can install Python and add the Python's bin folder to path, and then run above script and it should run fine!

Related

Windows IDE for Haskell

I need to setup a simple and compelling dev environment for small proyects written in Haskell in Windows machines for freshmen.
I have tried several ways to integrate Haskell into VSCode in Windows with no success.
I had a nice setup a few years ago, but I´m finding problems with dependencies recreating that environment:
Editor: Atom
Global binaries build using: stack with ghc-mod hlint stylish-haskell
Atom plugins: language-haskell, ide-haskell, ide-haskell-repl, haskell-ghc-mod
It seems that the "cool" way right now is Language Server Protocol + VScode. ghc-mod seems not to be mantained anymore, Intero has reached EOL, HEI is merging with another project... Having a stable and updated dev environment looks like a moving target.
So, the question is: does anyone have reproducible step-by-step instructions for having VSCode working with Haskell in Windows?
I will test any suggestion in a fresh Windows 10 64bits VM and report the results.
Note: VSCode + Docker container is not an option. Most of the student´s machines have 4GB RAM.
Thanks in advance.
There's a tool called ghcid (not to be confused with ghcide) that, while nowhere near a full-blown IDE, is pretty robust and provides some niceties like re-compiling on save and showing compile errors. It doesn't support go-to-definition though. It has a VSCode plugin.
Here's a possible way of setting up things in Windows:
Download the GHC 8.8.3 binaries for Windows from here.
Download the cabal-install 3.0.0.0 binaries for Windows from here.
Decompress them in some folder.
Add entries to your PATH environment variable so that it has access to the /bin folder of the GHC installation and to the folder containing the cabal executable.
Open a Powershell console.
Run cabal udpate
Run cabal install --install-method=copy --installdir=somefolder ghcid to install the ghcid executable, where "somefolder" is the destination folder. (If the installation fails, try running the command from a Git Bash or Cygwin terminal as a workaround.) Put the destination folder in PATH.
Open (or restart) VSCode and install the "Haskell Syntax Highlighting" and haskell-ghcid plugins.
Go to an example cabal project, use the Ctrl-Shift-P shortcut, and execute the Start ghcid action. The ghcid terminal will appear.
Example of a ghcid session showing an error:
The haskell-ghcid plugin can read a .ghcid file in the project root containing flags that should be passed to the ghcid command.
Extra instructions to set up code formatting:
Install the ormulu formatter by running cabal install ormolu --install-method=copy --installdir=somefolder. Again, make sure that the destination folder in in PATH.
Open (or restart) VSCode and install the ormulu plugin.
Now the "Format Document" and "Format Selection" actions in VSCode will use ormulu.
Another way of installing GHC and getting to ghcid and ormulu could be by using the stack tool, which handles GHC installation by itself.

pycharm swig how to? [windows]

I would require some guidance in regards to installing a module/package in pycharm (free edition). I have to mention that i have not worked with this IDE yet and wanted to try it out on a little project containing smartcards.
When i try to install "pyscard" i get the error that boils down to
error: command 'swig.exe' failed: No such file or directory
People say just install SWIG, which i guessed already ^^.
The issue i have is that i actually have no idea how to... and none of the pages i found has really enlightended me on this issue.
I downloaded the zip "swigwin-3.0.12" but i am at a loss what to do with it now. EDIT: According to the SWIG page this is an already compiled version and i have to somehow make pycharm recognize that the folder it is in contains the swig.exe it requires.
EDIT2: Adding the folder containing the swig.exe to the PATH variable also did not work ... which i thought would be the issue
EDIT3+Answer:
Ok the link in the comments from "wp78de" was correct my problem was that pycharm/pc restart were needed for it to catch the added PATH variable to the swig.exe (for pycharm that is)
Any advice is appriciated.
Envoirment:
Windows 8.1 Pro 64-bit
Pycharm 2017.2.4
Python 3.6
Basically, you just have to add the directory that contains the swig executable the PATH environment variable. You can do it via CMD or the Windows UI.
If you have added swig to your path, you should be able to call it in the command prompt from any directory: open "cmd", and type swig --help" on that prompt.
A restart of PyCharm (or whatever your IDE is) and Windows might be required.

omnet++ installation error in windows 7

I am tring to install omnet++ but it gives me error "windows can not find ",is there anyone can help
I have been trying mingmenv.cmd gives me the same error
it gives as shown below error when I try to install:
First of all, did you unpack the OMNeT Windows installation file with the on-board ZIP tools or another program? Try to use programs like WinRAR or 7-Zip to unpack the OMNeT++ installation, the on-board ZIP tool from Windows 7 might have problems with the MinGW files.
Second, does the path to the OMNeT++ installation contain any spaces or special characters? This might also be the source of errors.
Third, does the message immediately show after you start the mingwenv.cmd or after you start it and try to run ./configure or make to configure and build OMNeT?? Check if no antivirus might block the OMNeT sources / helper programs.
General note: under Windows, you always use the mingwenv.cmd shell to compile OMNeT, the normal Windows command environment does not have the necessary paths or settings for OMNMeT.

How to use lua web sockets on windows?

This answer suggests this library to use web sockets for lua.
The installation guide of the library contains three strings:
$ git clone git://github.com/lipp/lua-websockets.git
$ cd lua-websockets
$ luarocks make rockspecs/lua-websockets-scm-1.rockspec
I don't know what results of the last command should be and how to proceed from executing it to compiling examples. But on my PC it only produces error message
'"C:\Program Files (x86)\LuaRocks\\lua5.1.exe"' is not recognized as
internal or external command, operable program or batch file
in visual studio 2015 developer console.
In regular console it just complains that cl is not recognized
I want to know not only ways of fixing the error, but all actions needed to start communicating with websockets from a lua script on windows with this library or another one.
The script will be run in vm provided by a third party app. I can require external modules from it. I installed luarocks from developer console. There are no other installed lua frameworks/compilers. The system is windows 8.
If you need to run this as the client, then you only need three pieces: lua interpreter, luasocket library, and the lua-websockets module you referenced. The module has other dependencies (luabitop and copas), but those are optional if you just want to try simple sync calls using luasocket. You can compile luasocket libraries yourself (that's what luarocks probably attempted for you to do, but you can also do it from the command line) or find already compiled libraries; for example, see this discussion for details.

Installing python modules in TideSDK

I am trying to install an external dependency into Python for TideSDK. The current module I am trying to install is redis-py.
To install it I tried the following steps:
Open Command Prompt in regular administrative mode
Change directory to the downloaded module of redis-py
Provide the path to the python module used by TideSDK followed by the standard compile and install from source command prompt. The command I used: "C:\Program Files (x8
6)\TideSDK Developer\modules\python\1.3.1-beta\python.exe" setup.py install
The setup looked very promising. The redis-py module with egg file is confirmed to be installed by both the installer with exited with no errors and with a visual check on the directory.
So what gives? The correct files are installed in Lib/site-packages. TideSDK gives me ImportError: No module named redis. Any suggestions?
I solved it for another module: simplejson.
I guess the workaround should work for any module of this kind.
BTW, simplejson may be used to support json, as the actual version (TideSDK 1.3.1-beta) comes with Python 2.5 which doesn't support the standard json module, it comes in Python 2.6 (or higher).
First, the path you are using is for "TideSDK Developer", that's the program to launch and build apps. It happens that "TideSDK Developer" is built using TideSDK, so the structure is the same.
C:\Program Files (x8 6)\TideSDK
Developer\modules\python\1.3.1-beta\python.exe
The path that TideSDK actually uses to launch and compile apps is inside "C:\ProgramData"
In my case, it's:
C:\ProgramData\TideSDK\modules\win32\python\1.3.1-beta\python.exe
So, this is what I did, I ran:
C:\ProgramData\TideSDK\modules\win32\python\1.3.1-beta\python.exe setup.py install
That "installs" the module, but installs it inside "site-packages". So, when I launched the app I got the same error ("no module named simplejson"), I then copied the module from inside "site-packages" to outside.
I copied from:
C:\ProgramData\TideSDK\modules\win32\python\1.3.1-beta\Lib\site-packages\simplejson
to:
C:\ProgramData\TideSDK\modules\win32\python\1.3.1-beta\Lib\simplejson
And that's it. That worked for me.
In summary: Go to ProgramData, install with python and copy the folder installed inside site-packages.

Resources