Erpnext安装

Erpnext安装

环境要求

Ubuntu 23.04 x86_64
Python 3.10.12
pip 23.0.1
node v18.16.0
npm 9.5.1
yarn 1.22.22
MariaDB 10.11.2
Redis 7.0.8
wkhtmltox 0.12.6.1
bench 5.22.6

环境安装

Reids

安装

// 安装7.0.8 也可不指定版本 直接执行 sudo apt install redis-server
sudo apt install redis-server=5:7.0.8-4
// 检查安装的版本
redis-server --version
// 配置 apt 保持特定版本
// 安装后保持该特定版本而不自动升级,可以将该包保持在当前版本
sudo apt-mark hold redis-server

MariaDB

安装

// 安装 也可不指定版本 直接执行 sudo apt install mariadb-server
sudo apt install mariadb-server=1:10.11.2-1
// 在此安装过程中,系统将提示您设置 MySQL root 密码。如果未出现提示,则必须自行初始化MySQL服务器设置。您可以通过运行以下命令来执行此操作
// 请记住:只有在安装过程中未提示您输入密码时才运行它。
mysql_secure_installation
// 
sudo apt-get install mariadb-client-10.3

// 现在,编辑 MariaDB 配置文件。
vim /etc/mysql/my.cnf
// 并添加此配置
[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci

[mysql]
default-character-set = utf8mb4
// 现在,只需重新启动mysql服务,就可以开始了。
service mysql restart

// 查看版本
mysql --version
// 固定版本
sudo apt-mark hold mariadb-server

Node

下载安装包v18.16.0

https://nodejs.org/dist/v18.16.0/

wget -c https://nodejs.org/dist/v18.16.0/node-v18.16.0-linux-x64.tar.gz
tar -xvf node-v18.16.0-linux-x64.tar.gz
mv node-v18.16.0-linux-x64 /usr/local/nodejs

// 创建软连接
ln -s /usr/local/nodejs/bin/node /usr/local/bin/node
ln -s /usr/local/nodejs/bin/npm /usr/local/bin/npm

// 编辑环境变量
vim /etc/profile

export NODE_HOME=/usr/local/nodejs/
export PATH=$NODE_HOME/bin:$PATH
// 使环境变量生效
source /etc/profile

// 验证
node -v
npm -v

Yarn

1.22.22

npm install -g yarn@1.22.22

wkhtmltox

打开

https://wkhtmltopdf.org/downloads.html

下载

image

// 从 https://wkhtmltopdf.org/downloads.html 下载并安装 wkhtmltopdf 包
apt-get install xvfb libfontconfig
// 安装
dpkg -i wkhtmltox_0.12.6.1-2.jammy_amd64.deb

// 可能遇到缺少xfonts-75dpi
sudo apt-get install -y xfonts-75dpi
// 再次尝试安装 wkhtmltox 包
sudo dpkg -i wkhtmltox_0.12.6.1-2.jammy_amd64.deb

Python

安装3.10.12

// 检查
python3 --version // Python 3.10.12
// 如果不是3.10.12 再进行安装
// 安装pyenv

sudo apt update
sudo apt install -y make build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \
libncurses5-dev libncursesw5-dev xz-utils tk-dev \
libffi-dev liblzma-dev python-openssl git

// 使用 curl 来安装 pyenv
curl https://pyenv.run | bash

// 在 ~/.bashrc 或 ~/.zshrc 文件中添加以下内容:
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init --path)"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"

// 重新加载 shell 配置文件
source ~/.bashrc  # 如果使用 bash
source ~/.zshrc   # 如果使用 zsh

// 使用 pyenv 安装指定版本的 Python
pyenv install 3.10.12

// 设置全局 Python 版本
pyenv global 3.10.12

// 验证当前 Python 版本
python --version

bench

安装5.22.6 bench

pip3 install frappe-bench==5.22.6

// 验证
bench --version

安装项目

  1. 在合适的目录下

    bench init --version frappe-erpnext

  2. 初始化站点

    bench new-site erpnext.server.app

  3. 下载erpnext

    bench get-app https://github.com/frappe/payments.git
    bench get-app --branch v14.70.2 https://github.com/frappe/erpnext.git
    bench get-app --branch v15.21.2 https://github.com/frappe/hrms.git
    // 汉化
    bench get-app --branch version-14 https://gitee.com/phipsoft/zh_chinese_language.git

  4. 安装erpnext

    bench --site erpnext.server.app install-app payments
    bench --site erpnext.server.app install-app erpnext
    bench --site erpnext.server.app install-app hrms
    bench --site erpnext.server.app install-app zh_chinese_language

  5. 启动项目

    bench start

常见问题

新版ubuntu使用pip时发生错误

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-Debian-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 python3-full installed.
    
    If you wish to install a non-Debian 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.
    
    See /usr/share/doc/python3.11/README.venv for more information.

解决方案:如果你习惯于原来的用法可以强制删除此警告

sudo mv /usr/lib/python3.x/EXTERNALLY-MANAGED /usr/lib/python3.x/EXTERNALLY-MANAGED.bak

安装时不能使用root权限

root@molang-System-Product-Name:~/workspace$ bench init frappe-bench
WARN: You should not run this command as root

解决方案: 切换到普通用户

su molang

当前用户权限不够

molang@molang-System-Product-Name:~/workspace$ bench init frappe-bench
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/dist-packages/bench/commands/make.py", line 75, in init
    init(
  File "/usr/local/lib/python3.11/dist-packages/bench/utils/render.py", line 105, in wrapper_fn
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/bench/utils/system.py", line 64, in init
    bench.setup.dirs()
  File "/usr/local/lib/python3.11/dist-packages/bench/utils/render.py", line 126, in wrapper_fn
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/bench/bench.py", line 338, in dirs
    os.makedirs(self.bench.name, exist_ok=True)
  File "<frozen os>", line 225, in makedirs
PermissionError: [Errno 13] Permission denied: 'frappe-bench'

ERROR: There was a problem while creating frappe-bench
Do you want to rollback these changes? [y/N]: y
INFO: Rolling back Bench "frappe-bench"

解决方案:增加权限

sudo chmod 777 .

找不到yarn命令

执行bench init frappe-bench时报错找不到yarn

molang@molang-System-Product-Name:~/workspace$ bench init frappe-bench
Setting Up Environment
$ python3 -m venv env
$ /home/molang/workspace/frappe-bench/env/bin/python -m pip install --quiet --upgrade pip
$ /home/molang/workspace/frappe-bench/env/bin/python -m pip install --quiet wheel
Getting frappe
$ git clone https://github.com/frappe/frappe.git  --depth 1 --origin upstream
正克隆到 'frappe'...
remote: Enumerating objects: 3226, done.
remote: Counting objects: 100% (3226/3226), done.
remote: Compressing objects: 100% (2837/2837), done.
remote: Total 3226 (delta 431), reused 1598 (delta 275), pack-reused 0
接收对象中: 100% (3226/3226), 11.05 MiB | 11.13 MiB/s, 完成.
处理 delta 中: 100% (431/431), 完成.
Installing frappe
$ /home/molang/workspace/frappe-bench/env/bin/python -m pip install --quiet --upgrade -e /home/molang/workspace/frappe-bench/apps/frappe 
$ yarn install --check-files
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/dist-packages/bench/commands/make.py", line 75, in init
    init(
  File "/usr/local/lib/python3.11/dist-packages/bench/utils/render.py", line 105, in wrapper_fn
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/bench/utils/system.py", line 87, in init
    get_app(
  File "/usr/local/lib/python3.11/dist-packages/bench/app.py", line 772, in get_app
    app.install(verbose=verbose, skip_assets=skip_assets, restart_bench=restart_bench)
  File "/usr/local/lib/python3.11/dist-packages/bench/utils/render.py", line 126, in wrapper_fn
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/bench/app.py", line 255, in install
    install_app(
  File "/usr/local/lib/python3.11/dist-packages/bench/app.py", line 915, in install_app
    bench.run(yarn_install, cwd=app_path)
  File "/usr/local/lib/python3.11/dist-packages/bench/bench.py", line 48, in run
    return exec_cmd(cmd, cwd=cwd or self.cwd, _raise=_raise)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/bench/utils/__init__.py", line 165, in exec_cmd
    return_code = subprocess.call(spl_cmd, cwd=cwd, universal_newlines=True, env=env)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/subprocess.py", line 389, in call
    with Popen(*popenargs, **kwargs) as p:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.11/subprocess.py", line 1950, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
PermissionError: [Errno 13] Permission denied: 'yarn'

ERROR: There was a problem while creating frappe-bench
Do you want to rollback these changes? [y/N]: y
INFO: Rolling back Bench "frappe-bench"
molang@molang-System-Product-Name:~/workspace$ yarn --version
找不到命令 “yarn”,但可以通过以下软件包安装它:
sudo apt install cmdtest

解决方案

  1. 安装yarn后如果再次出现找不到yarn的问题

    molang@molang-System-Product-Name:~/workspace$ npm install -g yarn

    changed 1 package, and audited 2 packages in 1s

    found 0 vulnerabilitie
    molang@molang-System-Product-Name:~/workspace$ yarn --version
    找不到命令 “yarn”,但可以通过以下软件包安装它:
    sudo apt install cmdtest

  2. 将yarn手动配置到Path环境变量中

找到yarn地址

molang@molang-System-Product-Name:~/workspace$ npm bin -g
/home/node/node-v18.12.1-linux-x64/bin

打开你的终端配置文件(通常是 **~/.bashrc****~/.bash_profile****~/.profile**),然后将 **yarn** 的安装路径添加到 PATH 变量中。

在文件的末尾添加以下行:

export PATH="$PATH:/home/node/node-v18.12.1-linux-x64/bin"

刷新配置

molang@molang-System-Product-Name:~/workspace$ source ~/.bashrc
molang@molang-System-Product-Name:~/workspace$ yarn --version
1.22.21

代理问题

User
molang@molang-System-Product-Name:~/workspace/frappe-erpnext$ bench get-app hrms
A directory for the application 'hrms' already exists. Do you want to continue and overwrite it? [y/N]: y
INFO: App moved from apps/hrms to archived/apps/hrms-2024-04-02_2
Getting hrms
$ git clone https://github.com/frappe/hrms.git --branch develop --depth 1 --origin upstream
正克隆到 'hrms'...
remote: Enumerating objects: 1513, done.
remote: Counting objects: 100% (1513/1513), done.
remote: Compressing objects: 100% (1145/1145), done.
remote: Total 1513 (delta 410), reused 994 (delta 302), pack-reused 0
接收对象中: 100% (1513/1513), 7.86 MiB | 3.24 MiB/s, 完成.
处理 delta 中: 100% (410/410), 完成.
Ignoring dependencies of hrms. To install dependencies use --resolve-deps
Installing hrms
$ /home/molang/workspace/frappe-erpnext/env/bin/python -m pip install --quiet --upgrade -e /home/molang/workspace/frappe-erpnext/apps/hrms 
  error: subprocess-exited-with-error
  
  × pip subprocess to install build dependencies did not run successfully.
  │ exit code: 1
  ╰─> [2 lines of output]
      ERROR: Could not install packages due to an OSError: Missing dependencies for SOCKS support.
      
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: /home/molang/workspace/frappe-erpnext/env/bin/python -m pip install --quiet --upgrade -e /home/molang/workspace/frappe-erpnext/apps/hrms 
subprocess.CalledProcessError: Command '/home/molang/workspace/frappe-erpnext/env/bin/python -m pip install --quiet --upgrade -e /home/molang/workspace/frappe-erpnext/apps/hrms ' returned non-zero exit status 1.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/bin/bench", line 8, in <module>
    sys.exit(cli())

代理问题导致SOCKSp不可用 最后就会显示ython -m pip install --quiet --upgrade -e 不可用

如果因为梯子导致pip intstall报错 ValueError: Unable to determine SOCKS version from socks://127.0.0.1:1080 问题

解决办法就是重置代理就ok

unset all_proxy

unset ALL_PROXY

没有虚拟环境

molang@AY130628150444Z:~$ bench init frappe-erpnext
Setting Up Environment
$ python3 -m venv env
The virtual environment was not created successfully because ensurepip is not
available.  On Debian/Ubuntu systems, you need to install the python3-venv
package using the following command.

    apt install python3.10-venv

You may need to use sudo with that command.  After installing the python3-venv
package, recreate your virtual environment.

Failing command: /home/molang/frappe-erpnext/env/bin/python3

subprocess.CalledProcessError: Command 'python3 -m venv env' returned non-zero exit status 1.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/bench/commands/make.py", line 75, in init
    init(
  File "/usr/local/lib/python3.10/dist-packages/bench/utils/render.py", line 105, in wrapper_fn
    return fn(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/bench/utils/system.py", line 66, in init
    bench.setup.env(python=python)
  File "/usr/local/lib/python3.10/dist-packages/bench/utils/render.py", line 126, in wrapper_fn
    return fn(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/bench/bench.py", line 362, in env
    self.run(f"{venv} env", cwd=self.bench.name)
  File "/usr/local/lib/python3.10/dist-packages/bench/bench.py", line 48, in run
    return exec_cmd(cmd, cwd=cwd or self.cwd, _raise=_raise)
  File "/usr/local/lib/python3.10/dist-packages/bench/utils/__init__.py", line 169, in exec_cmd
    raise CommandFailedError(cmd) from subprocess.CalledProcessError(return_code, cmd)
bench.exceptions.CommandFailedError: python3 -m venv env

ERROR: There was a problem while creating frappe-erpnext

安装虚拟环境

apt install python3.10-venv

无法安装虚拟环境

root@AY130628150444Z:/home/molang#  apt install python3.10-venv
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 python3.10-venv : Depends: python3-pip-whl but it is not going to be installed
                   Depends: python3-setuptools-whl but it is not going to be installed
 wkhtmltox : Depends: fontconfig but it is not going to be installed
             Depends: libxrender1 but it is not going to be installed
             Depends: xfonts-75dpi but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

看起来你遇到了依赖问题,导致无法安装 **python3.10-venv** 包。这可能是因为某些依赖包没有正确安装或者版本不兼容所致。

你可以尝试运行 **apt --fix-broken install** 命令来修复未满足的依赖关系,它会尝试自动解决依赖问题。

apt --fix-broken install

运行这个命令后,系统会尝试自动安装缺失的依赖项,并解决任何存在的依赖关系问题。

一旦修复了依赖关系问题,你就可以再次尝试安装 **python3.10-venv** 包。

apt install python3.10-venv

如果问题仍然存在,可能需要更深入地检查依赖关系,确保所有的依赖项都正确安装并且与系统兼容。

Exception: No process manager found

command bench start cause error:

Traceback (most recent call last):
File "/usr/local/bin/bench", line 9, in
load_entry_point('bench==0.1', 'console_scripts', 'bench')()
File "/home/fourmax/bench/bench/cli.py", line 24, in cli
return bench()
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 488, in call
return self.main(_args, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 474, in main
self.invoke(ctx)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 758, in invoke
return self.invoke_subcommand(ctx, cmd, cmd_name, ctx.args[1:])
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 767, in invoke_subcommand
return cmd.invoke(cmd_ctx)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 659, in invoke
ctx.invoke(self.callback, *_ctx.params)
File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 325, in invoke
return callback(_args, **kwargs)
File "/home/fourmax/bench/bench/cli.py", line 97, in start
_start()
File "/home/fourmax/bench/bench/utils.py", line 157, in start
raise Exception("No process manager found")
Exception: No process manager found

解决

You can install it using sudo pip install honcho

Redis端口占用

替补启动
14:50:10系统| redis_socketio.1 已启动 (pid=19224)
14:50:10 系统 | redis_cache.1 已启动 (pid=19220)
14:50:10 系统 | redis_queue.1 已启动 (pid=19229)
14:50:10 redis_cache.1 | 19223:C 2023 年 9 月 1 日 14:50:10.077 # oO0OoO0OoO0Oo Redis 正在启动 oO0OoO0OoO0Oo
14:50:10 redis_cache.1 | 19223:C 19223:C 19223:C 2023年9月1日 14:50:10.078 # Redis 版本=6.0.16,位=64,提交=00000000,修改=0,pid=19223,刚刚开始
14:50:10 redis_cache. 1 | 19223:C 19223:C 2023 年 9 月 1 日 14:50:10.078 # 配置已加载
14:50:10 redis_cache.1 | 19223:M 2023 年 9 月 1 日 14:50:10.078 * 将打开文件的最大数量增加到 10032(最初设置为 1024)。
14:50:10 redis_cache.1 | 19223:M 19223:M 19223:M 2023 年 9 月 1 日 14:50:10.078 # 无法创建 TCP 监听设备 127.0.0.1:13000:bind:地址已在使用中
14:50:10 redis_queue.1 | 19223:M 19223:M 19223:M 2023 年 9 月 1 日 14:50:10.078 19231:C 2023 年 9 月 1 日 14:50:10.078 # oO0OoO0OoO0Oo Redis 正在启动 oO0OoO0OoO0Oo
14:50:10 redis_queue.1 | 19231:C 19231:C 2023年9月1日14:50:10.078 # Redis版本=6.0.16,位=64,提交=00000000,修改=0,pid=19231,刚刚开始
14:50:10 redis_queue. 1 | 19231:C 19231:C 2023 年 9 月 1 日 14:50:10.078 # 配置已加载
14:50:10 redis_queue.1 | 19231:M 2023
年9月1日 14:50:10.079 * 将打开文件的最大数量增加到10032(最初设置为1024)。redis_cache.1 已停止 (rc=1)
14:50:10 redis_queue.1 | 19231:M 2023年9月1日 14:50:10.079 * 将打开文件的最大数量增加到10032(最初设置为1024)。 19231:M 2023 年 9 月 01 日 14:50:10.082 # 创建无法使用 TCP 监听设备 127.0.0.1:11000:bind:地址已在使用
14:50:10 系统 | 19231:M 19231:M 2023 年 9 月 01 日 14:50:10.082 redis_queue.1 已停止 (rc=1)
14:50:10 系统 | web.1 启动 (pid=19242)
14:50:10 系统 | web.1 启动 (pid=19242) 14:50:10 web.1 启动 (pid=19242) 14:50:10 Schedule.1 已启动 (pid=19238)
14:50:10 系统 | web.1 已启动 (pid=19238) 14:50:10 worker_long.1 启动 (pid=19240)
14:50:10 系统 | worker_short.1 启动 (pid=19241)
14:50:10 系统 | watch.1 启动 (pid=19235)
14:50:10 redis_socketio.1 | 19227:C 2023 年 9 月 1 日 14:50:10.090 # oO0OoO0OoO0Oo Redis 正在启动 oO0OoO0OoO0Oo
14:50:10 redis_socketio.1 | 19227:C 2023 年 9 月 1 日 14:50:10.091 # Redis 版本=6.0.16,位=64,提交=00000000,修改=0,pid=19227,刚刚开始
14:50:10 redis_socketio.1 | 19227:C 19227:C 19227:C 2023 年 9 月 1 日 14:50:10.091 # 配置已加载
14:50:10 redis_socketio.1 | 19227:M 2023 年 9 月 1 日 14:50:10.092 * 将打开文件的最大数量增加到 10032(最初设置为 1024)。
14:50:10 redis_socketio.1 | 19227:M 19227:M 19227:M 2023 年 9 月 1 日 14:50:10.093 # 无法创建 TCP 监听插件 127.0.0.1:12000:bind:已在使用
14:50:10 系统 | 19227:M 19227:M 19227:M 2023 年 9 月 1 日 14:50:10.093 redis_socketio.1 已停止 (rc=1)
14:50:10 系统 | socketio.1 已启动(pid=19239)
14:50:10 系统 | worker_default.1 已启动(pid=19244)
14:50:10 系统 | 向 web.1(pid 19242)发送 SIGTERM
14:50:10 系统 | 向socketio.1(pid 19239)发送SIGTERM
14:50:10 系统 | 向 watch.1(pid 19235)发送 SIGTERM
14:50:10 系统 | 向schedule.1(pid 19238)发送SIGTERM
14:50:10 系统 | 向worker_short.1(pid 19241)发送SIGTERM
14:50:10 系统 | 向worker_long.1(pid 19240)发送SIGTERM
14:50:10 系统 |向worker_default.1 (pid 19244) 发送SIGTERM
14:50:10 系统| socketio.1 已停止(rc=-15)
14:50:10 系统 | Schedule.1 已停止(rc=-15)
14:50:10 系统 | worker_short.1 已停止(rc=-15)
14:50:10 系统 | web.1 已停止(rc=-15)
14:50:10 系统 | worker_long.1 已停止(rc=-15)
14:50:10 系统 | worker_default.1 已停止(rc=-15)
14:50:10 系统 | watch.1 已停止(rc=-15)

解决

bench init --skip-redis-config-generation frappe-bench

注意:在工作台初始化期间使用选项“–skip-redis-config- Generation”,不再需要这些操作。但至少,看看 ProcFile 看看在启动命令上启动 honcho 时发生了什么

Honcho 是 Bench 用来管理 Frappe 所需的所有流程的工具。通常,这些都在本地主机中运行,但在这种情况下,我们有 Redis 的外部容器。因此,我们必须阻止 Honcho 尝试启动 Redis 进程。

官方文档:https://github.com/frappe/frappe_docker/blob/main/docs/development.md#edit-honchos-procfile

没有Git

www@erp:/opt$ /usr/local/bin/bench --version
Traceback (most recent call last):
  File "/home/www/.local/lib/python3.10/site-packages/git/__init__.py", line 296, in <module>
    refresh()
  File "/home/www/.local/lib/python3.10/site-packages/git/__init__.py", line 287, in refresh
    if not Git.refresh(path=path):
  File "/home/www/.local/lib/python3.10/site-packages/git/cmd.py", line 631, in refresh
    raise ImportError(err)
ImportError: Bad git executable.
The git executable must be specified in one of the following ways:
    - be included in your $PATH
    - be set via $GIT_PYTHON_GIT_EXECUTABLE
    - explicitly set via git.refresh(<full-path-to-git-executable>)

All git commands will error until this is rectified.

This initial message can be silenced or aggravated in the future by setting the
$GIT_PYTHON_REFRESH environment variable. Use one of the following values:
    - quiet|q|silence|s|silent|none|n|0: for no message or exception
    - warn|w|warning|log|l|1: for a warning message (logging level CRITICAL, displayed by default)
    - error|e|exception|raise|r|2: for a raised exception

Example:
    export GIT_PYTHON_REFRESH=quiet


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/bin/bench", line 5, in <module>
    from bench.cli import cli
  File "/usr/local/lib/python3.10/dist-packages/bench/cli.py", line 14, in <module>
    from bench.bench import Bench
  File "/usr/local/lib/python3.10/dist-packages/bench/bench.py", line 36, in <module>
    from bench.utils.app import get_current_version
  File "/usr/local/lib/python3.10/dist-packages/bench/utils/app.py", line 17, in <module>
    from bench.app import get_repo_dir
  File "/usr/local/lib/python3.10/dist-packages/bench/app.py", line 21, in <module>
    import git
  File "/home/www/.local/lib/python3.10/site-packages/git/__init__.py", line 298, in <module>
    raise ImportError("Failed to initialize: {0}".format(_exc)) from _exc
ImportError: Failed to initialize: Bad git executable.
The git executable must be specified in one of the following ways:
    - be included in your $PATH
    - be set via $GIT_PYTHON_GIT_EXECUTABLE
    - explicitly set via git.refresh(<full-path-to-git-executable>)

All git commands will error until this is rectified.

This initial message can be silenced or aggravated in the future by setting the
$GIT_PYTHON_REFRESH environment variable. Use one of the following values:
    - quiet|q|silence|s|silent|none|n|0: for no message or exception
    - warn|w|warning|log|l|1: for a warning message (logging level CRITICAL, displayed by default)
    - error|e|exception|raise|r|2: for a raised exception

Example:
    export GIT_PYTHON_REFRESH=quiet

sudo apt install git

没有虚拟环境

www@erp:/opt$ bench init frappe-erpnext
Setting Up Environment
$ python3 -m venv env
The virtual environment was not created successfully because ensurepip is not
available.  On Debian/Ubuntu systems, you need to install the python3-venv
package using the following command.

    apt install python3.10-venv

You may need to use sudo with that command.  After installing the python3-venv
package, recreate your virtual environment.

Failing command: /opt/frappe-erpnext/env/bin/python3

subprocess.CalledProcessError: Command 'python3 -m venv env' returned non-zero exit status 1.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/www/.local/lib/python3.10/site-packages/bench/commands/make.py", line 75, in init
    init(
  File "/home/www/.local/lib/python3.10/site-packages/bench/utils/render.py", line 105, in wrapper_fn
    return fn(*args, **kwargs)
  File "/home/www/.local/lib/python3.10/site-packages/bench/utils/system.py", line 66, in init
    bench.setup.env(python=python)
  File "/home/www/.local/lib/python3.10/site-packages/bench/utils/render.py", line 126, in wrapper_fn
    return fn(*args, **kwargs)
  File "/home/www/.local/lib/python3.10/site-packages/bench/bench.py", line 362, in env
    self.run(f"{venv} env", cwd=self.bench.name)
  File "/home/www/.local/lib/python3.10/site-packages/bench/bench.py", line 48, in run
    return exec_cmd(cmd, cwd=cwd or self.cwd, _raise=_raise)
  File "/home/www/.local/lib/python3.10/site-packages/bench/utils/__init__.py", line 178, in exec_cmd
    raise CommandFailedError(cmd) from subprocess.CalledProcessError(return_code, cmd)
bench.exceptions.CommandFailedError: python3 -m venv env

ERROR: There was a problem while creating frappe-erpnext
Do you want to rollback these changes? [y/N]: y
INFO: Rolling back Bench "frappe-erpnext"

sudo apt install python3.10-venv

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:/a/719365.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

XX集团网上客户管理系统投标书技术部分(358页WORD)

方案介绍&#xff1a;针对客户不断增加的便民查询&#xff0c;业务受理等实际需求&#xff0c;我们将积极整合国内外人才、技术、产品资源&#xff0c;打造XX最便捷的网上处理平台。在平台建设和运营基础上&#xff0c;持续探索各种创新模式&#xff0c;发展多种有针对性的衍生…

攻防演练“轻装上阵” | 亚信安全信舱ForCloud 打造全栈防护新策略

网络世界攻防实战中&#xff0c;攻击风险已经从代码到云横跨全栈技术点&#xff0c;你准备好了吗 云服务器&#xff0c;攻击众矢之的 2022年超过38万个Kubernetes API服务器暴露公网&#xff0c;成为攻击者目标。云服务器&#xff0c;尤其是开源设施&#xff0c;一直以来不仅是…

拐点 万维钢电子书(拐点万维钢下载在线阅读)

本文节选自《拐点万维钢》在线阅读 医院急诊室有个特别常见的状况是病人胸口痛。对这种情 况&#xff0c;医生必须判断是不是心脏病&#xff0c;是心脏病就得赶紧处置。但问题 是&#xff0c;急诊医生并没有很好的诊断方法。 通常的做法是搞个正式的检查&#xff0c;而心脏病检…

碳课堂 | 手把手教你申报CBAM

CBAM全称为 Carbon Border Adjustment Mechanism&#xff0c;也被称作“碳关税”或“碳边境调节机制”&#xff0c;是指在实施国内严格气候政策的基础上&#xff0c;要求进口或出口的高碳产品缴纳或退还相应的税费或碳配额。目前&#xff0c;由于欧盟碳边境调节机制是全球第一个…

示例:WPF中在没有MouseDoubleClick的控件中如何识别双击

一、目的&#xff1a;由于MouseDoubleClick控件是在Control中实现&#xff0c;那么在底层控件如Grid中想要类似功能如何实现&#xff0c;这里通过MouseDown的事MouseButtonEventArgs参数去实现 二、实现 定义Grid并注册Grid的MouseDown事件 <Grid Background"Transpa…

Ubuntu,Centos,Linux服务器安装Mellanox MCX653105A IB网卡HCA卡驱动

Mellanox 官方驱动下载地址 https://network.nvidia.com/products/infiniband-drivers/linux/mlnx_ofed/ 选择对应操作系统 官方链接速度比较慢&#xff0c;推荐个友商的下载地址 https://support.xfusion.com/support/#/zh/rack-servers/2288h-v5-pid-21872244/software …

对 PLC AC 模块的 TRIAC 输出进行故障排除

在大多数离散 PLC 系统中&#xff0c;排除输出设备故障的过程相当简单。如果输出端正常工作&#xff0c;则在“关闭”时应测量 0 V&#xff0c;在“开启”时应测量满源电压。对于数字和继电器输出&#xff0c;情况确实如此。对于由 TRIAC 驱动的 AC 输出也应如此&#xff0c;但…

C++通过VS2022使用Conan2.0安装fmt库实现控制台彩色打印

Conan是一个开源的C/C包管理器&#xff0c;用于管理和构建C/C项目的依赖关系。它允许开发人员轻松地集成第三方库、工具和资源到他们的项目中&#xff0c;并管理这些依赖项的版本、构建选项和配置。 Conan官方提供了对应的VS2022扩展插件&#xff0c;通过这个插件再搭配VS2022…

如何正确操作工业高温烤箱

高温烤箱广泛应用于陶瓷、丝印、汽车配件、电子、机电、通讯、化工、器材、印刷、制药、工业、橡胶、油漆、食品之烘烤、水份干燥、预热等用途。那么要想工业高温烤箱在使用的过程中能够正常运行&#xff0c;那么正确的操作是必不可少的&#xff0c; 1、防止触电&#xff1a;高…

电脑文件防泄密软件——天锐绿盾 - 中科数安—— 哪个好

在选择电脑文件防泄密软件时&#xff0c;天锐绿盾和中科数安都是值得考虑的选项。以下是对这两款软件的详细比较&#xff1a; www.drhchina.com PC地址&#xff1a; https://isite.baidu.com/site/wjz012xr/2eae091d-1b97-4276-90bc-6757c5dfedee 功能全面性&#xff1a; 天锐…

具身智能的视觉-语言-动作模型综合综述论文

近期arXiv公开了关于具身智能&#xff08;Embodied AI&#xff09;中的视觉-语言-动作模型&#xff08;Vision-Language-Action Models&#xff0c;简称VLAs&#xff09;的综合综述论文。介绍了VLAs的概念&#xff0c;它们是为了处理多模态输入而设计的模型&#xff0c;包括视觉…

移动硬盘数据恢复,6个亲测有效方法公开!

“我的移动硬盘已经用了很久了&#xff0c;最近不知道是怎么回事&#xff0c;里面有部分重要的数据居然不见了。想问问大家有什么方法可以恢复移动硬盘的数据吗&#xff1f;” 在数字时代的浪潮中&#xff0c;移动硬盘已成为我们存储和携带数据的重要工具。从海量的工作文档、珍…

java 对象实际占用内存大小预估工具类ObjectSizeUtil

java 对象实际占用内存大小预估工具类 返回对象占用预估字节数 返回字节数对应格式化后的字符串&#xff08;xx Kb&#xff09; 使用效果 依赖了lombock和hutool&#xff0c;项目不用这个可以去掉日志&#xff0c;稍微改写一下。 import cn.hutool.core.util.ClassUtil; i…

Java同城信息付费系统家政服务房屋租赁房屋买卖房屋装修信息发布平台小程序APP公众号源码

&#x1f4f2;一站式便捷生活助手&#x1f680; &#x1f4cc;一、引言&#xff1a;同城信息付费服务系统的新篇章 在信息碎片化的时代&#xff0c;我们越来越需要一个集中、高效、便捷的平台来获取同城信息。同城信息付费服务系统发布平台小程序应运而生&#xff0c;它以其独…

CorelDRAW Graphics Suite下载2024最新版-CorelDRAW2024详细安装步骤

CorelDRAW​​ Graphics Suite官方版是款很多用户在工作中都会使用的矢量图形设计工具。CorelDRAW Graphics Suite正式版采用量身定制的界面和无与伦比的定制功能&#xff0c;畅享无缝设计经验。并且CorelDRAW Graphics Suite还可以广泛应用于商标设计、标志制作、模型绘制、插…

物理隔离后数据怎么导入和导出?安全U盘一键解决

政府单位、军工和科研所、航空航天企业、金融机构、医疗单位、电力企业、生物制药实验室等企业及单位&#xff0c;因研发和生产过程、或日常经营中涉及大量敏感信息和技术&#xff0c;需要通过物理隔离来确保网络的安全性。因此&#xff0c;多采用物理隔离的方式进行网络建设。…

Python xml.dom.minidom 读取XML元素

哈喽&#xff0c;大家好&#xff0c;我是木头左&#xff01; 什么是 XML&#xff1f; XML&#xff08;可扩展标记语言&#xff09;是一种用于描述数据结构和交换数据的标记语言。它被广泛用于 Web 应用程序中&#xff0c;用于存储和传输数据。XML 具有自描述性&#xff0c;因此…

002.Linux CentOS7 安装

我 的 个 人 主 页&#xff1a;&#x1f449;&#x1f449; 失心疯的个人主页 &#x1f448;&#x1f448; 入 门 教 程 推 荐 &#xff1a;&#x1f449;&#x1f449; Python零基础入门教程合集 &#x1f448;&#x1f448; 虚 拟 环 境 搭 建 &#xff1a;&#x1f449;&…

Flink 窗口函数

一、Window 概述 Flink 流式计算是一种被设计用于处理无限数据集的数据处理引擎&#xff0c;而无限数据集是指一种不断增长的本质上无限的数据集&#xff0c;而 window 是一种切割无线数据为有限块进行处理的手段。 二、Window 分类 Window 可以分为两类&#xff1a; Count…

Python | Leetcode Python题解之第162题寻找峰值

题目&#xff1a; 题解&#xff1a; class Solution:def findPeakElement(self, nums: List[int]) -> int:n len(nums)# 辅助函数&#xff0c;输入下标 i&#xff0c;返回 nums[i] 的值# 方便处理 nums[-1] 以及 nums[n] 的边界情况def get(i: int) -> int:if i -1 or…