Repository navigation
Description
Description:
When following instructions to set up an Ubuntu 20.04 self-hosted runner's tool cache with Python 3.10, subsequently running a workflow that checks out the repo, sets up python, sets up the scottbrenner/cfn-lint-action@v2 action, and then runs cfn-lint --version results in the following error:
Traceback (most recent call last):
File "/opt/hostedtoolcache/Python/3.10.0/x64/lib/python3.10/subprocess.py", line 69, in <module>
import msvcrt
ModuleNotFoundError: No module named 'msvcrt'
Deploying the Python tool cache into the Actions runner client's _work/_tool directory results in a successful run of cfn-lint --version, but then with other workflows encounters errors building Docker containers.
Action version:
actions/setup-python@v2
Platform:
- Ubuntu
- macOS
- Windows
Runner type:
- Hosted
- Self-hosted
Tools version:
3.10 (others untested)
Repro steps:
- Build tool cache with following workflow step:
- name: Setup Python 3.10
uses: actions/setup-python@v2
with:
python-version: '3.10'
-
As per
setup-pythoninstructions for deploying to hosted tool cache on Linux, copy and extract artifact to/opt/hostedtoolcache/ -
Attempt to run the following workflow:
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Setup Cloud Formation Linter with Latest Version
uses: scottbrenner/cfn-lint-action@v2
- name: Print the Cloud Formation Linter Version & run Linter.
run: |
cfn-lint --version
cfn-lint
Expected behavior:
Successful run of second workflow, with an output similar to the following:
cfn-lint 0.55.0
Actual behavior:
Receive output similar to the following:
/opt/hostedtoolcache/Python/3.10.0/x64/bin/python3 --version
Python 3.10.0
/opt/hostedtoolcache/Python/3.10.0/x64/bin/python3 -m venv /tmp/setup-cfn-lint-3DRQLm/.venv
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Traceback (most recent call last):
File "/opt/hostedtoolcache/Python/3.10.0/x64/lib/python3.10/subprocess.py", line 69, in <module>
import msvcrt
ModuleNotFoundError: No module named 'msvcrt'
....
File "/opt/hostedtoolcache/Python/3.10.0/x64/lib/python3.10/subprocess.py", line 74, in <module>
import _posixsubprocess
ModuleNotFoundError: No module named '_posixsubprocess'
The output is very unusual, as it references module msvcrt (Microsoft VC++ runtime), despite nothing in the workflow, Python build, or Actions runner involving Windows or the VC++ runtime.
Activity
misbahfhm commentedon Jan 6, 2022
how was it?
Was it solved?
I have a same problem there
vineet-codes256 commentedon Jan 31, 2022
I am also facing the same issue…
sanxchep commentedon Mar 17, 2022
same and im using on Ubuntu 20.04
dsame commentedon Apr 8, 2022
Hello @mikedalton,
I do not clearly understand your self-hosted agent setup. The README mentions AGENT_TOOLSDIRECTORY variable and i see no use of it in your steps.
As a quick workaround, please try your workflow avoiding AGENT_TOOLSDIRECTORY at all. See the sample build to understand what i mean:
https://github.com/akv-platform/python-msvcrt/runs/5880925955?check_suite_focus=true
and the corresponding workflow
https://github.com/akv-platform/python-msvcrt/actions/runs/2113585786/workflow
Despite it works or does not, please describe your current setup in order we could improve the documentation
/opt/hostedtoolcacheand gran write permission on it to runner user - yes/no?actions/setup-python@v2withyes/no?
WARN: you may face
Error: Version 3.10.4 with arch x64 not foundmessage on the 2nd step. In the case please wait for #338 to be mergeddsame commentedon Apr 20, 2022
Hello @mikedalton,
Just a gentle ping, we could use an update on this issue :)
marko-zivic-93 commentedon Apr 27, 2022
Hello @mikedalton
Due to the lack of response, I am going to close this issue :)
If you have any additional problems or concerns, please feel free to reopen it or to create a new one.