error: Python was built with Visual Studio 2003;

解决Python安装Atomisator时遇到的Visual Studio版本冲突问题
本文详细记录了解决在使用easy_install安装Atomisator时遇到的Python版本与Visual Studio版本不匹配导致的安装失败问题。通过手动安装Atomisator并配置环境变量的方式成功解决问题,并在遇到编译警告时调整setup.cfg文件以顺利安装。最终,通过指定mingw32编译器解决了安装问题,避免了不必要的Visual Studio安装。
用easy_install安装atomisator的时候提示说:
“Python was built with Visual Studio 200*” error:
Python was built with Visual Studio 2003;
extensions must be built with a compiler than can generate compatible binaries.
Visual Studio 2003 was not found on this system.
If you have Cygwin installed, you can try compiling with MingW32, by passing “-c mingw32″ to setup.py.

手动安装atomisator的时候,还是如此错误, 怪了, 看来只有用mingw32了。
mingw32已经有了,不用担心, build的时候指定mingw32:
python setup.py build -c mingw32
但是install的时候还是无法通过。 而且使用python setup.py install -c mingw32的时候,错误依旧。
在: http://eli.thegreenplace.net/2008/06/28/compiling-python-extensions-with-distutils-and-mingw/
说通过替换libpython25.a可以通过。 这个方法在我这儿行不通。
有可能他是ActiveState ,我使用的是Cpython,有可能问题出在这儿。
还有一个可能就是install的不理会-c mingw32的选项。
郁闷的是没有命令行可以指定这个选项。
难道非要VS?没有办法,下载了免费版的Visual Studio 2008 Express。
用d:Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat 设置了环境变量。
再来easy_install-2.5 atomisator 错误依旧。
最后在:http://www.procoders.net/?p=204 找到法子:
修改setup.cfg,增加:
[build]
compiler=mingw32
然后 easy_install-2.5 atomisator 果然漂亮。
不知道在么两行内容,害得我花了老长时间去下那个近2G的VS 2008 Express。 真是不值。
好在后来 easy_install-265 atomisator 的时候看见:
atomisatorfilterslevenshteinLevenshtein.c(4109) : warning C4244: “=”: 从”double”转换到”size_t”,可能丢失数据
atomisatorfilterslevenshteinLevenshtein.c(4146) : warning C4244: “初始化”: 从”double”转换到”size_t”,可能丢失数据
这个很明显是cl干的。 稍微宽了些心。
最后在:http://www.procoders.net/?p=204 的commets里面看见有人说:
python setup.py build -c mingw32 install
和自定义
%HOME%pydistutils.cfg
都是上好的方法。而且这两个方法看起来更加棒。 而且在:
http://docs.python.org/install/index.html#config-syntax
有非常完整的Python模块安装说明。以后在有什么东西装不上,一个地方就是去这儿看看,
而不是满世界无头苍蝇似的乱转
Building wheels for collected packages: pysqlcipher3, txjson-rpc Building wheel for pysqlcipher3 (pyproject.toml) ... error error: subprocess-exited-with-error × Building wheel for pysqlcipher3 (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [47 lines of output] running bdist_wheel running build running build_py creating build creating build\lib.win32-cpython-37 creating build\lib.win32-cpython-37\pysqlcipher3 copying lib\dbapi2.py -> build\lib.win32-cpython-37\pysqlcipher3 copying lib\dump.py -> build\lib.win32-cpython-37\pysqlcipher3 copying lib\__init__.py -> build\lib.win32-cpython-37\pysqlcipher3 creating build\lib.win32-cpython-37\pysqlcipher3\test copying lib\test\__init__.py -> build\lib.win32-cpython-37\pysqlcipher3\test creating build\lib.win32-cpython-37\pysqlcipher3\test\python3 copying lib\test\python3\dbapi.py -> build\lib.win32-cpython-37\pysqlcipher3\test\python3 copying lib\test\python3\dump.py -> build\lib.win32-cpython-37\pysqlcipher3\test\python3 copying lib\test\python3\factory.py -> build\lib.win32-cpython-37\pysqlcipher3\test\python3 copying lib\test\python3\hooks.py -> build\lib.win32-cpython-37\pysqlcipher3\test\python3 copying lib\test\python3\regression.py -> build\lib.win32-cpython-37\pysqlcipher3\test\python3 copying lib\test\python3\sqlcipher.py -> build\lib.win32-cpython-37\pysqlcipher3\test\python3 copying lib\test\python3\transactions.py -> build\lib.win32-cpython-37\pysqlcipher3\test\python3 copying lib\test\python3\types.py -> build\lib.win32-cpython-37\pysqlcipher3\test\python3 copying lib\test\python3\userfunctions.py -> build\lib.win32-cpython-37\pysqlcipher3\test\python3 copying lib\test\python3\__init__.py -> build\lib.win32-cpython-37\pysqlcipher3\test\python3 running build_ext Builds a C extension linking against libsqlcipher library building 'pysqlcipher3._sqlite3' extension error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/ Traceback (most recent call last): File "C:\Users\admin\AppData\Local\Temp\pip-build-env-m9vyaau8\overlay\Lib\site-packages\setuptools\build_meta.py", line 119, in _file_with_extension file, = matching ValueError: not enough values to unpack (expected 1, got 0) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "d:\python37\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module> main() File "d:\python37\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main json_out['return_val'] = hook(**hook_input['kwargs']) File "d:\python37\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 252, in build_wheel metadata_directory) File "C:\Users\admin\AppData\Local\Temp\pip-build-env-m9vyaau8\overlay\Lib\site-packages\setuptools\build_meta.py", line 417, in build_wheel wheel_directory, config_settings) File "C:\Users\admin\AppData\Local\Temp\pip-build-env-m9vyaau8\overlay\Lib\site-packages\setuptools\build_meta.py", line 404, in _build_with_temp_dir tmp_dist_dir, result_extension) File "C:\Users\admin\AppData\Local\Temp\pip-build-env-m9vyaau8\overlay\Lib\site-packages\setuptools\build_meta.py", line 122, in _file_with_extension 'No distribution was found. Ensure that `setup.py` ' ValueError: No distribution was found. Ensure that `setup.py` is not empty and that it calls `setup()`. [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for pysqlcipher3 Building wheel for txjson-rpc (pyproject.toml) ... done Created wheel for txjson-rpc: filename=txJSON_RPC-0.5-py3-none-any.whl size=27251 sha256=119f5bd1cd6cba696d098572b12e85c2b558de3cb640efaccda75c1c6e3e6cc6 Stored in directory: c:\users\admin\appdata\local\pip\cache\wheels\38\f4\74\b0f09b935e506b98009948bc3d29548390ca0015e670db7dba Successfully built txjson-rpc Failed to build pysqlcipher3 ERROR: Could not build wheels for pysqlcipher3, which is required to install pyproject.toml-based projects
08-21
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值