GRASS GIS: r.diversity - grass

I lauched the script r.diveristy.py in GRASS GIS 6.4.3 from launch script option in file menu. After that the r.diversity GUI appeared in which I gave the input and the output file name and then run. The following error message is displayed:
C:\PROGRA~1\QGISCH~1\bin\python.exe: can't open file
'r.diversity.py': [Errno 2] No such File or directory.
How can I solve the problem?

GRASS GIS 6.4.3 is rather old and there were problems with running Python scripts on MS Windows (r.diversity is a Python script). Install the latest release (currently 7.0.4) and install the r.diversity module from Addons again. There was a lot of improvements regarding Python scripts in the 7.0 series.

Related

Build phase in Xcode 13.3 started failing

I have a build phase that calls some python scripts.
This has been working fine for well over 2 years, but after recently updating to Xcode 13.3 it now fails.
the error I started receiving is:
/Users/me/Library/Developer/Xcode/DerivedData/MyApp-fsowouspdsdjjzfmlfafizjbkcae/Build/Intermediates.noindex/ArchiveIntermediates/MyApp/IntermediateBuildFilesPath/MyApp.build/Release-iphoneos/MyApp.build/Script-9002D8C42166BC850081D43D.sh: line 6: python: command not found
Command PhaseScriptExecution failed with a nonzero exit code
At a glance, it looks like xcode is attempting to run the script on the simulator instead of running in the local project directory.
python --version:
Python 3.8.3
I am wondering if there is some new configuration that I am unaware of for new xcode versions?
EDIT:
when i run the the lines in the script in my terminal, they run just fine.
You have installed Python 3 somehow (brew, perhaps), and it is in your PATH. That is why, when you say python, it is found.
But that same Python is not in Xcode's PATH! And it never has been. You've never noticed this, and you've never needed to notice it, because Xcode has always used the system Python, which was located in /SystemLibraryFrameworks. You and Xcode were probably using different Python versions (the system version stopped at 2.7), but this didn't matter.
But now (Monterey 12.3), it isn't. There is now no Python in Xcode's PATH. Thus, when your script says python plain and simple, it isn't found. You can fix this by using a complete path in your scripts that specifies where your Python is. You can find this out by saying which python.
So, Xcode seems to bundles its' own versions of python and python 3. It does not use the system version, so changes to Monteray 12.3 would not affect this.
Since that is the case, the correct solution is changing python to python3 since it looks like an Xcode update dropped python2.7 to parallel the OS dropping it later. I had to also update my python file to ensure compatibility.

Modelio 4.0 Installation on Mac OS

I'm following the automatic procedure (i.e. script) described on https://www.modelio.org/forum/8-installation/3962-running-modelio-on-a-macos-x-workstation.html
Modelio 4.0 is installed in the same folder as the script.sh file.
When I type: bash fixModelio40.sh, the terminal shows the following error message:
"fixModelio40.sh: fixModelio40.sh: cannot execute binary file"
When typing "type fixModelio40.sh", the output is: "ixModelio40.sh: MacOS Alias file".
Can someone help me out?
Thanks so much,
Rob
Rob, this way is only necessary when you don't have installed Java 8 on your machine. If you don't have it, simply you can install the Amazon Corretto Java 8 and again execute Modelio. In this video, you can see how to do it

build a .exe for Windows from a python 3 script importing theano with pyinstaller

edit September, 2, 2017, 1pm
I eventually managed to build a .exe with pyinstaller after many episodes.
Unfortunately I failed to deal with the ‘theano’ module (that is required in my case by the ‘pymc3’ module) and I had to modify the .py files and give up part of the application. My description below has two aims: first it may help; second could anyone help me building a .exe for windows 7+, with the ‘theano’ module ?
reminder: My python 3 script opens a simple GUI made with Qt Designer in a ‘.ui’ file and imports pyqtgraph (with pyqt5), pymc3 (and thus theano that is required by pymc3), scipy, numpy, os, sys. It will be distributed on machines with Windows 7+. I tried to build a ‘.exe’ with py2exe, cx_freeze, pynsist and pyinstaller (I opened and updated several posts, this one is still opened: build a .exe for Windows from a python 3 script importing pyqtgraph and opening a GUI) but all failed. My best result (with pyinstaller) is described below after I had to give up theano.
the command line I ended up with is: pyinstaller —noupx —onefile —add-data “toto.ui;.” toto.py. But strangely:
1 the qt designer file ‘toto.ui’ is not included and must be distributed together with the .exe. Otherwise there is an error message when running the .exe saying toto.ui not found;
2 the ‘platforms’ directory from the ‘Library/plugin’ directory of the python environment must also be distributed along with the .exe. Otherwise there is an error message when running the .exe ‘this application has failed to start because it could not find the qt
platform plugin windows’ (but there is no error message from pyinstaller when building !)
3 the .exe is 220MB big ! it seems pyinstaller includes a bunch of useless things during the building.
pyqtgraph problem:
At first sight, the module ‘pyqtgraph’ seems to be incompatible with pyinstaller. Indeed, when the python code imports pyqtgraph, pyinstaller gives a SyntaxError: ‘yield’ inside async function. This seems to me very awkward (is this a bug in pyinstaller ?) because I had the impression from forums this is related to asynchronous generators that are only compatible with python 3.6, while pyinstaller works only with python 3.5- that is not compatible with asynchronous generators… so why does pyinstaller use this ? It turns out this bug-like feature is disabled in a new version of pyinstaller that is not released (and so not installed by default): pip install git+https://github.com/pyinstaller/pyinstaller, thanks to 9dogs (in comments). I also found it may help to explicitly write os.environ[‘PYQTGRAPH_QT_LIB'] = 'PyQt5’ or ‘PyQt4’ before importing pyqtgraph in the py file(s)
theano problem:
theano turns out to make several implicit imports that are not detected by pyinstaller. Thus the building looks ok but when running the .exe you get error messages like ‘no module theano.tensor.shared_randomstreams’. Unfortunately I failed to use the '--hidden-import' option of pyinstaller so I added explicitly the imports in the py file(s) (in this example ’import theano.tensor.shared_randomstreams’ ).
But this is not the end: after that, the file ‘…\AppData\Local\Temp_MEI35682\theano\gpuarray\blockgemv.c' is missing, leading to [4128] Failed to execute script. I don’t know what this file is and didn’t find information. I gave up and removed part of the GUI to avoid theano. Can anyone help me using theano with pyinstaller ?

neo4j shell script issue

Windows 7, Neo4j Community Edition - freshly installed.
I'm new to neo4j and I want to run some Cypher commands in a batch. I've read about the neo4j shell, so I tried to run it.
I'm getting the following error regardless of whether I run it from the "command prompt" at the desktop or starting a new cmd session:
neo4jshell
(a bunch of DOS stuff)
D:\AppData\Neo4j\Sports2000>pushd "D:\APPLIC~1\NEO4JC~1.1\bin\..\lib"
The system cannot find the path specified.
followed later in the batch file by:
D:\AppData\Neo4j\Sports2000>java -classpath ;"" -Dapp.name="neo4j-shell" -Dapp.repo="D:\APPLIC~1\NEO4JC~1.1\bin\..\lib" -Dbasedir
="D:\APPLIC~1\NEO4JC~1.1\bin\.." org.neo4j.shell.StartClient
Error: Could not find or load main class org.neo4j.shell.StartClient
Reading the shell command it references to a zip version of Neo4j, and links to the front page of the Neo site which has no reference to a .zip file that I can see.
It looks like this is a packaging issue with my version of Neo4j:
Neo4j Error: Could not find or load main class org.neo4j.shell.StartClient
And upgrading to version 3 hasn't fixed the problem. Installing version 3 and then installing the zip file has gotten me a working powershell prompt.
From the Neo4j desktop app choose "Options", then "Command Prompt", then run Neo4jShell.bat at the command prompt.
See this post for more info.

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

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!

Resources