Today, we need to call a dll dynamic function library, but the local python is 64-bit, and the dll is 32-bit. If you call it directly, you will get an error.
OSError: [WinError 193] %1 不是有效的 Win32 应用程序。
Python version: 3.6
Anaconda is still very convenient for the management of the python version, so anaconda is used here to achieve the coexistence of 32-bit and 64-bit python.
1. Open the anaconda prompt and enter conda info
, you can see that the 64-bit version is currently used.
2. If you switch to 32-bit, set CONDA_FORCE_32BIT=1
you can see that you have switched to 32-bit.
3. After installing 32-bit python3.6, conda create -n python32 python=3.6
there will be an envs folder under the anaconda3 folder.
4. Activate the environment conda activate python32
. If you want to cancel conda deactivate python32
, if To delete the environment conda remove -n python32--all
5. If you want to use the environment in pycharm,
click add local and
click ok.