【问题标题】:Python/MVS - Standard library module invokedPython/MVS - 调用标准库模块
【发布时间】:2018-04-03 07:51:32
【问题描述】:

我正在尝试在 Microsoft Visual Studio(Python 3.6,64 位)上运行以下代码并收到错误消息“标准库模块在导入期间调用了用户代码;已为调用的代码禁用断点”

我真的希望你能帮助我。我没有 MVS 的经验。 谢谢!!

请在下面找到我的代码:

Newton raphson method.
from __future__ import division
from unittest.test.test_result import __init__
import numpy as np
import matplotlib.pyplot as plt
from cplane_np import ArrayComplexPlane
from math import sqrt

####################################################################
class NewtonRaphson(ArrayComplexPlane):
"""define a class called NewtonRaphson which is a subclass from     
ArrayComplexPlane"""
def __init__(self):
    ArrayComplexPlane.__init__(self, -2, 2, 401, -2, 2, 401)
    self.z= ArrayComplexPlane(-2, 2, 401, -2, 2, 401).plane
    om=self.z
    om1= om.as_matrix()
    self.resu= self.meth2()
    ###Array of roots and iterations.

self.plo= self.plo_res()

def meth1(self,z0=3):


    x0=z0    #The initial value.
    n=0    # The initial value of iterations.
    dx=0.01
    dy=0.01
    eps=sqrt(dx**2+dy**2)

    while df(x0)!=0:    #the derivation of f(x) should be not equal to zero.

        n+=1
        #x1=self.apply(new_fun(x0))
        x1= new_fun(x0)
        if abs(x1-x0)< eps: #The condition to stop the iteration
            return (x1,n)
        else:
            x0=x1   #assign new value of x1 to x0

def meth2(self):
    ve= np.vectorize(self.meth1 )
    return ve(self.z)

def plo_res(self):
    res1=self.resu
    res_11= np.array(res1[0],dtype='float')
    plt.imshow(res_11)
    return plt.show()

Output

【问题讨论】:

  • 我遇到了同样的问题..

标签: python-3.x visual-studio standard-library


【解决方案1】:

供将来参考:预计将在 Visual Studio 2017 15.6 中修复

https://github.com/Microsoft/PTVS/issues/3408

要在问题出现之前解决此问题,请遵循上述 github 线程中发布的建议:

如果您想立即尝试,您应该可以覆盖 最新版本的 debugger.py 副本 https://github.com/Microsoft/PTVS/blob/master/Python/Product/PythonTools/ptvsd/debugger.py

(在您的 microsoft visual studio 安装下搜索 debugger.py 目录)

这些警告可能是导致 “调试器操作正在进行中”或使情况变得更糟。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-11-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-04-25
    • 1970-01-01
    • 2021-05-19
    相关资源
    最近更新 更多