简体   繁体   中英

Running winpdb from within Enthought Canopy on MacOS 10.9.2

I have Enthought Canopy 1.4 installed on MacOS 10.9.2. Trying to run the winpdb debugger results in 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.

As a workaround, I tried creating a shell script run.sh , containing

PYVER=2.7
PYTHON=/System/Library/Frameworks/Python.framework/Versions/$PYVER/bin/python$PYVER

# find the root of the virtualenv, it should be the parent of the dir this script is in
ENV=`$PYTHON -c "import os; print os.path.abspath(os.path.join(os.path.dirname(\"$0\"), '..'))"`
export PATH=$OLD_PATH

# now run Python with the virtualenv set as Python's HOME
export PYTHONHOME=$ENV
exec $PYTHON "$@"

Trying to run ./run.sh winpdb results in the error message

ImportError: No module named site

My problem seems similar to what is discussed in Running wxPython 2.9 on OS X 10.8 (64 bit) , but the solution there does not seem to be applicable, as I don't seem to have anything like /Library/Frameworks/EPD64.framework/... , ie any Framework connected to Canopy or EPD

This is a known issue which has been fixed for the next release of Canopy (coming soon.) In the meantime you should be able to workaround the issue by editing the 1st line in the winpdb script and setting it to use pythonw command instead of python. For example, change this line:

#!/Users/<UserId>/Library/Enthought/Canopy_64bit/User/bin/python

to:

#!/Users/<UserId>/Library/Enthought/Canopy_64bit/User/bin/pythonw

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM