python2安装pyyaml_python-2.7 – tox无法在Windows上安装pyYaml

我的tox.ini文件在

Windows上看起来像这样

[tox]

envlist = cpy27,dpy27

skip_missing_interpreters = True

[testenv]

basepython =

cpy27: C:\Python27\python.exe

dpy27: D:\Python27\python.exe

deps =

pytest

commands = py.test tests

但是当我从命令提示符执行“tox”时,我看到了这个错误.为什么是这样?如果我在命令行上运行python setup.py install,我没有看到任何错误

Installing collected packages: coverage, pytest-cov, requests, psutil, pytz, enum, argh, pathtools, PyYAML, watchdog, monit

Running setup.py install for PyYAML: started

Running setup.py install for PyYAML: finished with status 'error'

Complete output from command d:\repos\foo\.tox\dpy27\scripts\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\foo\\appdata\\local\\temp\\pip-build-bbx8kz\\PyYAML\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\vikone\appdata\local\temp\pip-zyvbbh-record\install-record.txt --single-version-externally-managed --compile --install-headers d:\repos\foo\.tox\dpy27\include\site\python2.7\PyYAML:

running install

running build

running build_py

creating build

creating build\lib.win-amd64-2.7

creating build\lib.win-amd64-2.7\yaml

copying lib\yaml\composer.py -> build\lib.win-amd64-2.7\yaml

copying lib\yaml\constructor.py -> build\lib.win-amd64-2.7\yaml

copying lib\yaml\cyaml.py -> build\lib.win-amd64-2.7\yaml

copying lib\yaml\dumper.py -> build\lib.win-amd64-2.7\yaml

copying lib\yaml\emitter.py -> build\lib.win-amd64-2.7\yaml

copying lib\yaml\error.py -> build\lib.win-amd64-2.7\yaml

copying lib\yaml\events.py -> build\lib.win-amd64-2.7\yaml

copying lib\yaml\loader.py -> build\lib.win-amd64-2.7\yaml

copying lib\yaml\nodes.py -> build\lib.win-amd64-2.7\yaml

copying lib\yaml\parser.py -> build\lib.win-amd64-2.7\yaml

copying lib\yaml\reader.py -> build\lib.win-amd64-2.7\yaml

copying lib\yaml\representer.py -> build\lib.win-amd64-2.7\yaml

copying lib\yaml\resolver.py -> build\lib.win-amd64-2.7\yaml

copying lib\yaml\scanner.py -> build\lib.win-amd64-2.7\yaml

copying lib\yaml\serializer.py -> build\lib.win-amd64-2.7\yaml

copying lib\yaml\tokens.py -> build\lib.win-amd64-2.7\yaml

copying lib\yaml\__init__.py -> build\lib.win-amd64-2.7\yaml

running build_ext

creating build\temp.win-amd64-2.7

creating build\temp.win-amd64-2.7\Release

checking if libyaml is compilable

error: [Error 2] The system cannot find the file specified

UPDATE

我注意到,当我手动激活virtualenv并执行“pip install pyyaml”时,它失败并出现相同的错误.但是当我在常规命令提示符中,而不是virtualenv,并执行相同的命令时,它安装得很好.

所以这似乎是pyyaml和virtualenv的一个问题,但不是tox本身.

此外,如果我在tox.ini中尝试使用easy_install命令,它可以解决任何问题.

[testenv]

install_command = easy_install {opts} {packages}

最佳答案 看起来二进制文件没有轮子,当PIP下载PyYAML时,它试图构建它而不能.

我通过下载源代码,构建一个轮子然后将其上传到我的本地devpi服务器来为我的计算机修复此问题.然后我可以在virtualenv中使用pip安装它.

我正在使用Windows 10,如果这很重要的话.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值