如何在没有Internet连接的情况下运行TOX?
当我尝试在没有Internet连接的情况下运行TOX时,它会打印以下错误消息:
py3 inst-nodeps: mypackage/.tox/.tmp/package/1/mypackage-0.1.1.dev0.tar.gz
ERROR: invocation failed (exit code 1), logfile: mypackage/.tox/py3/log/py3-12.log
=================================================================================== log start ===================================================================================
Processing ./.tox/.tmp/package/1/mypackage-0.1.1.dev0.tar.gz
Installing build dependencies: started
Installing build dependencies: finished with status 'error'
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> [7 lines of output]
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fbb577c1dc0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/flit-core/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fbb577c1e50>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/flit-core/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fbb577c1b20>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/flit-core/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fbb577c1760>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/flit-core/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fbb5783fc10>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/flit-core/
ERROR: Could not find a version that satisfies the requirement flit_core<4,>=3.2 (from versions: none)
ERROR: No matching distribution found for flit_core<4,>=3.2
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
==================================================================================== log end ====================================================================================
____________________________________________________________________________________ summary ____________________________________________________________________________________
ERROR: py3: InvocationError for command mypackage/.tox/py3/bin/python -m pip install --no-deps -U .tox/.tmp/package/1/mypackage-0.1.1.dev0.tar.gz (exited with code 1)
我的Tox.ini看起来像这样:
[tox]
envlist = py3
isolated_build = True
[testenv]
deps =
mypy
pytest
types-appdirs
commands =
mypy src/mypackage tests
pytest
使用Internet连接运行TOX按预期工作。
我已经尝试了
setenv = VIRTUALENV_DOWNLOAD=0
PIP_DISABLE_PIP_VERSION_CHECK=1
我使用的是TOX 3.25.0和PIP 20.3.4,并且在两个不同的项目中尝试了一下,一个使用Flit 3.7.1,一个使用SetUptools。
有人知道我如何在没有互联网连接的情况下运行TOX?
When I try to run tox without an internet connection it prints the following error message:
py3 inst-nodeps: mypackage/.tox/.tmp/package/1/mypackage-0.1.1.dev0.tar.gz
ERROR: invocation failed (exit code 1), logfile: mypackage/.tox/py3/log/py3-12.log
=================================================================================== log start ===================================================================================
Processing ./.tox/.tmp/package/1/mypackage-0.1.1.dev0.tar.gz
Installing build dependencies: started
Installing build dependencies: finished with status 'error'
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> [7 lines of output]
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fbb577c1dc0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/flit-core/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fbb577c1e50>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/flit-core/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fbb577c1b20>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/flit-core/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fbb577c1760>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/flit-core/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fbb5783fc10>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/flit-core/
ERROR: Could not find a version that satisfies the requirement flit_core<4,>=3.2 (from versions: none)
ERROR: No matching distribution found for flit_core<4,>=3.2
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
==================================================================================== log end ====================================================================================
____________________________________________________________________________________ summary ____________________________________________________________________________________
ERROR: py3: InvocationError for command mypackage/.tox/py3/bin/python -m pip install --no-deps -U .tox/.tmp/package/1/mypackage-0.1.1.dev0.tar.gz (exited with code 1)
My tox.ini looks like this:
[tox]
envlist = py3
isolated_build = True
[testenv]
deps =
mypy
pytest
types-appdirs
commands =
mypy src/mypackage tests
pytest
Running tox with an internet connection works as expected.
I have tried the advice given in this issue of adding the following lines to my tox.ini but seemingly without any effect, I cannot run tox without an internet connection.
setenv = VIRTUALENV_DOWNLOAD=0
PIP_DISABLE_PIP_VERSION_CHECK=1
I am using tox 3.25.0 and pip 20.3.4 and I have tried this in two different projects, one using flit 3.7.1 and one using setuptools.
Does anyone have an idea how I can run tox without an internet connection?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要 pre-download依赖关系并脱机。在tox.ini中使用
install> install_command
。类似You need to pre-download dependencies and install them offline. In tox.ini use
install_command
. Something like