我正在尝试在pycharm上使用ipython笔记本,但我无法使用这些包
正如您所看到的,file->settings->projectInterpreter
在我的案例中没有定义。
知道为什么这么说吗?
不仅如此,当我尝试使用 private void DocReader(string fileLocation,string headingText, string headingStyle)
{
Microsoft.Office.Interop.Word.Application word = new Microsoft.Office.Interop.Word.Application();
object miss = System.Reflection.Missing.Value;
object path = fileLocation;
object readOnly = true;
Microsoft.Office.Interop.Word.Document docs = word.Documents.Open(ref path, ref miss, ref readOnly, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss, ref miss);
string totaltext = "";
int ind = 0;
bool flag = false;
int paraCount = docs.Paragraphs.Count;
for (int i = 1; i < paraCount; i++)
{
Microsoft.Office.Interop.Word.Style style = docs.Paragraphs[i].get_Style() as Microsoft.Office.Interop.Word.Style;
if (style != null && style.NameLocal.Equals(headingStyle))
{
flag = false;
if (docs.Paragraphs[i].Range.Text.ToString().TrimEnd('\r').ToUpper() == headingText.ToUpper())
{
ind++;
flag = true;
}
}
if (flag && ind>=1)
totaltext += " \r\n " + docs.Paragraphs[i].Range.Text.ToString();
}
if (totaltext == "") { totaltext = "No such data found!"; }
richTextBox1.Text = totaltext;
docs.Close();
word.Quit(); }
时,它表示sns也没有被定义。
我去了public static SoftwareBitmap Resize(this SoftwareBitmap softwareBitmap, float newWidth, float newHeight)
{
using (var resourceCreator = CanvasDevice.GetSharedDevice())
using (var canvasBitmap = CanvasBitmap.CreateFromSoftwareBitmap(resourceCreator, softwareBitmap))
using (var canvasRenderTarget = new CanvasRenderTarget(resourceCreator, newWidth, newHeight, canvasBitmap.Dpi))
using (var drawingSession = canvasRenderTarget.CreateDrawingSession())
using (var scaleEffect = new ScaleEffect())
{
scaleEffect.Source = canvasBitmap;
scaleEffect.Scale = new System.Numerics.Vector2(newWidth / softwareBitmap.PixelWidth, newHeight / softwareBitmap.PixelHeight);
drawingSession.DrawImage(scaleEffect);
drawingSession.Flush();
return SoftwareBitmap.CreateCopyFromBuffer(canvasRenderTarget.GetPixelBytes().AsBuffer(), BitmapPixelFormat.Bgra8, (int)newWidth, (int)newHeight, BitmapAlphaMode.Premultiplied);
}
}
下面是一个安装了pandas包的screnshot。
在开始编写任何代码之前,已经安装了Pandas。 Seaborn稍后手动安装。
有谁可以解释为什么我在pycharm中收到此错误? 提前感谢你。
答案 0 :(得分:1)
原来我必须首先运行第一个单元格然后运行其他单元格。