akamai / cli-cloudlets

Akamai CLI for Cloudlets allows you to work with cloudlets from the Command Line
Apache License 2.0
3 stars 9 forks source link

Cannot install with macOS #28

Closed benjifisher closed 1 month ago

benjifisher commented 3 months ago

I am using macOS, and I have installed the akamai CLI tool with Homebrew:

% which akamai
/opt/homebrew/bin/akamai
% akamai --version
akamai version 1.5.6
% brew info akamai
==> akamai: stable 1.5.6 (bottled)
...

I have installed other sub-commands without any problems: property-manager and edgeworkers.

When I try to install this package, I get an error:

% akamai install cloudlets
Attempting to fetch command from https://github.com/akamai/cli-cloudlets.git... [OK]
Installing... [===       ] ERROR[0001] unable to execute 'python3 -m pip install --user --no-cache --upgrade pip setuptools': error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try brew install
    xyz, where xyz is the package you are trying to
    install.

    If you wish to install a Python library that isn't in Homebrew,
    use a virtual environment:

    python3 -m venv path/to/venv
    source path/to/venv/bin/activate
    python3 -m pip install xyz

    If you wish to install a Python application that isn't in Homebrew,
    it may be easiest to use 'pipx install xyz', which will manage a
    virtual environment for you. You can install pipx with

    brew install pipx

    You may restore the old behavior of pip by passing
    the '--break-system-packages' flag to pip, or by adding
    'break-system-packages = true' to your pip.conf file. The latter
    will permanently disable this error.

    If you disable this error, we STRONGLY recommend that you additionally
    pass the '--user' flag to pip, or set 'user = true' in your pip.conf
    file. Failure to do this can result in a broken Homebrew installation.

    Read more about this behavior here: <https://peps.python.org/pep-0668/>

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

I also tried downloading this repository to ~/.akamai/src/, but I get the same error message when I try akamai help cloudlets.

I also use python3 installed with Homebrew:

% which python3  
/opt/homebrew/bin/python3
% python3 --version
Python 3.12.3
% /usr/bin/python3 --version
Python 3.9.6
pwongcha commented 2 months ago

@benjifisher are you still having issue?

benjifisher commented 2 months ago

@pwongcha:

Yes. I just tried again, and I get the same error message.

pwongcha commented 2 months ago

@benjifisher, can you run export AKAMAI_LOG=debug before akamai install cloudlet? What's the output?

benjifisher commented 2 months ago

@pwongcha:

This is what I get:

% export AKAMAI_LOG=debug
% akamai install cloudlets
 DEBUG[0000] INSTALL START             command=install
Attempting to fetch command from https://github.com/akamai/cli-cloudlets.git... [OK]
 DEBUG[0000] Validating dependencies for python 3.0.0 module command=install
 DEBUG[0000] Python binary found: /opt/homebrew/bin/python3 command=install
 DEBUG[0000] /opt/homebrew/bin/python3 --version: Python 3.12.3 command=install
Installing... [=         ] DEBUG[0000] /opt/homebrew/bin/python3 -m pip --version pip 24.0 from /opt/homebrew/lib/python3.12/site-packages/pip (python 3.12): %!s(MISSING) command=install
 DEBUG[0000] /opt/homebrew/bin/python3 -m venv --version usage: venv [-h] [--system-site-packages] [--symlinks | --copies] [--clear]            [--upgrade] [--without-pip] [--prompt PROMPT] [--upgrade-deps]            ENV_DIR [ENV_DIR ...]venv: error: the following arguments are required: ENV_DIR: %!s(MISSING) command=install
 DEBUG[0000] the virtual environment /Users/benji/.akamai-cli/venv/cli-cloudlets does not exist yet - installing dependencies command=install
 DEBUG[0000] /opt/homebrew/bin/python3 --version: Python 3.12.3 command=install
 DEBUG[0000] Installing/upgrading pip  command=install
Installing... [==        ]  WARN[0001] %!w(*errors.errorString=&{unable to install/upgrade pip}): error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try brew install
    xyz, where xyz is the package you are trying to
    install.

    If you wish to install a Python library that isn't in Homebrew,
    use a virtual environment:

    python3 -m venv path/to/venv
    source path/to/venv/bin/activate
    python3 -m pip install xyz

    If you wish to install a Python application that isn't in Homebrew,
    it may be easiest to use 'pipx install xyz', which will manage a
    virtual environment for you. You can install pipx with

    brew install pipx

    You may restore the old behavior of pip by passing
    the '--break-system-packages' flag to pip, or by adding
    'break-system-packages = true' to your pip.conf file. The latter
    will permanently disable this error.

    If you disable this error, we STRONGLY recommend that you additionally
    pass the '--user' flag to pip, or set 'user = true' in your pip.conf
    file. Failure to do this can result in a broken Homebrew installation.

    Read more about this behavior here: <https://peps.python.org/pep-0668/>

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/opt/homebrew/Cellar/python@3.12/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/ensurepip/__main__.py", line 5, in <module>
    sys.exit(ensurepip._main())
             ^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.12/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/ensurepip/__init__.py", line 284, in _main
    return _bootstrap(
           ^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.12/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/ensurepip/__init__.py", line 200, in _bootstrap
    return _run_pip([*args, *_PACKAGE_NAMES], additional_paths)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.12/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/ensurepip/__init__.py", line 101, in _run_pip
    return subprocess.run(cmd, check=True).returncode
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.12/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/opt/homebrew/opt/python@3.12/bin/python3.12', '-W', 'ignore::DeprecationWarning', '-c', '\nimport runpy\nimport sys\nsys.path = [\'/var/folders/c4/bmkmx3413yj1wcfhbv25krn40000gp/T/tmpvrrt9q0p/pip-24.0-py3-none-any.whl\'] + sys.path\nsys.argv[1:] = [\'install\', \'--no-cache-dir\', \'--no-index\', \'--find-links\', \'/var/folders/c4/bmkmx3413yj1wcfhbv25krn40000gp/T/tmpvrrt9q0p\', \'--upgrade\', \'pip\']\nrunpy.run_module("pip", run_name="__main__", alter_sys=True)\n']' returned non-zero exit status 1.
 command=install
 DEBUG[0001] Installing/upgrading pip & setuptools command=install
Installing... [===       ] ERROR[0001] unable to execute 'python3 -m pip install --user --no-cache --upgrade pip setuptools': error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try brew install
    xyz, where xyz is the package you are trying to
    install.

    If you wish to install a Python library that isn't in Homebrew,
    use a virtual environment:

    python3 -m venv path/to/venv
    source path/to/venv/bin/activate
    python3 -m pip install xyz

    If you wish to install a Python application that isn't in Homebrew,
    it may be easiest to use 'pipx install xyz', which will manage a
    virtual environment for you. You can install pipx with

    brew install pipx

    You may restore the old behavior of pip by passing
    the '--break-system-packages' flag to pip, or by adding
    'break-system-packages = true' to your pip.conf file. The latter
    will permanently disable this error.

    If you disable this error, we STRONGLY recommend that you additionally
    pass the '--user' flag to pip, or set 'user = true' in your pip.conf
    file. Failure to do this can result in a broken Homebrew installation.

    Read more about this behavior here: <https://peps.python.org/pep-0668/>

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

[notice] A new release of pip is available: 24.0 -> 24.1.2
[notice] To update, run: python3.12 -m pip install --upgrade pip
 command=install
 DEBUG[0001] Deactivating virtual environment /Users/benji/.akamai-cli/venv/cli-cloudlets command=install
 DEBUG[0001] Python virtualenv deactivated command=install
 DEBUG[0001] All virtualenv dependencies successfully installed command=install
 ERROR[0001] unable to execute 'python3 -m pip install --user --no-cache --upgrade pip setuptools': error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try brew install
    xyz, where xyz is the package you are trying to
    install.

    If you wish to install a Python library that isn't in Homebrew,
    use a virtual environment:

    python3 -m venv path/to/venv
    source path/to/venv/bin/activate
    python3 -m pip install xyz

    If you wish to install a Python application that isn't in Homebrew,
    it may be easiest to use 'pipx install xyz', which will manage a
    virtual environment for you. You can install pipx with

    brew install pipx

    You may restore the old behavior of pip by passing
    the '--break-system-packages' flag to pip, or by adding
    'break-system-packages = true' to your pip.conf file. The latter
    will permanently disable this error.

    If you disable this error, we STRONGLY recommend that you additionally
    pass the '--user' flag to pip, or set 'user = true' in your pip.conf
    file. Failure to do this can result in a broken Homebrew installation.

    Read more about this behavior here: <https://peps.python.org/pep-0668/>

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

[notice] A new release of pip is available: 24.0 -> 24.1.2
[notice] To update, run: python3.12 -m pip install --upgrade pip
 command=install
Installing... [FAIL]
unable to execute 'python3 -m pip install --user --no-cache --upgrade pip setuptools': error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try brew install
    xyz, where xyz is the package you are trying to
    install.

    If you wish to install a Python library that isn't in Homebrew,
    use a virtual environment:

    python3 -m venv path/to/venv
    source path/to/venv/bin/activate
    python3 -m pip install xyz

    If you wish to install a Python application that isn't in Homebrew,
    it may be easiest to use 'pipx install xyz', which will manage a
    virtual environment for you. You can install pipx with

    brew install pipx

    You may restore the old behavior of pip by passing
    the '--break-system-packages' flag to pip, or by adding
    'break-system-packages = true' to your pip.conf file. The latter
    will permanently disable this error.

    If you disable this error, we STRONGLY recommend that you additionally
    pass the '--user' flag to pip, or set 'user = true' in your pip.conf
    file. Failure to do this can result in a broken Homebrew installation.

    Read more about this behavior here: <https://peps.python.org/pep-0668/>

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

[notice] A new release of pip is available: 24.0 -> 24.1.2
[notice] To update, run: python3.12 -m pip install --upgrade pip

 ERROR[0001] unable to execute 'python3 -m pip install --user --no-cache --upgrade pip setuptools': error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try brew install
    xyz, where xyz is the package you are trying to
    install.

    If you wish to install a Python library that isn't in Homebrew,
    use a virtual environment:

    python3 -m venv path/to/venv
    source path/to/venv/bin/activate
    python3 -m pip install xyz

    If you wish to install a Python application that isn't in Homebrew,
    it may be easiest to use 'pipx install xyz', which will manage a
    virtual environment for you. You can install pipx with

    brew install pipx

    You may restore the old behavior of pip by passing
    the '--break-system-packages' flag to pip, or by adding
    'break-system-packages = true' to your pip.conf file. The latter
    will permanently disable this error.

    If you disable this error, we STRONGLY recommend that you additionally
    pass the '--user' flag to pip, or set 'user = true' in your pip.conf
    file. Failure to do this can result in a broken Homebrew installation.

    Read more about this behavior here: <https://peps.python.org/pep-0668/>

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

[notice] A new release of pip is available: 24.0 -> 24.1.2
[notice] To update, run: python3.12 -m pip install --upgrade pip
 command=install
 ERROR[0001] INSTALL ERROR: Unable to install selected package command=install
Unable to install selected package
pwongcha commented 2 months ago

Hi @benjifisher, I will return from vacation next Wednesday. Would you like a quick session to troubleshoot this together? My working hour is CST, please feel free to send an invite to pwongcha@akamai.com anytime between 9-5 PM CST

In the meantime, what are the output from 3 commands ?

You can try add this to your $HOME/.config/pip/pip.conf file:

[global]
break-system-packages = true

Then run

  1. rm -rf /Users/benji/.akamai-cli/venv/cli-cloudlets
  2. export AKAMAI_LOG=debug
  3. akamai install cloudlets
benjifisher commented 2 months ago

@pwongcha:

Thanks! I will send you an invitation.

For now,

% pip3 config list -v
For variant 'global', will try loading '/Library/Application Support/pip/pip.conf'
For variant 'user', will try loading '/Users/benji/.pip/pip.conf'
For variant 'user', will try loading '/Users/benji/.config/pip/pip.conf'
For variant 'site', will try loading '/opt/homebrew/opt/python@3.12/Frameworks/Python.framework/Versions/3.12/pip.conf'

% python3 -m pip install –upgrade pip
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try brew install
    xyz, where xyz is the package you are trying to
    install.

    If you wish to install a Python library that isn't in Homebrew,
    use a virtual environment:

    python3 -m venv path/to/venv
    source path/to/venv/bin/activate
    python3 -m pip install xyz

    If you wish to install a Python application that isn't in Homebrew,
    it may be easiest to use 'pipx install xyz', which will manage a
    virtual environment for you. You can install pipx with

    brew install pipx

    You may restore the old behavior of pip by passing
    the '--break-system-packages' flag to pip, or by adding
    'break-system-packages = true' to your pip.conf file. The latter
    will permanently disable this error.

    If you disable this error, we STRONGLY recommend that you additionally
    pass the '--user' flag to pip, or set 'user = true' in your pip.conf
    file. Failure to do this can result in a broken Homebrew installation.

    Read more about this behavior here: <https://peps.python.org/pep-0668/>

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

[notice] A new release of pip is available: 24.0 -> 24.1.2
[notice] To update, run: python3.12 -m pip install --upgrade pip

% ls -lta /opt/homebrew/Cellar/python@3.12/3.12.3
total 88
drwxr-xr-x  14 benji  staff    448 May 20 12:57 .
-rw-r--r--   1 benji  staff   8922 May 20 12:57 sbom.spdx.json
-rw-r--r--   1 benji  staff   2882 May 20 12:57 INSTALL_RECEIPT.json
drwxr-xr-x  16 benji  staff    512 May 20 12:57 bin
drwxr-xr-x   4 benji  staff    128 May 20 12:56 ..
drwxr-xr-x   3 benji  staff     96 Apr  9 04:09 .brew
drwxr-xr-x   3 benji  staff     96 Apr  9 04:09 Frameworks
drwxr-xr-x   3 benji  staff     96 Apr  9 04:09 IDLE 3.app
-rw-r--r--   1 benji  staff  13936 Apr  9 04:09 LICENSE
drwxr-xr-x   3 benji  staff     96 Apr  9 04:09 Python Launcher 3.app
-rw-r--r--   1 benji  staff   8703 Apr  9 04:09 README.rst
drwxr-xr-x   3 benji  staff     96 Apr  9 04:09 lib
drwxr-xr-x   4 benji  staff    128 Apr  9 04:09 libexec
drwxr-xr-x   3 benji  staff     96 Apr  9 04:09 share

I created ~/.config/pip/ and added the suggested lines to pip.conf in that directory. Then

% rm -rf /Users/benji/.akamai-cli/venv/cli-cloudlets
% export AKAMAI_LOG=debug
% akamai install cloudlets
 DEBUG[0000] INSTALL START             command=install
Attempting to fetch command from https://github.com/akamai/cli-cloudlets.git... [OK]
 DEBUG[0000] Validating dependencies for python 3.0.0 module command=install
 DEBUG[0000] Python binary found: /opt/homebrew/bin/python3 command=install
 DEBUG[0000] /opt/homebrew/bin/python3 --version: Python 3.12.3 command=install
Installing... [=         ] DEBUG[0000] /opt/homebrew/bin/python3 -m pip --version pip 24.0 from /opt/homebrew/lib/python3.12/site-packages/pip (python 3.12): %!s(MISSING) command=install
 DEBUG[0000] /opt/homebrew/bin/python3 -m venv --version usage: venv [-h] [--system-site-packages] [--symlinks | --copies] [--clear]            [--upgrade] [--without-pip] [--prompt PROMPT] [--upgrade-deps]            ENV_DIR [ENV_DIR ...]venv: error: the following arguments are required: ENV_DIR: %!s(MISSING) command=install
 DEBUG[0000] the virtual environment /Users/benji/.akamai-cli/venv/cli-cloudlets does not exist yet - installing dependencies command=install
 DEBUG[0000] /opt/homebrew/bin/python3 --version: Python 3.12.3 command=install
 DEBUG[0000] Installing/upgrading pip  command=install
Installing... [==        ]  WARN[0001] %!w(*errors.errorString=&{unable to install/upgrade pip}): error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try brew install
    xyz, where xyz is the package you are trying to
    install.

    If you wish to install a Python library that isn't in Homebrew,
    use a virtual environment:

    python3 -m venv path/to/venv
    source path/to/venv/bin/activate
    python3 -m pip install xyz

    If you wish to install a Python application that isn't in Homebrew,
    it may be easiest to use 'pipx install xyz', which will manage a
    virtual environment for you. You can install pipx with

    brew install pipx

    You may restore the old behavior of pip by passing
    the '--break-system-packages' flag to pip, or by adding
    'break-system-packages = true' to your pip.conf file. The latter
    will permanently disable this error.

    If you disable this error, we STRONGLY recommend that you additionally
    pass the '--user' flag to pip, or set 'user = true' in your pip.conf
    file. Failure to do this can result in a broken Homebrew installation.

    Read more about this behavior here: <https://peps.python.org/pep-0668/>

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/opt/homebrew/Cellar/python@3.12/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/ensurepip/__main__.py", line 5, in <module>
    sys.exit(ensurepip._main())
             ^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.12/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/ensurepip/__init__.py", line 284, in _main
    return _bootstrap(
           ^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.12/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/ensurepip/__init__.py", line 200, in _bootstrap
    return _run_pip([*args, *_PACKAGE_NAMES], additional_paths)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.12/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/ensurepip/__init__.py", line 101, in _run_pip
    return subprocess.run(cmd, check=True).returncode
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.12/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/opt/homebrew/opt/python@3.12/bin/python3.12', '-W', 'ignore::DeprecationWarning', '-c', '\nimport runpy\nimport sys\nsys.path = [\'/var/folders/c4/bmkmx3413yj1wcfhbv25krn40000gp/T/tmpc5c6xidp/pip-24.0-py3-none-any.whl\'] + sys.path\nsys.argv[1:] = [\'install\', \'--no-cache-dir\', \'--no-index\', \'--find-links\', \'/var/folders/c4/bmkmx3413yj1wcfhbv25krn40000gp/T/tmpc5c6xidp\', \'--upgrade\', \'pip\']\nrunpy.run_module("pip", run_name="__main__", alter_sys=True)\n']' returned non-zero exit status 1.
 command=install
 DEBUG[0001] Installing/upgrading pip & setuptools command=install
Installing... [====      ] ERROR[0002] unable to execute 'python3 -m pip install --user --no-cache --upgrade pip setuptools': Requirement already satisfied: pip in /opt/homebrew/lib/python3.12/site-packages (24.0)
Collecting pip
  Downloading pip-24.1.2-py3-none-any.whl.metadata (3.6 kB)
Requirement already satisfied: setuptools in /opt/homebrew/lib/python3.12/site-packages (70.0.0)
Collecting setuptools
  Downloading setuptools-70.3.0-py3-none-any.whl.metadata (5.8 kB)
Downloading pip-24.1.2-py3-none-any.whl (1.8 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.8/1.8 MB 14.7 MB/s eta 0:00:00
Downloading setuptools-70.3.0-py3-none-any.whl (931 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 931.1/931.1 kB 40.4 MB/s eta 0:00:00
Installing collected packages: setuptools, pip
  Attempting uninstall: setuptools
    Found existing installation: setuptools 70.0.0
ERROR: Cannot uninstall setuptools 70.0.0, RECORD file not found. Hint: The package was installed by brew.

[notice] A new release of pip is available: 24.0 -> 24.1.2
[notice] To update, run: python3.12 -m pip install --upgrade pip
 command=install
 DEBUG[0002] Deactivating virtual environment /Users/benji/.akamai-cli/venv/cli-cloudlets command=install
 DEBUG[0002] Python virtualenv deactivated command=install
 DEBUG[0002] All virtualenv dependencies successfully installed command=install
 ERROR[0002] unable to execute 'python3 -m pip install --user --no-cache --upgrade pip setuptools': Requirement already satisfied: pip in /opt/homebrew/lib/python3.12/site-packages (24.0)
Collecting pip
  Downloading pip-24.1.2-py3-none-any.whl.metadata (3.6 kB)
Requirement already satisfied: setuptools in /opt/homebrew/lib/python3.12/site-packages (70.0.0)
Collecting setuptools
  Downloading setuptools-70.3.0-py3-none-any.whl.metadata (5.8 kB)
Downloading pip-24.1.2-py3-none-any.whl (1.8 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.8/1.8 MB 14.7 MB/s eta 0:00:00
Downloading setuptools-70.3.0-py3-none-any.whl (931 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 931.1/931.1 kB 40.4 MB/s eta 0:00:00
Installing collected packages: setuptools, pip
  Attempting uninstall: setuptools
    Found existing installation: setuptools 70.0.0
ERROR: Cannot uninstall setuptools 70.0.0, RECORD file not found. Hint: The package was installed by brew.

[notice] A new release of pip is available: 24.0 -> 24.1.2
[notice] To update, run: python3.12 -m pip install --upgrade pip
 command=install
Installing... [FAIL]
unable to execute 'python3 -m pip install --user --no-cache --upgrade pip setuptools': Requirement already satisfied: pip in /opt/homebrew/lib/python3.12/site-packages (24.0)
Collecting pip
  Downloading pip-24.1.2-py3-none-any.whl.metadata (3.6 kB)
Requirement already satisfied: setuptools in /opt/homebrew/lib/python3.12/site-packages (70.0.0)
Collecting setuptools
  Downloading setuptools-70.3.0-py3-none-any.whl.metadata (5.8 kB)
Downloading pip-24.1.2-py3-none-any.whl (1.8 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.8/1.8 MB 14.7 MB/s eta 0:00:00
Downloading setuptools-70.3.0-py3-none-any.whl (931 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 931.1/931.1 kB 40.4 MB/s eta 0:00:00
Installing collected packages: setuptools, pip
  Attempting uninstall: setuptools
    Found existing installation: setuptools 70.0.0
ERROR: Cannot uninstall setuptools 70.0.0, RECORD file not found. Hint: The package was installed by brew.

[notice] A new release of pip is available: 24.0 -> 24.1.2
[notice] To update, run: python3.12 -m pip install --upgrade pip

 ERROR[0002] unable to execute 'python3 -m pip install --user --no-cache --upgrade pip setuptools': Requirement already satisfied: pip in /opt/homebrew/lib/python3.12/site-packages (24.0)
Collecting pip
  Downloading pip-24.1.2-py3-none-any.whl.metadata (3.6 kB)
Requirement already satisfied: setuptools in /opt/homebrew/lib/python3.12/site-packages (70.0.0)
Collecting setuptools
  Downloading setuptools-70.3.0-py3-none-any.whl.metadata (5.8 kB)
Downloading pip-24.1.2-py3-none-any.whl (1.8 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.8/1.8 MB 14.7 MB/s eta 0:00:00
Downloading setuptools-70.3.0-py3-none-any.whl (931 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 931.1/931.1 kB 40.4 MB/s eta 0:00:00
Installing collected packages: setuptools, pip
  Attempting uninstall: setuptools
    Found existing installation: setuptools 70.0.0
ERROR: Cannot uninstall setuptools 70.0.0, RECORD file not found. Hint: The package was installed by brew.

[notice] A new release of pip is available: 24.0 -> 24.1.2
[notice] To update, run: python3.12 -m pip install --upgrade pip
 command=install
 ERROR[0002] INSTALL ERROR: Unable to install selected package command=install
Unable to install selected package

Without looking too closely, I would say that is the same behavior as before.

I also added pip.conf to the directory inside /opt/homebrew/ and tried again, with similar results.

pwongcha commented 1 month ago

Met with @benjifisher and resolve installation issue

Solution:

  1. Uninstall python installed via brew
  2. Install python via pyenv
  3. Install cloudlet-cli
pwongcha commented 1 month ago

@benjifisher, could you please upload errors from akamai cloudlets list command when you get a minute?

benjifisher commented 1 month ago

@pwongcha:

Here are the error messages:

% akamai cloudlets -s default list
...fetching policy list
Traceback (most recent call last):
  File "/Users/benji/.akamai-cli/src/cli-cloudlets/bin/akamai-cloudlets.py", line 1439, in <module>
    cli_status = cli(prog_name='akamai cloudlets')
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/benji/.akamai-cli/venv/cli-cloudlets/lib/python3.12/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/benji/.akamai-cli/venv/cli-cloudlets/lib/python3.12/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/Users/benji/.akamai-cli/venv/cli-cloudlets/lib/python3.12/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/benji/.akamai-cli/venv/cli-cloudlets/lib/python3.12/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/benji/.akamai-cli/venv/cli-cloudlets/lib/python3.12/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/benji/.akamai-cli/venv/cli-cloudlets/lib/python3.12/site-packages/click/decorators.py", line 84, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/benji/.akamai-cli/venv/cli-cloudlets/lib/python3.12/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/benji/.akamai-cli/src/cli-cloudlets/bin/akamai-cloudlets.py", line 222, in list
    if len(shared_policies) == 0:
       ^^^^^^^^^^^^^^^^^^^^
TypeError: object of type 'Response' has no len()
pwongcha commented 1 month ago

@benjifisher, please let me know here or via email if you get result back from akamai cloudlets list after resolve API access issue.

benjifisher commented 1 month ago

@pwongcha:

Yes, I get results from akamai cloudlets list now, and also akamai cloudlets retrieve --policy=....

Looking at my shell's history, I think these were the relevant steps:

brew uninstall --ignore-dependencies --force python@3.12
brew install pyenv
pyenv install 3.12
pyenv versions
pyenv global 3.12.4
akamai install cloudlets

In fact, I think I did not have to uninstall python at the start. I can say for sure that it is now installed. I guess that pyenv install 3.12 uses brew to install python.