人财事物信息化 - ERPNext安装指南

甲、【Server】安装Frappe/ERPNext

Welcome to Ubuntu 22.04.5 LTS

  1. 在Ubuntu上创建新用户
  2. #fr为[frappe-user]可自定义#
    sudo adduser fr
    sudo usermod -a -G sudo fr
    su fr
    cd
  3. 更新和升级包
  4. sudo apt-get update && sudo apt-get upgrade -y
  5. 安装python和setuptools以及开发环境
  6. sudo apt-get install git curl python3-dev python3-venv python3-setuptools python3-pip xvfb libfontconfig wkhtmltopdf libmysqlclient-dev redis-server mariadb-server mariadb-client software-properties-common python3-testresources cron nano -y
  7. 安装和设置MySql Server
  8. sudo mysql_secure_installation
    * Enter your current password for root (enter for none):
    * Switch to unix_socket authentication [Y/n] n
    * Change the root password? [Y/n] Y
    * Remove anonymous users? [Y/n] Y
    * Disallow root login remotely? [Y/n] Y
    * Remove test database and access to it? [Y/n] Y
    * Reload privilege tables now? [Y/n]: Y

    Thanks for using MariaDB!
    创建新站点时需要输入root password
  9. 编辑 MySql 配置文件
  10. sudo nano /etc/mysql/my.cnf
    复制下面的部分并粘贴到您的配置文件中
    [mysqld]
    character-set-client-handshake = FALSE
    character-set-server = utf8mb4
    collation-server = utf8mb4_unicode_ci

    [mysql]
    default-character-set = utf8mb4
    按[ctrl]+[S]保存,再按[Ctrl]+[X]退出
  11. 设置pip加速镜像(可略过)
  12. pip config set global.index-url https://mirrors.huaweicloud.com/repository/pypi/simple
    pip config set install.trusted-host mirrors.huaweicloud.com
  13. 安装node
  14. sudo apt install nodejs
    node -v
    Expected version ">=18". Got "12.22.9"
    #如果版本报错,则按以下步骤重装:
    sudo apt remove nodejs
    sudo apt autoremove
    curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
    sudo apt-get install nodejs -y
    node -v
  15. 设置NPM加速镜像(可略过)
  16. sudo apt install npm
    sudo npm config set registry https://registry.npmmirror.com -g
  17. 安装 yarn
  18. sudo npm install -g yarn
  19. 设置yarn加速镜像(可略过)
  20. yarn config set registry https://registry.npmmirror.com --global
  21. 安装frappe-bench
  22. sudo pip3 install frappe-bench --break-system-packages
  23. 初始化frappe-bench
  24. bench init --frappe-branch version-15 french --frappe-path=https://gitee.com/feesow/frappe --verbose
  25. 将权限应用于用户目录
  26. cd french
    sudo chmod -R o+rx /home/fr
  27. 创建新站点
  28. bench new-site shudou
    #shudou为[site-name]可自定义#
    MySQL root password:

    Set Administrator password:
    #root password为第4步安装数据库时输入密码
    #初始化网站时管理员密码
  29. 设置默认站点
  30. bench use shudou
  31. 安装ERPNext
  32. bench get-app --branch version-15 erpnext https://gitee.com/feesow/erpnext
    bench install-app erpnext
  33. 设置生产环境
  34. sudo bench setup production fr
    #建议用户名手工输入#
    NOTE:如果报错,请参考文末doubao回复。
  35. 自定义会计科目表与多版本财务报表
  36. bench get-app accounting_cn https://gitee.com/feesow/accounting_cn
    bench install-app accounting_cn

乙、【Browser】初始化配置

  1. 浏览器访问公网IP
  2. 登录网站管理员账号
  3. 用户名:administrator
    密码:(甲、14步)
  4. 切换语言为中文
  5. 创建用户
  6. 设置公司、会计科目表
  7. 设置您的系统……
  8. 设置完成,跳转主页

甲、17 报错时的解决方法:

bench.exceptions.CommandFailedError: sudo /usr/bin/python3 -m pip install ansible

  1. 使用 apt 安装 ansible
  2. 要是你使用的是基于 Debian 或 Ubuntu 的系统,可借助 apt 来安装 ansible,这样能避免破坏系统的 Python 环境。

    sudo apt update sudo apt install ansible

  3. 创建虚拟环境
  4. 你可以创建一个 Python 虚拟环境,然后在该环境中安装 ansible。

    创建虚拟环境

    python3 -m venv myenv

    激活虚拟环境

    source myenv/bin/activate

    在虚拟环境中安装 ansible

    pip install ansible

    退出虚拟环境

    deactivate

  5. 使用 pipx 安装 ansible
  6. pipx 能够在独立的虚拟环境中安装 Python 应用程序,防止破坏系统的 Python 环境。

    安装 pipx

    sudo apt install pipx

    pipx ensurepath

    使用 pipx 安装 ansible

    pipx install ansible

    你可以按照自身需求挑选合适的方法来安装 ansible。

Discard
Save
Review Changes ← Back to Content
Message Status Space Raised By Last update on