Ash*_* E. 5 python pip visual-studio python-3.x
I'm new to python and I've been using VS code. Right now I'm working on a Thompson Sampling problem that requires numpy and matplotlib. I've imported both libraries but VS code is giving the error unable to import. I know I have to install with PIP, and I have seen other solutions about changing the Python path through the json. but I'm afraid to do that because I don't want to mess up my text editor. Can someone walk me through what I am supposed to do? I haven't seen any simple tutorials on setting up VS Code for python. I'm hoping this will help other people too! I have the extensions Python and CodeRunner installed in VS code. Thank you!
如果您使用的是 Python 3,问题很可能是在安装 numpy 和 matplotlib 时使用了该pip命令,该命令只会为 Python 2 安装它们。要安装 Python 3 的库,只需使用该pip3命令代替pip.