I使用酿造在我的Mac上安装了Pytorch。但是,pip看不到,python

问题描述 投票:0回答:1
--------------------------------------------------------------------------- ModuleNotFoundError Traceback (most recent call last) Cell In[1], line 2 1 # First, import PyTorch ----> 2 import torch ModuleNotFoundError: No module named 'torch'

从命令行我看到的 -

>>> import torch Traceback (most recent call last): File "<python-input-0>", line 1, in <module> import torch ModuleNotFoundError: No module named 'torch'

由于您不使用环境,首先激活环境,然后打开jupyter实验室,然后验证pytorch

对于M1/M2 Mac,使用Pytorch的Apple Silicon版本 在同一虚拟环境中安装jupyter
pip install jupyterlab

Kernel Configuration

装置ipykernel以使虚拟环境在jupyter中可用
bash
python pytorch pip
1个回答
0
投票

在启动Jupyter Lab之前,请访问您的虚拟环境,以确保可见的包裹可见性。

© www.soinside.com 2019 - 2025. All rights reserved.