编译32位Blender的Animation Nodes插件时vcvarshall.bat找不到的解决求助
Let’s walk through targeted fixes for this error—since Python 3.5 relies on the older VS2015 v140 toolchain, the issue usually boils down to missing components or misconfigured build environments.
1. Verify Complete Visual Studio 2017 Component Installation
Python 3.5 requires the VC++ 2015.3 v140 toolset (not just VS2017’s default tools). Here’s how to confirm you have it:
- Open the Visual Studio Installer, select "Modify" for your VS2017 Community installation.
- Ensure the Desktop development with C++ workload is checked.
- Expand this workload and confirm these critical components are selected:
- VC++ 2015.3 v140 toolset for desktop
- Windows Universal CRT SDK
- All x86-related build tools (including components for the x86 Native Tools Command Prompt)
- Save changes and let the installer finish updating.
2. Manually Initialize the 32-bit Build Environment
If the script can’t locate vcvarshall.bat automatically, call it directly to set up the 32-bit compile context:
- Locate
vcvarshall.bat(default VS2017 path):C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\vcvarshall.bat - Open Anaconda Prompt and activate your Python 3.5 environment:
conda activate your_py35_env_name - Run the script to configure the x86 (32-bit) environment:
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\vcvarshall.bat" x86 - Navigate to your Animation Nodes source directory and run your compile command (e.g.,
python setup.py build).
3. Check and Set VS Environment Variables
Make sure your system recognizes the VS2017 installation:
- Open System Properties → Advanced → Environment Variables.
- Under System Variables, check if
VS150COMNTOOLSexists. Its value should point to:C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\ - If missing, create this variable manually.
- Restart your command prompt/Anaconda Prompt to apply changes.
4. Downgrade Setuptools/Pip to Python 3.5-Compatible Versions
Newer setuptools versions drop support for Python 3.5. Install the last compatible versions:
conda activate your_py35_env_name pip install setuptools==58.1.0 pip install pip==20.3.4
5. Use the VS x86 Native Tools Command Prompt
This is the most reliable method—it pre-configures all necessary build variables:
- Open the x86 Native Tools Command Prompt for VS 2017 (found in the Start Menu under Visual Studio 2017 → Visual Studio Tools).
- Activate your Anaconda Python 3.5 environment:
conda activate your_py35_env_name - Navigate to your Animation Nodes source code directory and run your compile command.
Critical Note: Ensure Your Python 3.5 Environment is 32-bit
Since you’re compiling for 32-bit Blender, your Python environment must also be 32-bit. If you created it without specifying the platform, recreate it with:
conda create -n py35_32 python=3.5 --platform win-32
内容的提问来源于stack exchange,提问作者K Dilip Ram Prasath

