Python requirements.txt file scans with CLI, or with terminal within IntelliJ, but will not scan in Jetbrains IntelliJ Snyk plugin. The error message is that
required packages are missing.
pip install -r requirements.txt does not help.
IntelliJ needs to be configured for Python. It does not natively use the same environment as your CLI
- First, make sure you have installed the Python plugin
- Then go to File -> Project Structure -> Platform Settings -> SDKs -> Add Python SDKS (https://www.jetbrains.com/help/idea/configuring-python-sdk.html)
- Please ensure that you configure the python interpeter at this point while adding the SDK https://www.jetbrains.com/help/idea/configuring-local-python-interpreters.html
- Go to Tools menu -> Sync Python Requirements.
If you didn't configure the interpreter when adding the SDK, this step will require you to configure a python interpreter
- You will then get a popup for Sync Python Requirements. https://www.jetbrains.com/help/idea/managing-dependencies.html
- Following the above setup, when you open the requirements.txt file, you should get this banner
- Depending on how you configured your interpreter, clicking Install may require admin privileges
- If you approve, you will then be given a list of packages to approve the installation of.
Once your SDK is configured, you can install each package individually (and manually) via the project Structure -> SDK ->Packages interface.
- Once the packages have been installed via either method above, Snyk scan can proceed as normal through the IDE plugin