SOLVED -- snyk plugin -- "Failed to test pip project"
EDIT: if you are using a virutal environment include
--command=/path/to/python.exe
In the Extension "Project Settings/Additional parameters" textbox.
This is documented in at this link, currently bottom of page, "Scanning Python dependencies in IDEs"
ORIGINAL QUESTION:
I have virtual environment activated in pycharm. When I go to terminal, I can successfully run
$ snyk-win.exe test --file=requirements.txt --package-manager=pip
But Snyk, running in the GUI, is unable to scan the libraries installed by pip. When I click on Snyk plugin's green "play" icon, it does review my local code but "Open Source" displays 'error' with Message = "Failed to test pip project"
I installed the librares by telling pycharm to install needed dependencies, not by directly running "pip -r requirements.txt". As I say, running on command line after doing that, Snyk succesfully scans the libraries installed in the venv.
Does anyone have this working in GUI?
Few details
My requirements.txt file is in project root directory.
The plugin has options for additional parameters, I can't find any documentation. There is a failure log in Pycharm under "Help/Show Log In Explorer" and it has various stuff about missing buttons, problem charsets but nothing I see quick resolution for.
I don't see any configureation option
Snyk Plugin -- 2.4.49
Pycharm -- 2022.2.3 Professional
Runtime version: 17.0.4.1+7-b469.62 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Please sign in to leave a comment.
In my case I was suffering of the same and didn't want to install the whole requirements.txt file into my system.
All of this is on Windows, that I believe makes things more complicated with the
`\`
instead of`/`
.Using git-bash:
.venv
folder$ . .venv/Scripts/activate
$ pip install -r requirements.txt
``idea64.exe`
file inside of `Program Files x86
` folder (remember this is Windows)--command='c:\path\to\project\.venv\Scripts\python.exe'
in the Snyk "Project Settings/Additional parameters" textboxThat did the trick for me