Sublime Forum

__init__() got an unexpected keyword argument 'name' when use a custom build

#1

Hello,
I use this build for compile python scripts:
build
And when I try compiling a py file with it, I get this error:

init() got an unexpected keyword argument ‘name’
[cmd: python C:\Users\User\Documents\Coding\Python\game_of_life.py]
[dir: C:\Users\User\Documents\Coding\Python]
[path: C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client;C:\Program Files\Intel\iCLS Client;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\GtkSharp\2.12\bin;C:\WINDOWS\System32\OpenSSH;C:\Program Files\nodejs;C:\Program Files (x86)\Intel\Intel® Management Engine Components\DAL;C:\Program Files\Intel\Intel® Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel® Management Engine Components\IPT;C:\Program Files\Intel\Intel® Management Engine Components\IPT;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;C:\Program Files\dotnet;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\mingw64\bin;C:\Users\User\AppData\Local\Programs\Python\Python37-32\Scripts;C:\Users\User\AppData\Local\Programs\Python\Python37-32;C:\Users\User\AppData\Local\Microsoft\WindowsApps;C:\Users\User\AppData\Roaming\npm;C:\MinGW\bin;]
[Finished]

I tried with other custom builds and again the same error.
Do you have any idea for fix this?

0 Likes

#2

With the exception of the build keys that indicate to Sublime how the build system should be automatically selected (such as the selector) key, all of the keys in a sublime-build file are passed directly as arguments to the command that is in charge of executing the build.

By default, that command is the exec command, which doesn’t accept an argument named name; hence the error. Removing the key from the build file will solve your problem.

You may have read something online that indicates that name is a valid key in a build file; this is only partially true. For builds stored in sublime-build files, the name of the build system is taken from the name of the file it’s stored in, so in that case the name key is not allowed.

However, it’s possible to have project specific build sytems, which would be stored in your sublime-project file. In such a case the name key is required for the build to name it, because there isn’t an associated sublime-build file in that case.

0 Likes