crawl4ai
一款开源特别好用的 ai 爬虫框架
注意cpu启动方法:后面一定要加–cpu,不然报错。
nohup python main.py –cpu –listen 0.0.0.0 &
macOS和linux安装步骤很相似 可以按照1️⃣安装anaconda2️⃣安装python3️⃣torch4️⃣comfyui
推荐安装minianaconda
Anaconda3-2023.x.x-MacOSX-x86_64.sh
或 Anaconda3-2023.x.x-Linux-x86_64.sh
):bash Anaconda3-2023.x.x-MacOSX-x86_64.sh # 对于macOS
bash Anaconda3-2023.x.x-Linux-x86_64.sh # 对于Linux
Enter
键确认)。/Users/your-username/anaconda3
或 /home/your-username/anaconda3
)。~/.zshrc
文件(如果使用 bash,则是。~/.bash_profile
)。~/.bashrc
文件打开文件进行编辑:
nano ~/.zshrc # macOS 使用 zsh
nano ~/.bashrc # Linux 使用 bash
在文件末尾添加以下内容:
export PATH="$HOME/anaconda3/bin:$PATH"
保存并退出编辑器后,运行以下命令使修改生效:
source ~/.zshrc # macOS
source ~/.bashrc # Linux
conda --version
如果安装成功,应该显示 Anaconda 的版本号。
conda create --name comfyui python=3.12
conda activate comfyui
python --version
输出应该是 Python 3.12.x。
打开终端,输入代码:
xcode-select --install
如果报错,也可以直接到app商店,下载xcode,安装即可
3. 安装 PyTorch
由于没有 GPU 支持,我们安装 PyTorch CPU 版本。运行以下命令:
conda install pytorch torchvision torchaudio -c pytorch
conda install pytorch torchvision torchaudio -c pytorch-nightly
这会自动选择适合 CPU 的版本。
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu112 -i https://pypi.tuna.tsinghua.edu.cn/simple
注意自己的CUDA版本,安装对应的版本
为了避免缓存文件占满磁盘空间,我们可以设置 PIP 缓存目录。
export PIP_CACHE_DIR="/data/osadm/cache"
~/.zshrc
或 ~/.bashrc
文件,添加:export PIP_CACHE_DIR="/data/osadm/cache"
source ~/.zshrc # macOS
source ~/.bashrc # Linux
cd ~/
git clone https://github.com/comfyanonymous/ComfyUI.git
cd ComfyUI
pip install -r requirements.txt
custom_nodes
目录并克隆插件管理器:cd ~/ComfyUI/custom_nodes
git clone https://github.com/ltdrdata/ComfyUI-Manager.git
cd ComfyUI-Manager
pip install -r requirements.txt
cd ..
git clone https://github.com/AIGODLIKE/AIGODLIKE-COMFYUI-TRANSLATION.git
cd ~/ComfyUI
python main.py
command not found: conda
问题描述:
在安装 Anaconda 后,使用 conda 命令时显示 command not found 错误。
解决方法:
确保 conda
的路径已经正确添加到环境变量中。请按照以下步骤操作:
~/.bashrc
或 ~/.zshrc
文件,确保添加以下行:export PATH="$HOME/anaconda3/bin:$PATH"
source ~/.bashrc # Linux
source ~/.zshrc # macOS
Could not find a version that satisfies the requirement
问题描述:
在安装依赖时遇到以下错误:
Could not find a version that satisfies the requirement <package-name>
解决方法:
这个错误通常是因为 PyPI 上没有找到对应版本的包。你可以尝试以下几种方式解决:
pip install --upgrade pip
pip install <package-name> -i https://pypi.tuna.tsinghua.edu.cn/simple
conda
安装,而不是 pip
。No space left on device
问题描述:
在运行某些安装命令时,遇到以下错误:
OSError: [Errno 28] No space left on device
解决方法:
df -h
pip cache purge
/data/osadm/cache
)。