[英]Jupyter notebook: ModuleNotFoundError: No module named 'scipy'
I had issue with scipy package and not sure how to resolve it.我遇到了 scipy package 问题,不知道如何解决。 Below is my module calling.下面是我的模块调用。 No matter how I installed and uninstalled scipy, it kept saying there's no module named scipy.无论我如何安装和卸载 scipy,它一直说没有名为 scipy 的模块。
#export
import csv
import numpy as np # http://www.numpy.org
import ast
from datetime import datetime
from math import log, floor, ceil
import random
import numpy as np
!pip install -U scipy
import scipy
from scipy import stats
Here is the error message I got.这是我收到的错误消息。
Requirement already satisfied: scipy in /Users/suya/opt/anaconda3/envs/AnacondaEnv37/lib/python3.7/site-packages (1.7.1)
Collecting scipy
Downloading scipy-1.7.2-cp37-cp37m-macosx_10_9_x86_64.whl (33.0 MB)
|████████████████████████████████| 33.0 MB 10.0 MB/s eta 0:00:01
Requirement already satisfied: numpy<1.23.0,>=1.16.5 in /Users/suya/opt/anaconda3/envs/AnacondaEnv37/lib/python3.7/site-packages (from scipy) (1.21.2)
Installing collected packages: scipy
Attempting uninstall: scipy
Found existing installation: scipy 1.7.1
Uninstalling scipy-1.7.1:
Successfully uninstalled scipy-1.7.1
Successfully installed scipy-1.7.2
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
/var/folders/_n/9843mvyj5kj4z5z6m261thl80000gn/T/ipykernel_44142/3483349815.py in <module>
8 import numpy as np
9 get_ipython().system('pip install -U scipy')
---> 10 import scipy
11 from scipy import stats
ModuleNotFoundError: No module named 'scipy'
I think you use differnt kernal(python), you install scipy on differnt python from your jupyter notebook python(kernel)我认为您使用不同的内核(python),您在 jupyter notebook python(内核)的不同 python 上安装 scipy
you can install package inside of your jupyter notebook您可以在 jupyter 笔记本中安装 package
!pip install scipy
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.