"location unknown" error creating a blender runtim

Scripting in Blender with Python, and working on the API

Moderators: jesterKing, stiv

Post Reply
Posts: 0
Joined: Wed Sep 06, 2006 4:36 pm

"location unknown" error creating a blender runtim

Post by strattonbrazil » Mon Jul 30, 2012 5:50 am

I get a "location unknown" error when I try to export my current blender file into a runtime file for playing. It seems to create an executable, but what I see running the runtime is completely different from what I see in blender.

From inside blender

From the created runtime...

The error message I'm getting out...

Code: Select all

Copying Python files... Saving runtime to '/tmp/game4/game4'
Writing runtime... done
Traceback (most recent call last):
  File "/usr/lib/blender/scripts/addons/game_engine_save_as_runtime.py", line 228, in execute
  File "/usr/lib/blender/scripts/addons/game_engine_save_as_runtime.py", line 158, in WriteRuntime
    CopyPythonLibs(dst, overwrite_lib, report)
  File "/usr/lib/blender/scripts/addons/game_engine_save_as_runtime.py", line 62, in CopyPythonLibs
    shutil.copytree(src, dst, ignore=lambda dir, contents: [i for i in contents if i == '__pycache__'])
  File "/usr/lib/python3.2/shutil.py", line 239, in copytree
    raise Error(errors)
shutil.Error: [('/usr/lib/python3.2/config', '/tmp/game4/2.62/python/lib/python3.2/config', "[Errno 21] Is a directory: '/usr/lib/python3.2/config'")]

location:<unknown location>:-1

location:<unknown location>:-1

I'm assuming this error is causing the game to not run at all since I use a lot of python controllers in the little game setup I've created. Is there something I can do to resolve this?

Posts: 0
Joined: Sun Apr 21, 2013 12:08 am

Post by Lenkense » Sun Apr 21, 2013 2:38 am

There's an issue with symbolic links. I'll try to be as clear as I can. Linux has a feature called "likns" such liks are ways to avoid copying a file many times. For instance suppose I have a program that looks for a known function inside a library. This program will look for that file in a certain directory. However said library might be installed some where else. To avoid that you create a link in the folder that the program will look for and you lik it where the real library is. For some reason I can't get shutil.copytree is not working fine in your and my coputer when it comes to symbolic links (a type of link). Maybe this was fixed in a later version. Therefore each time the directory "/usr/lib/python3.2/config" is called you get an error since that directory is a symbolic link.

I add " , ignore_dangling_symlinks=True" in line 63 of the game_engine_save_as_runtime.py before the final parenthesis. That python script can be found in /usr/lib/blender/scripts/addons. you will need super user permits toedit the file.

You should replace with:

Code: Select all

            shutil.copytree(src, dst, symlinks=False, ignore=lambda dir, contents: [i for i in contents if i == '__pycache__'], ignore_dangling_symlinks=True)
where you read

Code: Select all

            shutil.copytree(src, dst, symlinks=False,  ignore=lambda dir, contents: [i for i in contents if i ==  '__pycache__'])
I'm still verifing if this works so stay in touch

Post Reply