conda 安装 Hacx-GPT
查看当前 python 版本
$ python -V
Python 3.13.7
克隆 Hacx-GPT 仓库
$ git clone https://github.com/BlackTechX011/Hacx-GPT.git
直接使用 pip 命令安装报错;提示安装虚拟环境
$ pip -V
pip 25.2 from /usr/lib/python3/dist-packages/pip (python 3.13)
$ pip install -r requirements.txt
error: externally-managed-environment
× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.
If you wish to install a non-Kali-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have pypy3-venv installed.
If you wish to install a non-Kali-packaged Python application,
it may be easiest to use pipx install xyz, which will manage a
virtual environment for you. Make sure you have pipx installed.
For more information, refer to the following:
* https://www.kali.org/docs/general-use/python3-external-packages/
* /usr/share/doc/python3.13/README.venv
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.
查找 python 版本 VS Miniconda 版本关系,下载二者对应的 conda 版本脚本
$ wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-py313_25.9.1-3-Linux-x86_64.sh
--2025-12-06 10:26:47-- https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-py313_25.9.1-3-Linux-x86_64.sh
正在解析主机 mirrors.tuna.tsinghua.edu.cn (mirrors.tuna.tsinghua.edu.cn)... 101.6.15.130, 2402:f000:1:400::2
正在连接 mirrors.tuna.tsinghua.edu.cn (mirrors.tuna.tsinghua.edu.cn)|101.6.15.130|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:157891003 (151M) [application/octet-stream]
正在保存至: “Miniconda3-py313_25.9.1-3-Linux-x86_64.sh”
Miniconda3-py313_25.9.1-3-Linux 100%[====================================================>] 150.58M 11.3MB/s 用时 14s
2025-12-06 10:27:01 (11.1 MB/s) - 已保存 “Miniconda3-py313_25.9.1-3-Linux-x86_64.sh” [157891003/157891003])
并不需要加 sudo 权限执行脚本
$ sh Miniconda3-py313_25.9.1-3-Linux-x86_64.sh
Welcome to Miniconda3 py313_25.9.1-3
In order to continue the installation process, please review the license
agreement.
Please, press ENTER to continue
>>>
MINICONDA END USER LICENSE AGREEMENT
...
Downloading and Extracting Packages:
Preparing transaction: done
Executing transaction: done
installation finished.
...
==> For changes to take effect, close and re-open your current shell. <==
Thank you for installing Miniconda3!
按照提示,退出重开 shell 才能生效。再次确认 python 版本
(base) $ python -V
Python 3.13.9
(base) $ conda --version
conda 25.9.1
安装 3.12 版本的 python
(base) $ conda create --name python312 python=3.12
Do you accept the Terms of Service (ToS) for https://repo.anaconda.com/pkgs/main? [(a)ccept/(r)eject/(v)iew]: a
Do you accept the Terms of Service (ToS) for https://repo.anaconda.com/pkgs/r? [(a)ccept/(r)eject/(v)iew]: a
2 channel Terms of Service accepted
Retrieving notices: done
Channels:
- defaults
Platform: linux-64
Collecting package metadata (repodata.json): done
Solving environment: done
...
Proceed ([y]/n)? y
Downloading and Extracting Packages:
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
# $ conda activate python312
#
# To deactivate an active environment, use
#
# $ conda deactivate
激活 3.12 版本的 python
(base) $ conda activate python312
(python312) $ python -V
Python 3.12.12
进入文件夹使用 pip 安装
(python312) $ cd Hacx-GPT
(python312) $ pip install -r requirements.txt
Collecting openai>=1.0.0 (from -r requirements.txt (line 1))
Downloading openai-2.9.0-py3-none-any.whl.metadata (29 kB)
...
Successfully built pwinput
Installing collected packages: pwinput, typing-extensions, tqdm, sniffio, python-dotenv, pygments, mdurl, jiter, idna, h11, distro, colorama, certifi, annotated-types, typing-inspection, pydantic-core, markdown-it-py, httpcore, anyio, rich, pydantic, httpx, openai
Successfully installed annotated-types-0.7.0 anyio-4.12.0 certifi-2025.11.12 colorama-0.4.6 distro-1.9.0 h11-0.16.0 httpcore-1.0.9 httpx-0.28.1 idna-3.11 jiter-0.12.0 markdown-it-py-4.0.0 mdurl-0.1.2 openai-2.9.0 pwinput-1.0.3 pydantic-2.12.5 pydantic-core-2.41.5 pygments-2.19.2 python-dotenv-1.2.1 rich-14.2.0 sniffio-1.3.1 tqdm-4.67.1 typing-extensions-4.15.0 typing-inspection-0.4.2
安装完成并运行
(python312) $ python3 HacxGPT.py
██╗ ██╗ █████╗ ███████╗██╗ ██╗ ██████╗ ██████╗ ████████╗
██║ ██║ ██╔══██╗ ██╔════╝╚██╗██╔╝ ██╔════╝ ██═══██╗╚══██╔══╝
███████║ ███████║ ██║ ╚███╔╝ ██║ ███╗██████╔╝ ██║
██╔══██║ ██╔══██║ ██║ ██╔██╗ ██║ ██║██╔═ ██║
██║ ██║ ██║ ██║ ╚██████╗██╔╝ ██╗ ╚██████╔╝██║ ██║
╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝
SYSTEM: UNRESTRICTED | PROTOCOL: ACTIVE
Developed by BlackTechX
╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭───────────────────────────────────────────────────────── Warning ─────────────────────────────────────────────────────────╮
│ Encryption Key (API Key) not found. │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
┌──(Configure now? (y/n))-[~]
提示输入API_KEY