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

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.

Related

Trying to turn my python code into an app so it is easily shareable

I created a python code which creates a horse racing card betting game. I would like to share this game with my friends, who have macs, who do not have python or know anything about coding so they can play it. I have tried using pyinstaller to convert the file into a stand alone executable app. I used the command
pyinstaller --windowed Horse_Race.py
This works in that it creates a build and dist folder. The dist folder contains the app of the python code. When I run the app, however, it opens briefly (about 1s) then crashes without anything ever displaying on screen. The interesting part is that I can view the package contents of the app and run the code through my terminal by running the UNIX executable file which is within the package contents of the app.
In short the executable file works, however, the app will not run, and I cannot share the file with my friends who have macs because it just shows up as a text file. If anyone knows how to fix this issue or knows another creative way I can send my game to my friends please let me know.
Thanks for your help.
here is an easy souloution that saves time and does not require knowledge.
pip install auto-py-to-exe
and then just type
auto-py-to-exe
after typing the code above a window in your web browser will open with a ghraphical gui that looks like this
click here to go to image

Trying to run python with VS code - "No such file or directory"

I'm trying to get python to work with VS code and struggling hard.
I've installed multiple version of python previously and have uninstalled them all and reinstalled with the latest version of anaconda. Link to a screenshot of the problem below. I'm only just getting back into coding for the first time in years. It's going to be something stupid.
Here's the solution:
If you're not using Code Runner: Per this answer, you need to go to settings (press Ctrl+, to do so) and type "Python Terminal Execute in File Dir". Then tick the first checkbox that shows up and you're done.
If you are using Code Runner: Go to settings and type "Code-runner: File Directory as Cwd" into the search bar. Then tick the first checkbox that shows up and you're done. You don't need to do step one of my answer, but you can if you want to.
I use extension Code Runner to run Python code inside Visul Studion Code. This extension run your code in "OUTPUT" instead "TERMINAL". To run the code you need to select it and click shortcut "CTRL+Alt+N".

Unable to run Pyschopy

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.

Run python GUI packaged to win32 without console

Please i really need help.
I have this problem which i have been unable to solve.
I wrote some python gui script of which i want to create a win32 app from for portabilty(i.e not compel all my app user to download/install python) and to make my application close sourced.
I have decided to use/ tried using pyinstaller and py2exe but have always had this problem. My gui application shows up with a console window accompanining it.
I have tried several thing to prevent this but all were in vain. I tried changing the extension from .py to .pyw and repackaging but got same result.
Please i need help on how to avoid/override this. Thanks for you help in advance
Note: I use python 2.7.11 on a window 7 32bit system.
And please dont mark my question as duplicate in reference to questions like : Run Python script without Windows console appearing or How to hide console window in python? as my question is completely different.
Thanks for your help in advance.
I was able to get it working with pyinstaller by using the --no-console argument i.e by adding -w. Here is the syntax of my code.
pyinstaller -F -w my_script.py
where -F is to creates one file for standalone app i.e --onefile and -w is to disable console window i.e --no-console.
Thanks.

Trying to Run a Python script using EasyEclipse for Python, get error "The selection cannot be launched, and there are no recent launches."

This is my first time using Eclipse, so I think it must be some newbie configuration error. However, I can not sort it out, so I hope one of you might be able to help me.
This is what I did:
Installed Python 2.7
Installed EasyEclipse for Python 1.3.1
Went to Window>Preferences>Pydev>Interpreter-Python and selected C:\python27\python.exe
Created a new project (when I had to select project type, there was only python 2.3, 2.4, and 2.5, so I selected 2.5, even though I am running 2.7)
Created a file in that project with a simple helloworld.
Clicked the "Run" play button.
When I do this, I get the error "The selection cannot be launched, and there are no recent launches."
As I said, I get the feeling this is just some configuration issue. In particular, could it be something about my "run configuration"? I see this as a dialog box, but I really don't know what I am supposed to be doing in it.
Your help is greatly appreciated. Thank you.
I got it. When I was creating a file, I needed to specify the .py extension. After doing this, the file ran.

Categories

Resources