Unable to run Pyschopy - python

I am trying to run Python scripts for a Brain Computer Interface Paradigm that uses Psychopy as GUI to create a visual stimuli. I am using Mac OS and the scripts are tun through the terminal I get the following message:
"This program needs access to the screen. Please run with a
Framework build of python, and only when you are logged in
on the main display of your Mac."
I am using Python 2.7 and latest version of Psychopy (http://www.psychopy.org/).
Please let me know why is this issue coming. Thanks in Advance.

Related

How to run a python program using sourcelair?

I'm trying to run a python program in the online IDE SourceLair. I've written a line of code that simply prints hello, but I am embarrassed to say I can't figure out how to RUN the program.
I have the console, web server, and terminal available on the IDE already pulled up. I just don't know how to start the program. I've tried it on Mac OSX and Chrome OS, and neither work.
I don't know if anyone has experience with this IDE, but I can hope. Thanks!!
Can I ask you why you are using SourceLair?
Well I just figured it out in about 2 mins....its the same as using any other editor for python.
All you have to do is to run it in the terminal. python (nameoffile).py
Antonis from SourceLair here.
In SourceLair, you get a fully featured terminal, plus a web server for running your Python applications.
For simple files, as you correctly found out, all you have to do is save the file and run it through your terminal, using python <your-file.py>.
If you want to run a complete web server, you can check out our server configuration guide here: https://help.sourcelair.com/webserver/configure-your-web-server/
Happy hacking!

How to get Pygame script to run on macOS

I have a rather small Pygame based python script and I just bought a Mac so I'm trying to run my script on here. Everything has been installed correctly (Checking by typing 'import Pygame') into python terminal as-well as running a basic hello world program. However, when I try running this script, IDLE gets brought to the front but nothing happens from there. (The script is supposed to pop-up a new window). Is this a problem with my installations or my code? (Code works on windows setup).
You could try to run the script again on a windows computer to see if you forgot to save some changes or if the file got corrupted somehow. You could also use bootcamp to install Windows on your mac since you could have one windows version on your mac for coding purposes and the regular mac OS for other stuff if you like.
you can execute it by left clicking in your script and select open with python launcher

How to display pygame output on cloud9-vnc?

So I'm playing with python3 on Cloud9, got interested in trying pygame and found a recommendation to install cloud9-vnc for a desktop display. Got both of those things to work, but not in tandem. I'm a rather newbish with Linux and VNC, so I'm stuck at the moment. Any chance I can get pygame output on a VNC desktop?
What I have so far is that I've installed pygame using this and cloud9-vnc using this. Pygame import and commands run smoothly (both in terminal and script) and when I run the script with c9vnc I get the link to a VNC desktop. However, the desktop is clear, apart from Ubuntu logo.
The program doesn't actually seems to be running, considering that it doesn't display the text to be printed
In fact, it seems that it's not even started to run.
However, inside the VNC desktop I have the access to complete cloud9 workspace, including installed pygame, which does work, albeit a bit more clunky, compared to cloud9's interface.
So what I want to ask is is there a way for me to write and run a code on cloud9's default interface that would directly display the output in VNC's desktop, with little to no additional interaction?

"Python runtime could not be located" for py2app standalone build

I'm attempting to turn a short Python program that I wrote into an easily-distributable application file for OS X, using py2app. I made it through the py2app tutorial, but when I click on my application file the following dialogue is shown:
A Python runtime not could be located. You may need to install a
framework build of Python, or edit the PyRuntimeLocations array in
this application's Info.plist file.
I'm not sure whether this is helpful, but clicking "Open Console" from that dialogue shows the following errors:
LaunchServices: Could not store lsd-identifiers file at /private/var/db/lsd/com.apple.lsdschemes.plist
launchservicesd[83]: SecTaskLoadEntitlements failed error=22
appleeventsd[53]: SecTaskLoadEntitlements failed error=22 11/27/16 7:29:19.787 PM
sharedfilelistd[307]: SecTaskLoadEntitlements failed error=22
I know that if py2app uses a "system" version of Python to produce an app, it won't include that Python in the distribution. However, entering $ which python in the terminal directs me to my anaconda installation, so that doesn't seem to be the issue.
This is my first time attempting to create a piece of software, so apologies in advance for any obvious missteps. Any help would be greatly appreciated, as I've been banging my head on this all day.

How do I launch python code like a stand-alone app with a simple double click?

So I'm new to coding and I'm currently learning Python with the intention of creating a basic GUI for running test software and automating equipment. What I can't seem to understand at this stage is how I will go about launching my python code. As it stands now I run my basic code from the terminal or IDE (I'm on Mac OS X), but when I have a working program with a GUI I want myself and others to be able to just click and run the program as you would any other application. Can I make it so someone could just double click the .py file and the app would run and no code or terminal would be visible, just the GUI? Or do I have to make some sort of executable file for each OS? Worth noting that eventually the final product will be running on windows xp.

Categories

Resources