Erros de Python¶
Precompiled Libraries¶
While not common practice, Python add-ons can be distributed with their own precompiled libraries. Unlike regular Python scripts, these are not portable between different platforms.
É possível que a biblioteca seja incompatível com a sua instalação do Blender (na tentativa de carregar uma biblioteca construída para uma versão diferente do Python, ou ao carregar uma biblioteca de 32 bits em um sistema de 64 bits).
Caso o complemento tenha arquivos com as extensões .pyd
ou .so
, certifique-se que a distribuição presente neles é compatível com seu sistema operacional.
Referências específicas de plataforma¶
Windows¶
Mixed Python Libraries (DLLs)¶
If Python is raising errors or you have an add-on that just fails when enabled with an error – e.g: ... is not a
valid Win32 application.
– this may be caused by some inconsistency in the Python libraries. While Blender comes with
its own bundled Python interpreter, duplicate, incompatible libraries can cause problems.

Um rastreamento de erros (tracebacks) Python.¶
Para localizar qual biblioteca Python causou o problema, verifique a mensagem de erro.
Isto é normalmente apresentado em algum local próximo a linha de base do rastreamento (traceback). Através do erro apresentado acima, é possível ver que o problema foi causado ao tentar importar a função _socket
. Isto pode corresponder tanto ao arquivo nomeado _socket.py
quanto ao arquivo _socket.pyd
.
To help troubleshoot this problem, the following script can be pasted into the Text editor and run to check for duplicate libraries in your search path. (The output will show in Command Line Window.)
import os
import sys
# Change this based on the library you wish to test
test_lib = "_socket.pyd"
def GetSystemDirectory():
from ctypes import windll, create_string_buffer, sizeof
GetSystemDirectory = windll.kernel32.GetSystemDirectoryA
buffer = create_string_buffer(260)
GetSystemDirectory(buffer, sizeof(buffer))
return os.fsdecode(buffer.value)
def library_search_paths():
return (
# Windows search paths
os.path.dirname(sys.argv[0]),
os.getcwd(),
GetSystemDirectory(),
os.environ["WINDIR"], # GetWindowsDirectory
*os.environ["PATH"].split(";"),
# regular Python search paths
*sys.path,
)
def check_library_duplicate(libname):
paths = [p for p in library_search_paths()
if os.path.exists(os.path.join(p, libname))]
print("Library %r found in %d locations:" % (libname, len(paths)))
for p in paths:
print("- %r" % p)
check_library_duplicate(test_lib)