Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I run runsnakerun on Mac OS X inside a conda environment?

I've created a conda environment so I can use runsnakerun on my Mac as follows:

conda create -n runsnake wxPython
source activate runsnake
pip install runsnakerun

However, when I now attempt to use runsnake I get:

$ runsnake
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.

How can I get runsnake to work?

like image 709
Chris Withers Avatar asked Jun 11 '15 09:06

Chris Withers


People also ask

Is it possible to run Anaconda commands on Mac?

I am not a Mac user, but I think you can run anaconda commands directly from the terminal, just like in Ubuntu. There's no anaconda prompt in Mac. Well Anaconda Navigator is installed but when I run it from shell it says zsh: command not found: conda. How can I fix that? This answer is right, anaconda prompt exists in windows, not on Mac or Ubuntu.

How to install Miniconda silently on macOS or Linux?

For Anaconda, substitute Anaconda for Miniconda in all of the commands. To run the silent installation of Miniconda for macOS or Linux, specify the -b and -p arguments of the bash installer. The following arguments are supported: -b: Batch mode with no PATH modifications to shell scripts. Assumes that you agree to the license agreement.

What is the default shell for Conda on macOS Catalina?

If you are on macOS Catalina (or later versions), the default shell is zsh. You will instead need to run source <path to conda>/bin/activate followed by conda init zsh (to explicitly select the type of shell to initialize).

What is runsnakerun Python?

RunSnakeRun Python (c)Profile Viewer RunSnakeRun RunSnakeRun is a small GUI utility that allows you to view (Python) cProfile or Profile profiler dumps in a sortable GUI view. It allows you to explore the profiler information using a "square map" visualization or sortable tables of data.


1 Answers

The problem is that conda's python is not a "framework python" on Mac, their decision is that you have to use pythonw instead. Unfortunately, pip builds entry point scripts using python not pythonw and, to make matters worse, RunSnakeRun does a horrible subprocess dance to launch itself in 32-bit mode on 64-bit macs.

The upshot is that the only hacky workaround I can think of to launch runsnake is as follows:

VERSIONER_PYTHON_PREFER_32_BIT=yes pythonw `which runsnake32`

I'm not actually sure that environment variable is even needed anymore, but the above does what the entry point appears to be trying to do and does at least start the RunSnakeRun gui.

like image 122
Chris Withers Avatar answered Nov 09 '22 12:11

Chris Withers