snyk - Snyk 测试返回 Failed to test pip 项目错误
问题描述
我正在使用Snyk CLI为 python 项目运行安全扫描。不幸的是,snyk test
命令返回Failed to test pip project错误。我错过了什么,snyk test
在扫描项目时工作得很好npm
?
$ snyk test --file=requirements.txt
Failed to test pip project
解决方案
我找到了原因,基本上你需要做两件事:
- 确保您的项目使用的软件包已安装。
- 确保您使用的是正确的 python。
解决方案
$ pip3 install -r requirements.txt
$ snyk test --file=requirements.txt --command=python3
信息
--allow-missing
您可以通过使用附加参数通过 snyk传递 pip 参数来绕过丢失的 python 包--
。
$ snyk test --file=requirements.txt --command=python3 -- --allow-missing
文档
-- [COMPILER_OPTIONS]
Pass extra arguments directly to Gradle or Maven. E.g. snyk test
-- --build-cache
Python options
--command=COMMAND
Indicate which specific Python commands to use based on Python
version. The default is python which executes your systems de-
fault python version. Run 'python -V' to find out what version
is it. If you are using multiple Python versions, use this pa-
rameter to specify the correct Python command for execution.
Default: python Example: --command=python3
推荐阅读
- java - Hibernate Validator:将验证限制为给定的约束
- java - 调用子类构造函数的超类对象?这是如何运作的?
- c# - C# CancellationToken 如何与 SqlConnection.OpenAsync(token) 一起使用?
- image - qml qt grabToImage 获取图像字节
- java - IntelliJ IDEA - 反编译/编辑/重新编译 JAR
- android - 如何使用 IconCompat.createWithAdaptiveBitmap
- javascript - 检查 div 是否动画并找出 div 的位置
- java - 让测试通过一组 JMock 的模拟方法调用
- css - 为什么登录页面顶部总是弹出成功提示信息?
- c# - Unity Planet Generator 颜色不起作用