PLocalSim icon indicating copy to clipboard operation
PLocalSim copied to clipboard

Mac build: ./resCompiler : Unable to detect PebbleSDK, make sure it is in your PATH!

Open konsumer opened this issue 11 years ago • 8 comments

I could not get it to detect my SDK path, so I modified resCompiler to look like this, which I think is maybe closer to the intent of that code:

from distutils.spawn import find_executable

try:
    # locate PebbleSDK so we can profit from their code :)
    path=os.path.dirname(find_executable('pebble'))
    sdk_tools_path = os.path.join(path, '..', 'Pebble', 'tools')
    if os.path.exists(os.path.join(sdk_tools_path, 'bitmapgen.py')):
        sys.path.append(sdk_tools_path)
    import bitmapgen # safest way to convert bitmap resources..
except ImportError as e:
    logging.basicConfig(format='[%(levelname)-8s] %(message)s', level=logging.INFO)
    logging.fatal('Unable to detect PebbleSDK, make sure it is in your PATH!')
    sys.exit(1)

konsumer avatar Dec 24 '13 04:12 konsumer

I have this issue too. It is in PATH, I do pebble new-project x fine, for instance.

Still have error, even with konsumer's modification, though.

OJFord avatar Feb 28 '14 06:02 OJFord

use $HOME instead of ~ in your path

fugounashi avatar Mar 06 '14 04:03 fugounashi

Unfortunately, that made no difference.

OJFord avatar Mar 06 '14 12:03 OJFord

Getting this as well, even with the change to $HOME

OiNutter avatar Mar 13 '14 15:03 OiNutter

I've added following line under sys.path.append(sdk_tools_path)

sys.path.append('/Users/yourusername/pebble-dev/PebbleSDK-2.0.2/Pebble/tools')

and deactivated import bitmapgen (-> caused the same error) to

# import bitmapgen

then it worked fine on my Mac (OSX 10.9.2)

funclass avatar Apr 18 '14 19:04 funclass

@funclass what file are you editing? If I comment bitmapgen in resCompiler I get: NameError: global name 'bitmapgen' is not defined (OSX 10.9.3)

jbeuckm avatar Jun 05 '14 18:06 jbeuckm

Got the same error by using Templates that need bitmapgen. A simple watchface without using bitmapgen works fine. Unfortunately I haven`t got any ideas to solve this problem.

funclass avatar Jun 07 '14 20:06 funclass

The SDK2 uses a virtual environment provided by virtualenv located in "PebbleSDK/.env", by running "source PebbleSDK/.env/bin/activate" and "deactivate" in the way you see in https://github.com/Helco/PebbleLocalSim/blob/master/build/linux/build/bin/build.local.sh#L51 for Linux, the python resource compiler should be able to load the additional python packages for the bitmap generation. Unfortunately I don't have a possibility to test this out, but please share your experience if this works :)

Helco avatar Jun 08 '14 06:06 Helco