首页 > 解决方案 > 如何在可执行文件中包含nodejs?

问题描述

我有一个python文件,它使用自定义散景扩展来生成surface3d图并使用export_png将它们转换为png。可执行文件在我当前的系统上成功运行,但是当我将其移动到没有 anaconda 的系统时出现以下错误。RuntimeError:需要node.js v10.13.0或更高版本才能编译自定义模型(“conda install nodejs”或遵循https://nodejs.org/en/download/)[6128 ]无法执行脚本CMM

我在我的代码中使用以下库:

import scipy.linalg
import scipy.interpolate
import numpy as np
import csv
import pandas as pd
import glob
import fire
from bokeh.plotting import figure, output_file, save, show
from bokeh.layouts import gridplot, row, column
from bokeh.core.properties import Instance, String
from bokeh.models import ColumnDataSource, LayoutDOM, ColorBar, Div
from bokeh.util.compiler import TypeScript
import os
import sys

我需要一个独立的可执行文件。有没有办法让 pyinstaller 在生成可执行文件时包含它?这是我用来生成exe文件的代码:

pyinstaller --hidden-import=pkg_resources.py2_warn --onefile Q:\Test\CMM.py

标签: pythonnode.jspython-3.xpyinstallerbokehjs

解决方案


推荐阅读