我尝试在我拥有的repo克隆中运行tox
但是出现了这个错误:
helton@helton-pc /data/Dropbox/Forks do GitHub/fastkml $ sudo tox
GLOB sdist-make: /data/Dropbox/Forks do GitHub/fastkml/setup.py
py27 create: /data/Dropbox/Forks do GitHub/fastkml/.tox/py27
py27 installdeps: pytest, coverage
ERROR: invocation failed (errno 2), args: [local('/data/Dropbox/Forks do GitHub/fastkml/.tox/py27/bin/pip'), 'install', 'pytest', 'coverage'], cwd: /data/Dropbox/Forks do GitHub/fastkml
Traceback (most recent call last):
File "/usr/local/bin/tox", line 11, in <module>
sys.exit(cmdline())
File "/usr/local/lib/python2.7/dist-packages/tox/session.py", line 39, in main
retcode = Session(config).runcommand()
File "/usr/local/lib/python2.7/dist-packages/tox/session.py", line 375, in runcommand
return self.subcommand_test()
File "/usr/local/lib/python2.7/dist-packages/tox/session.py", line 526, in subcommand_test
if self.setupenv(venv):
File "/usr/local/lib/python2.7/dist-packages/tox/session.py", line 434, in setupenv
status = venv.update(action=action)
File "/usr/local/lib/python2.7/dist-packages/tox/venv.py", line 153, in update
self.hook.tox_testenv_install_deps(action=action, venv=self)
File "/usr/local/lib/python2.7/dist-packages/pluggy.py", line 724, in __call__
return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
File "/usr/local/lib/python2.7/dist-packages/pluggy.py", line 338, in _hookexec
return self._inner_hookexec(hook, methods, kwargs)
File "/usr/local/lib/python2.7/dist-packages/pluggy.py", line 333, in <lambda>
_MultiCall(methods, kwargs, hook.spec_opts).execute()
File "/usr/local/lib/python2.7/dist-packages/pluggy.py", line 596, in execute
res = hook_impl.function(*args)
File "/usr/local/lib/python2.7/dist-packages/tox/venv.py", line 401, in tox_testenv_install_deps
venv._install(deps, action=action)
File "/usr/local/lib/python2.7/dist-packages/tox/venv.py", line 284, in _install
action=action)
File "/usr/local/lib/python2.7/dist-packages/tox/venv.py", line 257, in run_install_command
self._pcall(argv, cwd=self.envconfig.config.toxinidir, action=action)
File "/usr/local/lib/python2.7/dist-packages/tox/venv.py", line 362, in _pcall
redirect=redirect, ignore_ret=ignore_ret)
File "/usr/local/lib/python2.7/dist-packages/tox/session.py", line 136, in popen
stdout=stdout, stderr=STDOUT)
File "/usr/local/lib/python2.7/dist-packages/tox/session.py", line 224, in _popen
stdout=stdout, stderr=stderr, env=env)
File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
但是当我将回购克隆克隆到其他地方时,它起作用了:
> cd ~/Desktop
> git clone http://github.com/heltonbiker/fastkml
> cd fastkml
> tox
我正在使用包含python 2.7.6的Linux Mint 17.3 64位和使用sudo pip install tox
安装的tox。
答案 0 :(得分:1)
派对有点晚,但问题与tox没有直接关系。
问题 - 它听起来有多么微不足道 - 是,你的项目路径包含空格。另一个克隆可能没有空格,因此没有问题:
ERROR: invocation failed (errno 2), args: [local('/data/Dropbox/Forks do GitHub/[...]
这是像virtualenv和pip这样的上游工具的长期问题。这些问题中的大部分都可以通过发布pip 10来解决。见pip does not support spaces in directories names
我们也在这里跟踪tox:https://github.com/tox-dev/tox/issues/121
自2.8以来,我们至少会提供一些更有用的错误,如果发生这种情况:https://github.com/tox-dev/tox/pull/556