Mac 系统 Brew 安装的最新的python 

第一次接触Python

  • error: externally-managed-environment
  • 在若依网站下载的项目,试着学习
  • https://gitee.com/liqianglog/django-vue-admin/tree/v1.1.2
  • 根据readMe安装初始化时出现了问题
  • 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 non-brew-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.
    
    If you wish to install a non-brew 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.
  • 创建并使用虚拟环境

    1. 创建虚拟环境

    python3 -m venv "虚拟环境的路径"
  • 2. 激活虚拟环境

    source  "虚拟环境的路径"/bin/activate
  • 3.在虚拟环境中安装

    pip install  xxxx
  • 4. 退出虚拟环境

    deactivate
  • 亲测没问题Python 环境是由外部系统(如 Homebrew)管理的。这种情况下,系统建议你不要直接使用 pip 安装包,以避免潜在的冲突和问题
posted on 2024-05-15 11:44  独醉笑清风  阅读(939)  评论(0编辑  收藏  举报