SetUp kivy&在OSX上使用pycharm IDE的anaconda

时间:2016-06-05 04:26:55

标签: python macos pycharm kivy anaconda

问题:

设置kivy以使用anaconda中的pycharm

我做了什么:

根据Connecting Kivy with Anaconda (OSX)上的说明,我kivyanaconda合作(通过kivy.app启动,而非conda启动)

遵循这些:Setting Up Kivy with various popular IDE's我在anaconda设置了Pycharm

但是,我需要在kivy中使用anaconda pycharm
有人知道如何设置吗?


----------------------------------------------------------------------------------

其他信息

知道通过conda environment$ source activate ...)启动kivy不起作用可能会有用;它抛出一个import error/package kivy not installed

kivy.app的最终'引导脚本'如下(从Connecting Kivy with Anaconda (OSX)修改)

#!/bin/bash
SCRIPT_PATH="${BASH_SOURCE[0]}";
if([ -h "${SCRIPT_PATH}" ]) then
  while([ -h "${SCRIPT_PATH}" ]) do SCRIPT_PATH=`readlink "${SCRIPT_PATH}"`; done
fi
SCRIPT_PATH=$(python -c "import os; print(os.path.realpath(os.path.dirname('${SCRIPT_PATH}')))")

# activate the virtualenv
# SUPPRESSED
# source ${SCRIPT_PATH}/venv/bin/activate

# setup the environment to not mess with the system
export PYTHONPATH="${SCRIPT_PATH}/kivy:${PYTHONPATH}"
export DYLD_FALLBACK_LIBRARY_PATH="${SCRIPT_PATH}/lib"
export LD_PRELOAD_PATH="${SCRIPT_PATH}/lib"
export GST_REGISTRY="${SCRIPT_PATH}/gst.registry"
export GST_PLUGIN_SCANNER="${SCRIPT_PATH}/gst-plugin-scanner"
export GTK_PATH="${SCRIPT_PATH}/../Frameworks/GStreamer.framework/Versions/Current"
export GST_PLUGIN_SYSTEM_PATH="${SCRIPT_PATH}/../Frameworks/GStreamer.framework/Versions/Current/lib/gstreamer-1.0"
export GST_PLUGIN_SYSTEM_PATH="${SCRIPT_PATH}/../Frameworks/GStreamer.framework/Versions/Current/lib/gstreamer-1.0"
export GIO_EXTRA_MODULES="${SCRIPT_PATH}/../Frameworks/GStreamer.framework/Versions/Current/lib/gio/modules"
export KIVY_HOME="${SCRIPT_PATH}/.kivy"

# activate the conda environment
# ADDED
source activate kivy

# if an app is available, use it
# SUPPRESSED
# if [ -d "${SCRIPT_PATH}/yourapp" ]; then
#   cd "${SCRIPT_PATH}/yourapp"
#   if [ -f "main.so" ]; then
#       exec ${SCRIPT_PATH}/python -c "import main"
#     exit 1
#   fi
#     if [ -f "main.pyo" ] || [ -f "main.opt-2.pyc" ]; then
#         exec ${SCRIPT_PATH}/python -OO -m main "$@"
#     exit 1
#     else
#         exec ${SCRIPT_PATH}/python -m main "$@"
#     exit 1
#     fi

# ADDED
if [ $# -ne 0 ]; then
    exec python "$@"
else
    exec python
fi

# default drag & drop support
elif [ $# -ne 0 ]; then
        exec ${SCRIPT_PATH}/python "$@"

# start a python shell, only if we didn't double-clicked
# SUPPRESSED
# elif [ "$SHLVL" -gt 1 ]; then
#         exec ${SCRIPT_PATH}/python
fi

我在github上也raised the issue with kivy

以下SO问题没有帮助:

0 个答案:

没有答案