- 1 year ago
How can I get 64-bit Anaconda Python to find the MS C compiler for Cython on Windows?
Comment
1 / 1
To get 64-bit Anaconda Python to find the MS C compiler for Cython on Windows, you can follow these steps:
Install Microsoft Visual Studio:
- Make sure you have Microsoft Visual Studio installed on your system.
- Install the version of Visual Studio that corresponds to your Anaconda Python version. For example, if you have Anaconda Python 3.8, install Visual Studio 2019.
Set up the Visual Studio Build Tools:
- Open the "x64 Native Tools Command Prompt" from the Start menu or run
cmd.exe
and execute the following command:arduino"%VSINSTALLDIR%\VC\Auxiliary\Build\vcvars64.bat"
- This sets up the necessary environment variables for the 64-bit MS C compiler.
- Open the "x64 Native Tools Command Prompt" from the Start menu or run
Configure Anaconda Python to use the MS C compiler:
- Open an Anaconda Prompt.
- Run the following command to configure Anaconda Python to use the MS C compiler:lua
conda config --add channels conda-forge
conda install m2w64-toolchain
Install Cython:
- Run the following command to install Cython:
conda install cython
- Run the following command to install Cython:
By following these steps, you should be able to configure Anaconda Python to use the MS C compiler for building Cython modules on Windows.