Using python 3.12.1 on z/OS UNIX. Using a venv to install various libs. Google chromium depot tools uses python and six to get code from a git repo.
TODO: This was originally written for the six github issues tracker.
- python 3.12.1
- six 1.16.0 (six-1.16.0-py2.py3-none-any.whl.metadata)
- z/OS
The explicit problem is that python fails to resolve six.moves.
Failed to fetch file gs://v8-wasm-spec-tests/3548183660d38fac0b5fc96171a19b1340ea902c for test/wasm-spec-tests/tests.tar.gz. [Err: Traceback (most recent call last):
File "/xxx/v8/third_party/depot_tools/external_bin/gsutil/gsutil_4.68/gsutil/gsutil", line 21, in <module>
gsutil.RunMain()
File "/xxx/v8/third_party/depot_tools/external_bin/gsutil/gsutil_4.68/gsutil/gsutil.py", line 121, in RunMain
import gslib.__main__
File "/xxx/v8/third_party/depot_tools/external_bin/gsutil/gsutil_4.68/gsutil/gslib/__main__.py", line 36, in <module>
from six.moves import configparser
ModuleNotFoundError: No module named 'six.moves'
- Force reinstall of six
$ pip install --ignore-installed six
- This was an attempt to ensure it was pulling fresh and not from cache.
- https://stackoverflow.com/a/56480777/1008596
- Force install fresh and not cached
$ pip install --ignore-installed six
- Each time, I noticed it was installing a cached version. I attempted this syntax but it still installed from cache
- https://stackoverflow.com/a/51838039/1008596
- Attempt to use six.moves from urllib3
$ pip install urllib3
- Remove
~/.cache
- Removing
~/.cache
was the only sure method for installing modules without using cached versions.
- Removing
- Modifying/Creating
PYTHON_EXECUTABLE
- This was a hit with Chromium in search terms, but this might be something used by CMake
- https://stackoverflow.com/a/77711547/1008596
Ensure a pristine setup
$ rm -rf ~/.cached venv
xxx@yyy zzz (main)
$ python3 --version
Python 3.12.1
xxx@yyy zzz (main)
No need to uses options on pip install since venv and .cached are removed.
$ python -m venv venv
xxx@yyy zzz (main)
$ . venv/bin/activate
(venv) xxx@yyy zzz (main)
$ python -m pip install -U pip
Requirement already satisfied: pip in ./venv/lib/python3.12/site-packages (23.3.2)
Collecting pip
Downloading pip-24.2-py3-none-any.whl.metadata (3.6 kB)
Downloading pip-24.2-py3-none-any.whl (1.8 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.8/1.8 MB 2.8 MB/s eta 0:00:00
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 23.3.2
Uninstalling pip-23.3.2:
Successfully uninstalled pip-23.3.2
Successfully installed pip-24.2
(venv) xxx@yyy zzz (main)
$ pip install six
Collecting six
Downloading six-1.16.0-py2.py3-none-any.whl.metadata (1.8 kB)
Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Installing collected packages: six
Successfully installed six-1.16.0
(venv) xxx@yyy zzz (main)
-
On z/OS UNIX,
type
is the equivalent ofwhich
on linux. -
NOTE: This simplified process has six.modules import working. There is hope! Something must be amiss with depot_tools.
$ type python
python is hashed (/xxxx/venv/bin/python)
(venv) xxx@yyy zzz (main)
$ python
Python 3.12.1 (heads/pyz_dev-3.12:fff9b52d2e, Feb 24 2024, 12:18:13) [Clang 14.0.0 (build 1465bdb)] on zos
Type "help", "copyright", "credits" or "license" for more information.
>>> from six.moves import configparser
>>>
Any advice is appreciated