Castlia 3.3 + omnetpp 4.6 on windows 7- permission denied - windows

I have compiled both castalia and omnet and everything was right but
when running simulation using command line I got this error:
/c/Castalia/Simulations/radioTest$ ../../bin/Castalia
bash: ../../bin/Castalia: /usr/bin/python: bad interpreter: Permission denied
I installed python 2.6 in usr/bin path. but still has that error.
I tried #! usr/bin/env, but again I got same error.
how i can solve this problem?

In general Castalia is not supported under Windows, and any success people have running it is based on homebrews (custom solutions based on their configuration). The more reliable solution would be to run Ubuntu (perhaps on a virtual machine in Windows). Mac OS X works fine too.
Seeing your bash tag, I am not sure how you got to run bash on Windows (Cygwin?), but if you have a bash shell you can run which python to see where python resides on your system. If it's something other than /usr/bin/python then you can try changing the shebang line to the correct location. Or you can try #!/usr/bin/env python (notice the python executable after the path).
Also make sure you have the permission to run Python as the user you are logged in! How would you run any python script from command line?
Finally it is recommended that you have Python 2.7 installed, but it may run fine with 2.6 too.

Related

QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-aadithyasb'

I am using WSL in Windows 10. I have this warning getting displayed when I run a python file:
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-aadithyasb'
I can understand that the XDG_RUNTIME_DIR environment variable is not set and it is creating its own path /tmp/runtime-aadithyasb
I am getting this warning from the moment I installed Xserver for Windows using VcXsrv to open plots when the file is ran.
Wy question is should I add this XDG_RUNTIME_DIR environment variable in windows or is there any method to set a directory under the variable for Ubuntu used under WSL?
I was able to find what the caused the terminal to issue the warning. Yet I am posting this so that it would be useful for people someday who are new to using WSL like me. This link helped me to solve it and gave me a better insight on how linux works under a WSL:
https://dev.to/winebaths/getting-up-and-running-with-the-windows-subsystem-for-linux-8oc
To solve this issue I just added the below lines to my .bashrc file:
export XDG_RUNTIME_DIR=/some/directory/you/specify
export RUNLEVEL=3
After this just run the command
source .bashrc
Now the warning will not keep displaying in your terminal.
Last week, I had a similar error installing a Orange3's library
My environment is:
Ubuntu 18.04
python3 (3.6)
orange3 (3.27.1)
pyQt5 (5.15)
The trouble was:
When I tried to compile orange3 in a command line:
sudo python3 -m Orange.canvas
The system showed:
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'/home/rene/.local/lib/python3.6/site-packages/orangewidget/widget.py:287: RuntimeWarning: subclassing of widget classes is deprecated and will be disabled in the future.Extract code from OWBaseVectorizer or explicitly open it.RuntimeWarning)
Fault segment
The trouble for this system error was:
Orange3 (3.27.1) is not compatible with PyQt5 (5.15).
However, PyQtWebEngine will be compatible with a PyQt5 upper version to 5.12
I searched in internet the different versions of rhis library and I installed a version between 5.12 and 5.15
Thus, I did I had a downgrade of the PyQt5's library to 5.13.1:
pip3 install PyQt5 == 5.13.1 --use-feature = 2020-resolver
As result of this:
Orange3 compile again
I had this problem too just today. What I did was that I opened up PowerShell and killed Ubuntu WSL with the following command:
wsl.exe --shutdown
After that, I opened VcXsrv with its shortcut called "XLaunch" and made sure to tick off "Disable access control".

Can't get pip working with psychopy install

I am very new to python and plan to use psychopy quite a lot. I am on a work computer but have full admin rights.
Psychopy came with python version 2.7.11 and includes setuptools already.
I am trying to install the selenium module, but having trouble getting pip to work at all.
In cmd, it is recognising the 'python' command, so I know python is in my path.
I get the message "can't open file 'pip': [Errno2] No such file or directory" from:
python pip install selenium
I get " 'pip' is not recognised as an internal or external command" from:
pip install selenium
When I change directory to where pip is located, I get:
Fatal error in launcher: Unable to create process using '"'
Using pip2 makes no difference.
It seems a simple thing but where am I going wrong with this?!
I never really got to the bottom of this, but this is what I found out and here are the commands that worked for me in Windows. Be aware that I am far from expert!
To run python scripts (*.py) from command line (cmd) then C:\PsychoPy2 and C:\PsychoPy2\DLLs need to be in path. ('Path' contains directories or file extensions that can be more globally accessed, i.e. do not require you to change the prompt to the relevant directories first).
To check, open cmd and either type echo %PATH% or just type python. (If python starts, the line will say >>>. You can exit by typing quit())
To add to path, get properties of computer, then advanced system settings, then environment variables.
To check pip.exe (a sort of installation wizard) is installed, either search for the file, or check C:\PsychoPy2\Scripts for it. This may also need to be in path.
To reinstall the latest versions of pip and setup tools, I went to cmd and typed:
python -m pip install -U pip setuptools
If the same code did not work for other modules (which in my case was due to network access), then I downloaded the wheel file (*.whl) for that module (from their website) and ran the following code:
python -m pip install c:/modulename.whl
These may not be the correct ways of doing things, but they worked for me when I couldn't get other ways to work!
I've just had the exact same issue with the pip install, and a conflict with PsychoPy installations. I think it's because python automatically wants to call on the path that's been set by Psychopy, so it can't get to the 'pip' folders that for me, remain in a temporary/hidden file. This wasn't intuitive for me - on any machine without psychopy python just 'works' when you download it.

unable to run 'aws' from cygwin

I'm using cygwin installed on Windows 10 and trying to access awscli from it.
I used pip install awscli to install awscli. This installed awscli. I then tried to run only aws to see if it is installed and I get the following error:
-bash: /cygdrive/c/Program Files/Anaconda2/Scripts/aws: C:\Program: bad interpreter: No such file or directory
I'm not sure why this is happening. Any help in this regard would be highly apreciated.
This is still an issue even with the latest version of AWS cli. So after some trial and error I found a pretty good workaround that will not make you switch your favorite shell.
First, make sure python is on your PATH. That is from anywhere in the system you can just run python and it work.
Find the aws script and open it for editing (for me it was located in c:\Program Files\Python36\Scripts\aws) and change the hashbang (that would be the first line in the script) to #!python.exe. For me it was set to #!c:\Program Files\Python36\python.exe. That space in the middle of Program Files caused the issue when that path got converted to Linux like path. Changing it to #!python.exe sidesteps the issue.
When you update AWS cli, repeat the workaround.
PS. You could also avoid this issue by installing python somewhere in a folder without spaces in path. That requires to reconfigure your system, so I did not do that myself.
I would install the standard python and ensure it is coming up first in your path with which python and which pip. Path issues like this are due to mixing and matching executables targeting different platforms in my experience. Certain commands do not implement functionality to convert paths from Windows to Linux and back (it appears your specific commands are failing on spaces).
Since you say you are on Windows 10, if you have the anniversary edition, I would recommend Windows Subsystem for Linux over cygwin. You will likely see less Windows issues on WSL since it uses the exact same ubuntu packages you would use on Linux instead of the cygwin port and maps them low level to the NT Kernel.
The Problem comes from "Program Files" having a space. This is something that is related to cygwin (I encountered the same error with git bash on windows). In a script I had something like this:
#!/c/Program Files/some_program/executable.exe
Escaping the space with a backslash or using quotes didn't work.
The solution is to use the DOS' short filename:
Progra~1 for "Program Files"
Progra~2 for "Program Files (x86)"
So my line would turn into:
#!/c/Progra~1/some_program/executable.exe
In Windows:
cd .. to go to home directory which shows pwd as /.
Now, cd to /cygdrive/c/Program\ Files/Anaconda2/Scripts
Now, run: python aws configure
Example:
user#user /cygdrive/c/Program Files/Anaconda2/Scripts
$python aws configure

How to use gitk with msys2?

I am using MSYS2 in Windows 10. git works fine, however gitk gives the error:
/usr/bin/gitk: line 3: exec: wish: not found
Some googling suggested this may be because TK is not installed, however I tried:
pacman -S tk
which gave the error:
error: target not found: tk
How do I get gitk to work in this environment?
Try running the 64-bit MinGW shell (one of the three environments provided by MSYS2), installing the package mingw-w64-x86_64-tk, and then running gitk.
Gitk works on my system, and wish is provided /mingw64/bin/wish.exe.
I confirm C:\prgs\git\PortableGit-2.7.0-64-bit\cmd\gitk.exe works just fine.
Make sure you are executing it from a regular CMD session or from C:\prgs\git\PortableGit-2.7.0-64-bit\git-bash.exe
I would not try and run it from a Cygwin session.

Using Google App Engine SDK with Python 2.7 on Mac OS X 10.6

I need to run Python 2.7 on my Mac Snow Leopard, which has Python 2.6 installed. According to this answer, running the Python 2.7 mpkg installer from Python.org should get me there.
The reason I need to do this is that I'm trying to run the Google App Engine SDK for the Python 2.7 runtime.
After installing Python 2.7, I'm still getting the following warning in my GAE server log:
Warning: You are using a Python runtime (2.6) that is older than the
production runtime environment (2.7).
What else must I do to get the GAE SDK to recognize the new Python version?
EDIT 2:
Running:
$ sudo find / -name python2.7
I get:
/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
/usr/local/bin/python2.7
According to the answers I went into GoogleAppLauncher -> Preferences and set the Python path to each of these, and each time I get the exact same error.
Running dev_appserver with the following flags:
--admin_console_server= --port=8081 Python command: /Library/Frameworks/Python.framework/Versions/2.7 2011-11-14
16:12:24.726 GoogleAppEngineLauncher[57590:203] *** NSTask: Task
create for path '/Library/Frameworks/Python.framework/Versions/2.7'
failed: 22, "Invalid argument". Terminating temporary process.
Another Wierd thing is, it always tries to resolve to the same path, no matter which of those I plug in; It always reverts to /Library/Frameworks/Python.framework/Versions/2.7
EDIT 3:
OK, after entering the paths into the prefs field repeatedly, I finally just cleared it out, and somehow it's now pointing to the right place:
Running dev_appserver with the following flags:
--admin_console_server= --port=8081
Python command: /usr/local/bin/python2.7
Open the GAE launcher preferences and set the Python Path option to the fresh installed Python 2.7, in your case /usr/local/bin/python2.7 .
Came across this question looking for a solution to the same dilemma regarding Mac, GAE and Python.
One comment I would like to make regarding setting the Python path using GAE Preferences. I notice you mention that you had a problem setting the Python path using the Preferences. I discovered that after editing the path, you have to press Enter. Otherwise, the path doesn't get updated. This might explain the weirdness you were mentioning when trying to edit the path field.
I installed python 2.7.x from macports. I see this:
$ python --version
Python 2.7.2
$ which python
/opt/local/bin/python
So, in the preferences for GoogleAppEngineLauncher.app I set the python path to:
/opt/local/bin/python
In the console log, I see this:
*** Running dev_appserver with the following flags:
--admin_console_server= --port=8081
Python command: /opt/local/bin/python
I still see some errors about libraries, in particular Can't open zipfile...setuptools but simple stuff at least seems to work.
Good luck!
I am not sure if it helps, but instead of using the binaries from Python, I used MacPorts http://www.macports.org/ and installed the Python 2.7 runtime:
sudo port install python27

Resources