VK-GL-CTS
VK-GL-CTS copied to clipboard
error when trying to build vulkancts on linux
Distro: Garuda Linux Kernel: 5.18.3-zen1-1-zen arch: x86_64 bits: 64 compiler: gcc v: 12.1.0 Python Version: Python 3.10.5
When following instructions for Vulkan CTS README, I tried to run python3 external/fetch_sources.py
to download the sources, the following error pops up on my command line:
Traceback (most recent call last):
File "/home/
When I run pip install build
, the following is printed to console:
Defaulting to user installation because normal site-packages is not writeable Requirement already satisfied: build in /usr/lib/python3.10/site-packages (0.8.0) Requirement already satisfied: packaging>=19.0 in /usr/lib/python3.10/site-packages (from build) (21.3) Requirement already satisfied: pep517>=0.9.1 in /usr/lib/python3.10/site-packages (from build) (0.12.0) Requirement already satisfied: tomli>=1.0.0 in /usr/lib/python3.10/site-packages (from build) (2.0.1) Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /usr/lib/python3.10/site-packages (from packaging>=19.0->build) (3.0.9)
I get the same "ModuleNotFoundError: No module named 'build.common'" message on the command line
If I do pip install build.common
, the following is printed:
Defaulting to user installation because normal site-packages is not writeable ERROR: Could not find a version that satisfies the requirement build.common (from versions: none) ERROR: No matching distribution found for build.common
It seems like my interpreter is unable to find any module named common in the package called build for python version 3.10.5. This is imported in external)/fetch_sources.py line 35.
How do I resolve this ? Thanks!
build.common is located here https://github.com/KhronosGroup/VK-GL-CTS/tree/main/scripts/build/common.py
The import includes the path with this line from fetch_sources:
sys.path.append(os.path.join(os.path.dirname(file), "..", "scripts"))
Not sure why your build isn't finding this file to import, the package manager could be getting confused with the installed module or something. It would be good to check your tree to make sure common.py exists.
Hi, I have checked and confirmed that common.py does reside in /VK-GL-CTS/scripts/build
I understand that sys.path.append(os.path.join(os.path.dirname(file), "..", "scripts")) will let the intepreter look for the build module in /scripts however that doesn't seem to be the case.
When I add print(sys.path)
after sys.path.append(os.path.join(os.path.dirname(__file__), "..", "scripts"))
, I see /home/<USER>/Documents/projects/vulkan/VK-GL-CTS/external
printed out on the console as the first entry in $PATH
I have found that sys.path.append(os.path.join(os.path.dirname(__file__), "..", "scripts"))
adds the path to the end of the sys.path variable like this:
But when I replace it with sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "scripts"))
, it works and the path is added to the beginning of sys.path shown here:
The latter change works for me but the only thing I don't understand is why /home/<USER>/Documents/projects/vulkan/VK-GL-CTS/external added to the beginning of sys.path when only sys.path.append(os.path.join(os.path.dirname(__file__), "..", "scripts"))
is executed.
The latter change works for me but the only thing I don't understand is why /home//Documents/projects/vulkan/VK-GL-CTS/external added to the beginning of sys.path when only sys.path.append(os.path.join(os.path.dirname(file), "..", "scripts")) is executed.
I wouldn't expect this to be the case, have you tried printing sys.path before this command?
It looks like there's a name collision with a pip package named "build" (e.g. Arch). A quick solution is to uninstall it. If that isn't viable, create a venv.
A fix for this is under review in Khronos. It renames the CTS "build" package to "ctsbuild" to avoid name conflicts.
Fixed in https://github.com/KhronosGroup/VK-GL-CTS/commit/125aa9d5da7efec78f178dbf50c07a90213b93de