我是 Python 新手,我正在尝试从一些简单的机器学习项目开始。我正在尝试将 sys、scipy、numpy、matplotlib、pandas 和 sklearn 包导入到 Visual Studio jupyter 笔记本中。我正在使用此测试代码来查看它们是否正确导入:
import sys
print('Python: {}'.format(sys.version))
# scipy
import scipy
print('scipy: {}'.format(scipy.__version__))
# numpy
import numpy
print('numpy: {}'.format(numpy.__version__))
# matplotlib
import matplotlib
print('matplotlib: {}'.format(matplotlib.__version__))
# pandas
import pandas
print('pandas: {}'.format(pandas.__version__))
# scikit-learn
import sklearn
print('sklearn: {}'.format(sklearn.__version__))
Run Code Online (Sandbox Code Playgroud)
当我在从 anaconda 启动的网站上使用 jupyter 笔记本执行此操作时,它没有给我带来任何问题。但是,我想使用 VS code,但是当我在那里运行它时,它给了我这个:
P5 C:\Users\matti> conda activate base
conda : The term 'conda' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling …Run Code Online (Sandbox Code Playgroud)