【发布时间】:2022-11-01 16:31:59
【问题描述】:
当我在 vscode 上运行 jupyter note 时
`
# Load the libraries to be used in the Analysis
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
impor wat warnings
# Setup libraries settings and options
## Pandas setup
pd.set_option('display.max_columns', None)
## matplotlib setup
%matplotlib inline
## Seaborn setup
sns.set_context('notebook')
sns.set_style('whitegrid')
sns.set_palette('Blues_r')
# turn off warning for final notebook
warnings.filterwarnings('ignore')
`
然后我被要求安装 ipykernel,当我从 vscode 选择安装时,进程开始,然后我收到以下错误消息: 使用“Python 3.11.0 64-bit”运行单元需要 ipykernel 包。 运行以下命令将“ipykernel”安装到 Python 环境中。 命令:'c:/Users/Samir/AppData/Local/Programs/Python/Python311/python.exe -m pip install ipykernel -U --user --force-reinstall'
我去 Git Bash 并运行
python -m pip install ipykernel
我得到这个错误
\tests
running build_ext
building 'psutil._psutil_windows' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Micr
osoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tool
s/
[end of output]
note: This error originates from a subprocess, and is likely not a problem wit
h pip.
ERROR: Failed building wheel for psutil
Failed to build psutil
ERROR: Could not build wheels for psutil, which is required to install pyproject
.toml-based projects
我尝试从 vscode 然后从 Git bash 安装 ipykernel,但出现错误
【问题讨论】:
-
您是否尝试过消息中的建议?
c:/Users/Samir/AppData/Local/Programs/Python/Python311/python.exe -m pip install ipykernel -U --user --force-reinstall。事实上,它还建议从visualstudio.microsoft.com/visual-cpp-build-tools 获取编译器 -
我在
windows中使用vs code,它在vs code内的提示符下工作。我相信它会安装jupyter扩展...
标签: python visual-studio-code pip jupyter-notebook