在Mac安装阿里巴巴新神器copaw

仓库地址: https://github.com/agentscope-ai/CoPaw
官方简介:Your Personal AI Assistant; easy to install, deploy on your own machine or on the cloud; supports multiple chat apps with easily extensible capabilities.


安装过程

这里记录我的安装过程,因为坑太多了。

本来是用docker安装的,非常简单快捷;但是安装好以后发现在容器里面它的权限太低了,几乎啥也干不了,所以重新本地安装

1. pip install copaw

结果这条命令我都执行不了:

pip install copaw
zsh: command not found: pip

因为我本地的是pip3。但是也不行:

pip3 install copaw
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.

难道让我用brew安装?
结果

Warning: No available formula with the name "copaw". Did you mean copa or opa?
==> Searching for similarly named formulae and casks...
==> Formulae
copa          opa

问了AI,让我用pipx

brew install pipx
pipx ensurepath
 
Success! Added /Users/your/.local/bin to the PATH environment variable.

然后重新安装,结果又报错:

pipx install copaw

pip seemed to fail to build package:
    python-dotenv>=1.0.0

Some possibly relevant errors from pip install:
    ERROR: Ignored the following versions that require a different python version: 0.0.2 Requires-Python >=3.10,<=3.13; 0.0.2b1 Requires-Python >=3.10,<=3.13; 0.0.2b2 Requires-Python >=3.10,<=3.13; 0.0.3 Requires-Python >=3.10,<3.14; 0.0.3b1 Requires-Python >=3.10,<3.14; 0.0.3b2 Requires-Python >=3.10,<3.14; 0.0.4 Requires-Python >=3.10,<3.14; 0.0.4b1 Requires-Python >=3.10,<3.14; 0.0.4b2 Requires-Python >=3.10,<3.14; 0.0.4b3 Requires-Python >=3.10,<3.14; 1.7.0 Requires-Python >=3.6,<3.10; 1.8.0 Requires-Python >=3.6,<3.10; 1.8.1 Requires-Python >=3.6,<3.10; 1.9.0 Requires-Python >=3.6,<3.10
    ERROR: Could not find a version that satisfies the requirement onnxruntime<1.24 (from copaw) (from versions: none)
    ERROR: No matching distribution found for onnxruntime<1.24

Error installing copaw.

继续问AI,说python版本太高了...
降低版本:

brew install python@3.11

Python is installed as
  /usr/local/bin/python3.11

继续安装,终于成功了!

pipx install --python /usr/local/bin/python3.11 copaw
  installed package copaw 0.0.4, installed using Python 3.11.14
  These apps are now globally available
    - copaw
⚠️  Note: '/Users/your/.local/bin' is not on your PATH environment variable. These apps will not be globally accessible until your PATH is updated. Run `pipx ensurepath` to automatically add it,
    or manually modify your PATH in your shell's config file (e.g. ~/.bashrc).
done! ✨ 🌟 ✨

2. copaw init --defaults

你猜怎么,报错。

你也许会说:上面不是说了不能直接用嘛!
还是你聪明:

copaw init --defaults
zsh: command not found: copaw

于是

pipx ensurepath
source ~/.zshrc
copaw init --defaults

终于好了!

posted @ 2026-03-03 17:29  大卫小东(Sheldon)  阅读(0)  评论(0)    收藏  举报