Python 2.7 64-bit erroneously refer to 32-bit (x86) for include files

后端 未结 1 746
挽巷
挽巷 2021-01-27 18:51

I\'m doing some legacy work with Python 2.7.18 in 64 bit. When PIP calling the compiler (VC for Python), it erroneously refer to 32-bit (x86) sources looking for include files,

相关标签:
1条回答
  • 2021-01-27 19:12

    As a workaround, I resolved it by calling pip install command with --global-option to specify path of include and lib files. See the example command below:

    pip install MySQL-python ^
     --force-reinstall --no-cache-dir ^
     --global-option=build_ext ^
     --global-option="-IC:\my\install\MySQL-x64\MySQL Connector C 6.0.2\include" ^
     --global-option="-LC:\my\install\MySQL-x64\MySQL Connector C 6.0.2\lib\opt" ^
     --verbose
    

    In this example, I have fully installed 64-bit version of MySQL Connector C in customized location of C:\my\install\MySQL-x64\MySQL Connector C 6.0.2\.

    I'm still wondering why pip install MySQL-python by default always looks into directory C:\Program Files (x86)\MySQL\MySQL Connector C 6.0.2\, even if you're using 64-bit Python and/or have installed the driver at a different location.

    Any additional inputs will be highly appreciated. Or maybe I will post another question ask specifically about the point.

    0 讨论(0)
提交回复
热议问题