每当我启动pyspark时,它都会在Python 2.6.6中启动。如何更改pyspark以使用Python 3.6? Python 3.6已经安装。我使用cloudera quickstart vm 5.8。 Spark版本1.6.0
我可以通过输入“python3.6”来启动3.6。我也可以通过输入“python”来启动python 2.6.6。我读到Centos使用的是python 2.6.6,因此我无法升级2.6.6,因为它可能会破坏Centos。我已经更改了系统路径变量,但是没有启动spark上下文。我得到sc或Spark上下文没有定义。
此外,尝试了以下步骤:
private void btnupdate_Click(object sender, EventArgs e)
{
try
{
conn.Close();
conn.Open();
MemoryStream stream = new MemoryStream();
pb1.Image.Save(stream, System.Drawing.Imaging.ImageFormat.Jpeg);
byte[] pic = stream.ToArray();
SqlCommand command = new SqlCommand ("Update Stock_Jewelry set Stock_Type = @Stock_Type, Stock_No = @Stock_No , Quantity = @Quantity, Item_Description = @Item_Description, Item_Type = @Item_Type, No_of_Gems = @No_of_Gems, Gem_Type = @Gem_Type, Image = @Image WHERE ID = @ID",conn);
command.Parameters.Add("@ID", SqlDbType.VarChar).Value = txt_ID.Text;
command.Parameters.Add("@Stock_Type", SqlDbType.VarChar).Value = Stock_Type.Text;
command.Parameters.Add("@stock_no", SqlDbType.NVarChar).Value = txt_stock_no.Text;
command.Parameters.Add("@Quantity", SqlDbType.Int).Value = txt_qty.Text;
command.Parameters.Add("@Item_Description", SqlDbType.NVarChar).Value = combo_itemk_description.Text;
command.Parameters.Add("@Item_Type", SqlDbType.NVarChar).Value = combo_item_type.Text;
command.Parameters.Add("@No_of_Gems", SqlDbType.Int).Value = txt_no_of_gems.Text;
command.Parameters.Add("@Gem_Type", SqlDbType.NVarChar).Value = txt_gem_type.Text;
command.Parameters.AddWithValue("@Image", pic);
command.ExecuteNonQuery();
MessageBox.Show("You've updated successfully!", "Successful Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
conn.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
conn.Close();
this.Close();
}