Streamlit - 没有名为 'seaborn' 的模块错误

Streamlit - No module named 'seaborn' error

我在 python 和 Streamlit 中创建了一个使用 seaborn 的应用程序,但是当我将它部署到 Streamlit 云时,我收到一条错误消息 No module named 'seaborn' 。如果我注释掉 seaborn,其他模块(例如 matplotlib)也会出现同样的错误。当我在本地启动该应用程序进行测试时,该应用程序运行良好。我已将错误作为屏幕截图和我的代码提供(它很长 - 我对 python 还是个新手,做事相当直截了当)。如果有人能解释我如何修复这个错误,我将不胜感激。

谢谢

错误截图:

代码示例:

import streamlit as st
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt

st.title("Rayleigh Fractionation Model")

st.write("-------------")
st.write("")

#####################################################################################################
# Initial melt composition
#####################################################################################################

st.subheader("Initial Composition and Model Results")
st.write("")

with st.expander("Starting silicate melt composition (Default is OIB)"):

    col1_a, col2_a, col3_a, col4_a = st.columns([1, 1, 1, 1])

    with col1_a:
        Th_sil_i = st.number_input("Th (ppm)", min_value = 0.0, value = 4.0)
        Nb_sil_i = st.number_input("Nb (ppm)", min_value = 0.0, value = 48.0)
        La_sil_i = st.number_input("La (ppm)", min_value = 0.0, value = 37.0)
        Ce_sil_i = st.number_input("Ce (ppm)", min_value = 0.0, value = 80.0)
        Pr_sil_i = st.number_input("Pr (ppm)", min_value = 0.0, value = 9.7)
        Nd_sil_i = st.number_input("Nd (ppm)", min_value = 0.0, value = 38.5)
    with col2_a:
        Zr_sil_i = st.number_input("Zr (ppm)", min_value = 0.0, value = 280.0)
        Hf_sil_i = st.number_input("Hf (ppm)", min_value = 0.0, value = 7.8)
        Sm_sil_i = st.number_input("Sm (ppm)", min_value = 0.0, value = 10.0)
        Eu_sil_i = st.number_input("Eu (ppm)", min_value = 0.0, value = 3.0)
        Ti_sil_i = st.number_input("Ti (ppm)", min_value = 0.0, value = 17200.0)
        Gd_sil_i = st.number_input("Gd (ppm)", min_value = 0.0, value = 7.62)
    with col3_a:
        Tb_sil_i = st.number_input("Tb (ppm)", min_value = 0.0, value = 1.05)
        Dy_sil_i = st.number_input("Dy (ppm)", min_value = 0.0, value = 5.6)
        Y_sil_i = st.number_input("Y (ppm)", min_value = 0.0, value = 29.0)
        Ho_sil_i = st.number_input("Ho (ppm)", min_value = 0.0, value = 1.06)
        Er_sil_i = st.number_input("Er (ppm)", min_value = 0.0, value = 2.62)
        Tm_sil_i = st.number_input("Tm (ppm)", min_value = 0.0, value = 0.35)
    with col4_a:
        Yb_sil_i = st.number_input("Yb (ppm)", min_value = 0.0, value = 2.16)
        Lu_sil_i = st.number_input("Lu (ppm)", min_value = 0.0, value = 0.3)
        V_sil_i = st.number_input("V (ppm)", min_value = 0.0, value = 500.0)
        Sc_sil_i = st.number_input("Sc (ppm)", min_value = 0.0, value = 100.0)

initial_melt = {
"Elements":["Th", "Nb", "La", "Ce", "Pr", "Nd", "Zr", "Hf", "Sm", "Eu", "Ti", "Gd", "Tb", "Dy", "Y", "Ho", "Er", "Tm", "Yb", "Lu", "V", "Sc"],
"Concentration (ppm)":[Th_sil_i, Nb_sil_i, La_sil_i, Ce_sil_i, Pr_sil_i, Nd_sil_i, Zr_sil_i, Hf_sil_i, Sm_sil_i, Eu_sil_i, Ti_sil_i, Gd_sil_i, Tb_sil_i, Dy_sil_i, Y_sil_i, Ho_sil_i, Er_sil_i, Tm_sil_i, Yb_sil_i, Lu_sil_i, V_sil_i, Sc_sil_i]
}

initial_melt_df = pd.DataFrame(data = initial_melt)

#####################################################################################################
# Fractionating minerals
#####################################################################################################

F_sil_remaining = np.arange(0.1, 1.0+0.001, 0.001)

st.sidebar.write("**Choose the minerals that are fractionating**")

P_Cpx = st.sidebar.number_input("Clinopyroxene", 0.0, 1.0, 0.0, 0.05)
P_Pl = st.sidebar.number_input("Plagioclase", 0.0, 1.0, 0.0, 0.05)
P_Opx = st.sidebar.number_input("Orthopyroxene", 0.0, 1.0, 0.0, 0.05)
P_Ol = st.sidebar.number_input("Olivine", 0.0, 1.0, 0.0, 0.05)
P_Mt = st.sidebar.number_input("Magnetite", 0.0, 1.0, 0.0, 0.05)
P_Ilm = st.sidebar.number_input("Ilmenite", 0.0, 1.0, 0.0, 0.05)
P_Ap = st.sidebar.number_input("Apatite", 0.0, 1.0, 0.0, 0.05)
P_Chr = st.sidebar.number_input("Chromite", 0.0, 1.0, 0.0, 0.05)
P_Maj_gn = st.sidebar.number_input("Majorite garnet", 0.0, 1.0, 0.0, 0.05)
P_Amp = st.sidebar.number_input("Amphibole", 0.0, 1.0, 0.0, 0.05)

Total = P_Cpx + P_Pl + P_Opx + P_Ol + P_Mt + P_Ilm + P_Ap + P_Chr + P_Maj_gn + P_Amp
st.sidebar.write(f"Total minerals fractionating  =  {Total}")
st.sidebar.write("*The total minerals fractionating should not be greater than 1*")

st.sidebar.write("--------------")
st.sidebar.write("")

st.sidebar.write("**Created by:**")
st.sidebar.write("***Matthew Brzozowski, PhD***")
st.sidebar.write("***matt.brzozow@gmail.com***")

#####################################################################################################
# Partition coefficients
#####################################################################################################

# Partition coefficients for different minerals

# Kd values from Bedard et al. (2009) --> Most minerals
    # The D values are appropriate for a system corresponding to a rock with molar An = 0.709, clinopyroxene Aliv = 0.04, and melt MgO = 5.47 and SiO2 = 53.6 wt.%.
# Kd values from Corgne and Wood (2004) --> Majorite garnet
    # Fe-, Al-rich peridotite
# Kd values from McKenzie and O'Nions (1991) --> Amphibole
    # Basalt

D_Th_Cpx = 0.0225   # Bedard et al. (2009)
D_Nb_Cpx = 0.0098   # Bedard et al. (2009)
D_La_Cpx = 0.1      # Bedard et al. (2009)
D_Ce_Cpx = 0.16     # Bedard et al. (2009)
D_Nd_Cpx = 0.338    # Bedard et al. (2009)
D_Zr_Cpx = 0.022    # Bedard et al. (2009)
D_Sm_Cpx = 0.53     # Bedard et al. (2009)
D_Eu_Cpx = 0.04     # Bedard et al. (2009)
D_Ti_Cpx = 0.213    # Bedard et al. (2009)
D_Gd_Cpx = 0.673    # Bedard et al. (2009)
D_Tb_Cpx = 0.721    # Bedard et al. (2009)
D_Y_Cpx = 0.752     # Bedard et al. (2009)
D_Yb_Cpx = 0.678    # Bedard et al. (2009)
D_Lu_Cpx = 0.642    # Bedard et al. (2009)
D_V_Cpx = 0.49      # Bedard et al. (2009)
D_Pr_Cpx = 0.240    # Bedard et al. (2009)
D_Dy_Cpx = 0.747    # Bedard et al. (2009)
D_Ho_Cpx = 0.751    # Bedard et al. (2009)  
D_Er_Cpx = 0.737    # Bedard et al. (2009)
D_Tm_Cpx = 0.711    # Bedard et al. (2009)
D_Sc_Cpx = 1.11     # Bedard et al. (2009)
D_Hf_Cpx = 0.050    # Bedard et al. (2009)
  
D_Th_Pl = 0.0162    # Bedard et al. (2009)
D_Nb_Pl = 0.00328   # Bedard et al. (2009)
D_La_Pl = 0.0238    # Bedard et al. (2009)
D_Ce_Pl = 0.036     # Bedard et al. (2009)
D_Nd_Pl = 0.0111    # Bedard et al. (2009)
D_Zr_Pl = 0.00048   # Bedard et al. (2009)
D_Sm_Pl = 0.0141    # Bedard et al. (2009)
D_Eu_Pl = 0.0872    # Bedard et al. (2009)
D_Ti_Pl = 0.0243    # Bedard et al. (2009)
D_Gd_Pl = 0.0223    # Bedard et al. (2009)
D_Tb_Pl = 0.0118    # Bedard et al. (2009)
D_Y_Pl = 0.0087     # Bedard et al. (2009)
D_Yb_Pl = 0.0039    # Bedard et al. (2009)
D_Lu_Pl = 0.0038    # Bedard et al. (2009)
D_V_Pl = 0          # Bedard et al. (2009)
D_Pr_Pl = 0.0271    # Bedard et al. (2009)
D_Dy_Pl = 0.0159    # Bedard et al. (2009)
D_Ho_Pl = 0.0256    # Bedard et al. (2009)
D_Er_Pl = 0.0115    # Bedard et al. (2009)
D_Tm_Pl = 0.0192    # Bedard et al. (2009)
D_Sc_Pl = 0.00106   # Bedard et al. (2009)
D_Hf_Pl = 0.0042    # Bedard et al. (2009)

D_Th_Opx = 0.0064   # Bedard et al. (2009)
D_Nb_Opx = 0.015    # Bedard et al. (2009)
D_La_Opx = 0.00328  # Bedard et al. (2009)
D_Ce_Opx = 0.00552  # Bedard et al. (2009)
D_Nd_Opx = 0.0142   # Bedard et al. (2009)
D_Zr_Opx = 0.0167   # Bedard et al. (2009)
D_Sm_Opx = 0.0293   # Bedard et al. (2009)
D_Eu_Opx = 0.0227   # Bedard et al. (2009)
D_Ti_Opx = 0.201    # Bedard et al. (2009)
D_Gd_Opx = 0.051    # Bedard et al. (2009)
D_Tb_Opx = 0.0656   # Bedard et al. (2009)
D_Y_Opx = 0.0953    # Bedard et al. (2009)
D_Yb_Opx = 0.16     # Bedard et al. (2009)
D_Lu_Opx = 0.177    # Bedard et al. (2009)
D_V_Opx = 0.453     # Bedard et al. (2009)
D_Pr_Opx = 0.0090   # Bedard et al. (2009)
D_Dy_Opx = 0.0831   # Bedard et al. (2009)
D_Ho_Opx = 0.102    # Bedard et al. (2009)
D_Er_Opx = 0.121    # Bedard et al. (2009)
D_Tm_Opx = 0.141    # Bedard et al. (2009)
D_Sc_Opx = 1.068    # Bedard et al. (2009)
D_Hf_Opx = 0.0408   # Bedard et al. (2009)

D_Th_Ol = 0.0346    # Bedard et al. (2009)
D_Nb_Ol = 0.00491   # Bedard et al. (2009)
D_La_Ol = 0.00008   # Bedard et al. (2009)
D_Ce_Ol = 0.00019   # Bedard et al. (2009)
D_Nd_Ol = 0.00093   # Bedard et al. (2009)
D_Zr_Ol = 0.0319    # Bedard et al. (2009)
D_Sm_Ol = 0.0031    # Bedard et al. (2009)
D_Eu_Ol = 0.0111    # Bedard et al. (2009)
D_Ti_Ol = 0.0334    # Bedard et al. (2009)
D_Gd_Ol = 0.00784   # Bedard et al. (2009)
D_Tb_Ol = 0.0119    # Bedard et al. (2009)
D_Y_Ol = 0.0222     # Bedard et al. (2009)
D_Yb_Ol = 0.0521    # Bedard et al. (2009)
D_Lu_Ol = 0.0621    # Bedard et al. (2009)
D_V_Ol = 0.15       # Bedard et al. (2009)
D_Pr_Ol = 0.00043   # Bedard et al. (2009)
D_Dy_Ol = 0.0177    # Bedard et al. (2009)
D_Ho_Ol = 0.0247    # Bedard et al. (2009)
D_Er_Ol = 0.0330    # Bedard et al. (2009)
D_Tm_Ol = 0.0423    # Bedard et al. (2009)
D_Sc_Ol = 0.29      # Bedard et al. (2009)
D_Hf_Ol = 0.0139    # Bedard et al. (2009)

D_Th_Mt = 0.0077    # Bedard et al. (2009)
D_Nb_Mt = 0.0764    # Bedard et al. (2009)
D_La_Mt = 0.015     # Bedard et al. (2009)
D_Ce_Mt = 0.016     # Bedard et al. (2009)
D_Nd_Mt = 0.026     # Bedard et al. (2009)
D_Zr_Mt = 0.084     # Bedard et al. (2009)
D_Sm_Mt = 0.024     # Bedard et al. (2009)
D_Eu_Mt = 0.025     # Bedard et al. (2009)
D_Ti_Mt = 1.49      # Bedard et al. (2009)
D_Gd_Mt = 0.018     # Bedard et al. (2009)
D_Tb_Mt = 0.019     # Bedard et al. (2009)
D_Y_Mt = 0.018      # Bedard et al. (2009)
D_Yb_Mt = 0.018     # Bedard et al. (2009)
D_Lu_Mt = 0.018     # Bedard et al. (2009)
D_V_Mt = 0.64       # Bedard et al. (2009)
D_Pr_Mt = 0.018     # Bedard et al. (2009)
D_Dy_Mt = 0.018     # Bedard et al. (2009)
D_Ho_Mt = 0.018     # Bedard et al. (2009)
D_Er_Mt = 0.018     # Bedard et al. (2009)
D_Tm_Mt = 0.018     # Bedard et al. (2009)
D_Sc_Mt = 1.10      # Bedard et al. (2009)
D_Hf_Mt = 0.076     # Bedard et al. (2009)

D_Th_Ilm = 0.105    # Bedard et al. (2009)
D_Nb_Ilm = 1.62     # Bedard et al. (2009)
D_La_Ilm = 0.0027   # Bedard et al. (2009)
D_Ce_Ilm = 0.0046   # Bedard et al. (2009)
D_Nd_Ilm = 0.012    # Bedard et al. (2009)
D_Zr_Ilm = 0.35     # Bedard et al. (2009)
D_Sm_Ilm = 0.025    # Bedard et al. (2009)
D_Eu_Ilm = 0.0028   # Bedard et al. (2009)
D_Ti_Ilm = float()
D_Gd_Ilm = 0.0428   # Bedard et al. (2009)
D_Tb_Ilm = 0.0546   # Bedard et al. (2009)
D_Y_Ilm = 0.0777    # Bedard et al. (2009)
D_Yb_Ilm = 0.125    # Bedard et al. (2009)
D_Lu_Ilm = 0.137    # Bedard et al. (2009)
D_V_Ilm = 10.3      # Bedard et al. (2009)
D_Pr_Ilm = 0.0076   # Bedard et al. (2009)
D_Dy_Ilm = 0.0683   # Bedard et al. (2009)
D_Ho_Ilm = 0.0827   # Bedard et al. (2009)
D_Er_Ilm = 0.0971   # Bedard et al. (2009)
D_Tm_Ilm = 0.111    # Bedard et al. (2009)
D_Sc_Ilm = 1.91     # Bedard et al. (2009)
D_Hf_Ilm = 0.42     # Bedard et al. (2009)

D_Th_Ap = 0.835     # Bedard et al. (2009)
D_Nb_Ap = 0.00295   # Bedard et al. (2009)
D_La_Ap = 2.425     # Bedard et al. (2009)
D_Ce_Ap = 2.78      # Bedard et al. (2009)
D_Nd_Ap = 16.8      # Bedard et al. (2009)
D_Zr_Ap = 0.067     # Bedard et al. (2009)
D_Sm_Ap = 4.67      # Bedard et al. (2009)
D_Eu_Ap = 7.36      # Bedard et al. (2009)
D_Ti_Ap = 0.047     # Bedard et al. (2009)
D_Gd_Ap = 4.05      # Bedard et al. (2009)
D_Tb_Ap = 15.2      # Bedard et al. (2009)
D_Y_Ap = 2.285      # Bedard et al. (2009)
D_Yb_Ap = 1.5       # Bedard et al. (2009)
D_Lu_Ap = 0.96      # Bedard et al. (2009)
D_V_Ap = 0.022      # Bedard et al. (2009)
D_Pr_Ap = 14.0      # Bedard et al. (2009)
D_Dy_Ap = 12.9      # Bedard et al. (2009)
D_Ho_Ap = 10.8      # Bedard et al. (2009)
D_Er_Ap = 8.79      # Bedard et al. (2009)
D_Tm_Ap = 7.14      # Bedard et al. (2009)  
D_Sc_Ap = 0.0258    # Bedard et al. (2009)  
D_Hf_Ap = 89        # Bedard et al. (2009)  

D_Th_Chr = 0.001    # Bedard et al. (2009)
D_Nb_Chr = 0.01     # Bedard et al. (2009)
D_La_Chr = 0.0006   # Bedard et al. (2009)
D_Ce_Chr = 0.0006   # Bedard et al. (2009)
D_Nd_Chr = 0.0006   # Bedard et al. (2009)
D_Zr_Chr = 0.015    # Bedard et al. (2009)
D_Sm_Chr = 0.0006   # Bedard et al. (2009)
D_Eu_Chr = 0.0006   # Bedard et al. (2009)
D_Ti_Chr = 0.125    # Bedard et al. (2009)
D_Gd_Chr = 0.0006   # Bedard et al. (2009)
D_Tb_Chr = 0.0011   # Bedard et al. (2009)
D_Y_Chr = 0.002     # Bedard et al. (2009)
D_Yb_Chr = 0.0045   # Bedard et al. (2009)
D_Lu_Chr = 0.0045   # Bedard et al. (2009)
D_V_Chr = 10        # Bedard et al. (2009)
D_Pr_Chr = 0.0006   # Bedard et al. (2009)
D_Dy_Chr = 0.0015   # Bedard et al. (2009)
D_Ho_Chr = 0.0023   # Bedard et al. (2009)
D_Er_Chr = 0.003    # Bedard et al. (2009)
D_Tm_Chr = 0.0038   # Bedard et al. (2009)
D_Sc_Chr = 0.1      # Bedard et al. (2009)
D_Hf_Chr = 0.015    # Bedard et al. (2009)

D_Th_Maj_gn = float()
D_Nb_Maj_gn = 0.0022   # Bobrov et al. (2014) --> run 2322
D_La_Maj_gn = 0.0011   # Bobrov et al. (2014) --> run 2322
D_Ce_Maj_gn = 0.0016   # Bobrov et al. (2014) --> run 2322
D_Nd_Maj_gn = 0.0058   # Bobrov et al. (2014) --> run 2322
D_Zr_Maj_gn = 0.174    # Bobrov et al. (2014) --> run 2322
D_Sm_Maj_gn = 0.027    # Bobrov et al. (2014) --> run 2322
D_Eu_Maj_gn = 0.059    # Bobrov et al. (2014) --> run 2322
D_Ti_Maj_gn = float()
D_Gd_Maj_gn = 0.099    # Bobrov et al. (2014) --> run 2322
D_Tb_Maj_gn = 0.201    # Bobrov et al. (2014) --> run 2322
D_Y_Maj_gn = 0.556     # Bobrov et al. (2014) --> run 2322
D_Yb_Maj_gn = 1.62     # Bobrov et al. (2014) --> run 2322
D_Lu_Maj_gn = 1.97     # Bobrov et al. (2014) --> run 2322
D_V_Maj_gn = float()
D_Pr_Maj_gn = 0.0022   # Bobrov et al. (2014) --> run 2322
D_Dy_Maj_gn = 0.342    # Bobrov et al. (2014) --> run 2322
D_Ho_Maj_gn = 0.551    # Bobrov et al. (2014) --> run 2322
D_Er_Maj_gn = 0.848    # Bobrov et al. (2014) --> run 2322
D_Tm_Maj_gn = 1.17     # Bobrov et al. (2014) --> run 2322
D_Sc_Maj_gn = 2.69     # Bobrov et al. (2014) --> run 2322
D_Hf_Maj_gn = 0.144    # Bobrov et al. (2014) --> run 2322

D_Th_Amp = float()
D_Nb_Amp = float() 
D_La_Amp = 0.17        # McKenzie and O'Nions (1991)
D_Ce_Amp = 0.26        # McKenzie and O'Nions (1991)
D_Nd_Amp = 0.44        # McKenzie and O'Nions (1991)
D_Zr_Amp = float()     # McKenzie and O'Nions (1991)
D_Sm_Amp = 0.76        # McKenzie and O'Nions (1991)
D_Eu_Amp = 0.88        # McKenzie and O'Nions (1991)
D_Ti_Amp = 0.69        # McKenzie and O'Nions (1991)
D_Gd_Amp = 0.86        # McKenzie and O'Nions (1991)
D_Tb_Amp = 0.83        # McKenzie and O'Nions (1991)
D_Y_Amp = float()      
D_Yb_Amp = 0.59        # McKenzie and O'Nions (1991)
D_Lu_Amp = 0.51        # McKenzie and O'Nions (1991)
D_V_Amp = float()
D_Pr_Amp = 0.35        # McKenzie and O'Nions (1991)
D_Dy_Amp = 0.78        # McKenzie and O'Nions (1991)
D_Ho_Amp = 0.73        # McKenzie and O'Nions (1991)
D_Er_Amp = 0.68        # McKenzie and O'Nions (1991)
D_Tm_Amp = 0.64        # McKenzie and O'Nions (1991)
D_Sc_Amp = float()
D_Hf_Amp = float()

#####################################################################################################
# Bulk partition coefficients
#####################################################################################################

D_Th_bulk = (P_Cpx * D_Th_Cpx) + (P_Pl * D_Th_Pl) + (P_Opx * D_Th_Opx) + (P_Ol * D_Th_Ol) + (P_Mt * D_Th_Mt) + (P_Ilm * D_Th_Ilm) + (P_Ap * D_Th_Ap) + (P_Chr * D_Th_Chr) + (P_Maj_gn * D_Th_Maj_gn) + (P_Amp * D_Th_Amp)
D_Nb_bulk = (P_Cpx * D_Nb_Cpx) + (P_Pl * D_Nb_Pl) + (P_Opx * D_Nb_Opx) + (P_Ol * D_Nb_Ol) + (P_Mt * D_Nb_Mt) + (P_Ilm * D_Nb_Ilm) + (P_Ap * D_Nb_Ap) + (P_Chr * D_Nb_Chr) + (P_Maj_gn * D_Nb_Maj_gn) + (P_Amp * D_Nb_Amp)
D_La_bulk = (P_Cpx * D_La_Cpx) + (P_Pl * D_La_Pl) + (P_Opx * D_La_Opx) + (P_Ol * D_La_Ol) + (P_Mt * D_La_Mt) + (P_Ilm * D_La_Ilm) + (P_Ap * D_La_Ap) + (P_Chr * D_La_Chr) + (P_Maj_gn * D_La_Maj_gn) + (P_Amp * D_La_Amp)
D_Ce_bulk = (P_Cpx * D_Ce_Cpx) + (P_Pl * D_Ce_Pl) + (P_Opx * D_Ce_Opx) + (P_Ol * D_Ce_Ol) + (P_Mt * D_Ce_Mt) + (P_Ilm * D_Ce_Ilm) + (P_Ap * D_Ce_Ap) + (P_Chr * D_Ce_Chr) + (P_Maj_gn * D_Ce_Maj_gn) + (P_Amp * D_Ce_Amp)
D_Pr_bulk = (P_Cpx * D_Pr_Cpx) + (P_Pl * D_Pr_Pl) + (P_Opx * D_Pr_Opx) + (P_Ol * D_Pr_Ol) + (P_Mt * D_Pr_Mt) + (P_Ilm * D_Pr_Ilm) + (P_Ap * D_Pr_Ap) + (P_Chr * D_Pr_Chr) + (P_Maj_gn * D_Pr_Maj_gn) + (P_Amp * D_Pr_Amp)
D_Nd_bulk = (P_Cpx * D_Nd_Cpx) + (P_Pl * D_Nd_Pl) + (P_Opx * D_Nd_Opx) + (P_Ol * D_Nd_Ol) + (P_Mt * D_Nd_Mt) + (P_Ilm * D_Nd_Ilm) + (P_Ap * D_Nd_Ap) + (P_Chr * D_Nd_Chr) + (P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Er_Cpx) + (P_Pl * D_Er_Pl) + (P_Opx * D_Er_Opx) + (P_Ol * D_Er_Ol) + (P_Mt * D_Er_Mt) + (P_Ilm * D_Er_Ilm) + (P_Ap * D_Er_Ap) + (P_Chr * D_Er_Chr) + (P_Maj_gn * D_Er_Maj_gn) + (P_Amp * D_Er_Amp)
D_Tm_bulk = (P_Cpx * D_Tm_Cpx) + (P_Pl * D_Tm_Pl) + (P_Opx * D_Tm_Opx) + (P_Ol * D_Tm_Ol) + (P_Mt * D_Tm_Mt) + (P_Ilm * D_Tm_Ilm) + (P_Ap * D_Tm_Ap) + (P_Chr * D_Tm_Chr) + (P_Maj_gn * D_Tm_Maj_gn) + (P_Amp * D_Tm_Amp)
D_Yb_bulk = (P_Cpx * D_Yb_Cpx) + (P_Pl * D_Yb_Pl) + (P_Opx * D_Yb_Opx) + (P_Ol * D_Yb_Ol) + (P_Mt * D_Yb_Mt) + (P_Ilm * D_Yb_Ilm) + (P_Ap * D_Yb_Ap) + (P_Chr * D_Yb_Chr) + (P_Maj_gn * D_Yb_Maj_gn) + (P_Amp * D_Yb_Amp)
D_Lu_bulk = (P_Cpx * D_Lu_Cpx) + (P_Pl * D_Lu_Pl) + (P_Opx * D_Lu_Opx) + (P_Ol * D_Lu_Ol) + (P_Mt * D_Lu_Mt) + (P_Ilm * D_Lu_Ilm) + (P_Ap * D_Lu_Ap) + (P_Chr * D_Lu_Chr) + (P_Maj_gn * D_Lu_Maj_gn) + (P_Amp * D_Lu_Amp)
D_V_bulk = (P_Cpx * D_V_Cpx) + (P_Pl * D_V_Pl) + (P_Opx * D_V_Opx) + (P_Ol * D_V_Ol) + (P_Mt * D_V_Mt) + (P_Ilm * D_V_Ilm) + (P_Ap * D_V_Ap) + (P_Chr * D_V_Chr) + (P_Maj_gn * D_V_Maj_gn) + (P_Amp * D_V_Amp)
D_Sc_bulk = (P_Cpx * D_Sc_Cpx) + (P_Pl * D_Sc_Pl) + (P_Opx * D_Sc_Opx) + (P_Ol * D_Sc_Ol) + (P_Mt * D_Sc_Mt) + (P_Ilm * D_Sc_Ilm) + (P_Ap * D_Sc_Ap) + (P_Chr * D_Sc_Chr) + (P_Maj_gn * D_Sc_Maj_gn) + (P_Amp * D_Sc_Amp)

#####################################################################################################
# Residual melt calculation
#####################################################################################################

Th_sil_f = Th_sil_i * (F_sil_remaining ** (D_Th_bulk - 1))
Nb_sil_f = Nb_sil_i * (F_sil_remaining ** (D_Nb_bulk - 1))
La_sil_f = La_sil_i * (F_sil_remaining ** (D_La_bulk - 1))
Ce_sil_f = Ce_sil_i * (F_sil_remaining ** (D_Ce_bulk - 1))
Pr_sil_f = Pr_sil_i * (F_sil_remaining ** (D_Pr_bulk - 1))
Nd_sil_f = Nd_sil_i * (F_sil_remaining ** (D_Nd_bulk - 1))
Zr_sil_f = Zr_sil_i * (F_sil_remaining ** (D_Zr_bulk - 1))
Hf_sil_f = Hf_sil_i * (F_sil_remaining ** (D_Hf_bulk - 1))
Sm_sil_f = Sm_sil_i * (F_sil_remaining ** (D_Sm_bulk - 1))
Eu_sil_f = Eu_sil_i * (F_sil_remaining ** (D_Eu_bulk - 1))
Ti_sil_f = Ti_sil_i * (F_sil_remaining ** (D_Ti_bulk - 1))
Gd_sil_f = Gd_sil_i * (F_sil_remaining ** (D_Gd_bulk - 1))
Tb_sil_f = Tb_sil_i * (F_sil_remaining ** (D_Tb_bulk - 1))
Dy_sil_f = Dy_sil_i * (F_sil_remaining ** (D_Dy_bulk - 1))
Y_sil_f = Y_sil_i * (F_sil_remaining ** (D_Y_bulk - 1))
Ho_sil_f = Ho_sil_i * (F_sil_remaining ** (D_Ho_bulk - 1))
Er_sil_f = Er_sil_i * (F_sil_remaining ** (D_Er_bulk - 1))
Tm_sil_f = Tm_sil_i * (F_sil_remaining ** (D_Tm_bulk - 1))
Yb_sil_f = Yb_sil_i * (F_sil_remaining ** (D_Yb_bulk - 1))
Lu_sil_f = Lu_sil_i * (F_sil_remaining ** (D_Lu_bulk - 1))
V_sil_f = V_sil_i * (F_sil_remaining ** (D_V_bulk - 1))
Sc_sil_f = Sc_sil_i * (F_sil_remaining ** (D_Sc_bulk - 1))

#####################################################################################################
# Cumulate melt calculation
#####################################################################################################

Th_sol = ((1 - (F_sil_remaining ** D_Th_bulk)) / (1 - F_sil_remaining)) * Th_sil_i
Nb_sol = ((1 - (F_sil_remaining ** D_Nb_bulk)) / (1 - F_sil_remaining)) * Nb_sil_i
La_sol = ((1 - (F_sil_remaining ** D_La_bulk)) / (1 - F_sil_remaining)) * La_sil_i
Ce_sol = ((1 - (F_sil_remaining ** D_Ce_bulk)) / (1 - F_sil_remaining)) * Ce_sil_i
Pr_sol = ((1 - (F_sil_remaining ** D_Pr_bulk)) / (1 - F_sil_remaining)) * Pr_sil_i
Nd_sol = ((1 - (F_sil_remaining ** D_Nd_bulk)) / (1 - F_sil_remaining)) * Nd_sil_i
Zr_sol = ((1 - (F_sil_remaining ** D_Zr_bulk)) / (1 - F_sil_remaining)) * Zr_sil_i
Hf_sol = ((1 - (F_sil_remaining ** D_Hf_bulk)) / (1 - F_sil_remaining)) * Hf_sil_i
Sm_sol = ((1 - (F_sil_remaining ** D_Sm_bulk)) / (1 - F_sil_remaining)) * Sm_sil_i
Eu_sol = ((1 - (F_sil_remaining ** D_Eu_bulk)) / (1 - F_sil_remaining)) * Eu_sil_i
Ti_sol = ((1 - (F_sil_remaining ** D_Ti_bulk)) / (1 - F_sil_remaining)) * Ti_sil_i
Gd_sol = ((1 - (F_sil_remaining ** D_Gd_bulk)) / (1 - F_sil_remaining)) * Gd_sil_i
Tb_sol = ((1 - (F_sil_remaining ** D_Tb_bulk)) / (1 - F_sil_remaining)) * Tb_sil_i
Dy_sol = ((1 - (F_sil_remaining ** D_Dy_bulk)) / (1 - F_sil_remaining)) * Dy_sil_i
Y_sol = ((1 - (F_sil_remaining ** D_Y_bulk)) / (1 - F_sil_remaining)) * Y_sil_i
Ho_sol = ((1 - (F_sil_remaining ** D_Ho_bulk)) / (1 - F_sil_remaining)) * Ho_sil_i
Er_sol = ((1 - (F_sil_remaining ** D_Er_bulk)) / (1 - F_sil_remaining)) * Er_sil_i
Tm_sol = ((1 - (F_sil_remaining ** D_Tm_bulk)) / (1 - F_sil_remaining)) * Tm_sil_i
Yb_sol = ((1 - (F_sil_remaining ** D_Yb_bulk)) / (1 - F_sil_remaining)) * Yb_sil_i
Lu_sol = ((1 - (F_sil_remaining ** D_Lu_bulk)) / (1 - F_sil_remaining)) * Lu_sil_i
V_sol = ((1 - (F_sil_remaining ** D_V_bulk)) / (1 - F_sil_remaining)) * V_sil_i
Sc_sol = ((1 - (F_sil_remaining ** D_Sc_bulk)) / (1 - F_sil_remaining)) * Sc_sil_i

您可能需要安装它。

python --version
python -m pip install seaborn

您需要根据 Streamlit 文档指明您的 App dependencies

The main reason that apps fail to build properly is because Streamlit Cloud can't find your dependencies! So make sure you:

  1. Add a requirements file for Python dependencies.
  2. (optional) Add a packages.txt file to manage any external dependencies (i.e Linux dependencies outside Python environment).

Note: Python requirements files should be placed either in the root of your repository or in the same directory as your Streamlit app