You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ModuleNotFoundError: No module named 'pip' on github/codeql-action/analyze #1425
/opt/hostedtoolcache/CodeQL/0.0.0-20221123/x64/codeql/codeql version --format=terse
2.11.4
/home/runner/.cache/pypoetry/virtualenvs/my-project-SllqOPWN-py3.10/bin/python -c import os; import pip; print(os.path.dirname(os.path.dirname(pip.__file__)))
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'pip'
Error: The process '/home/runner/.cache/pypoetry/virtualenvs/my-project-SllqOPWN-py3.10/bin/python' failed with exit code 1
Error: The process '/home/runner/.cache/pypoetry/virtualenvs/my-project-SllqOPWN-py3.10/bin/python' failed with exit code 1
at ExecState._setResult (/home/runner/work/_actions/github/codeql-action/v2/node_modules/@actions/exec/lib/toolrunner.js:592:25)
at ExecState.CheckComplete (/home/runner/work/_actions/github/codeql-action/v2/node_modules/@actions/exec/lib/toolrunner.js:575:18)
at ChildProcess.<anonymous> (/home/runner/work/_actions/github/codeql-action/v2/node_modules/@actions/exec/lib/toolrunner.js:469:27)
at ChildProcess.emit (node:events:390:28)
at maybeClose (node:internal/child_process:1064:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
Happy to submit any other relevant information if anything's missing. Any guidance is appreciated!
Hi @jstoebel, thanks for reporting this problem. I looks like pip has not been installed in your virtual environment, which breaks all my assumptions about how things work 🤔
Looks over the docs for poetry, I see that virtualenvs.options.no-pip = true would probably cause this behavior, so I learned something today as well.
Can you confirm whether your poetry.toml has this option set?
@RasmusWLvirtualenvs.options.no-pip is not set in my pyproject.toml.
I was able to find a work around however. I was using github/codeql-action/autobuild@v2 to build the project in this job. I removed that and built the project the project the same way I do in other workflows.
Activity
RasmusWL commentedon Dec 9, 2022
Hi @jstoebel, thanks for reporting this problem. I looks like
piphas not been installed in your virtual environment, which breaks all my assumptions about how things work 🤔Looks over the docs for poetry, I see that
virtualenvs.options.no-pip = truewould probably cause this behavior, so I learned something today as well.Can you confirm whether your
poetry.tomlhas this option set?python-setup: Handle poetry `virtualenvs.options.no-pip = true`
hstoebel commentedon Dec 9, 2022
@RasmusWL
virtualenvs.options.no-pipis not set in my pyproject.toml.I was able to find a work around however. I was using
github/codeql-action/autobuild@v2to build the project in this job. I removed that and built the project the project the same way I do in other workflows.python-setup: Handle poetry `virtualenvs.options.no-pip = true`
python-setup: Handle poetry `virtualenvs.options.no-pip = true`