ModuleNotFoundError: 没有名为“scipy.special._ufuncs"的模块 [英] ModuleNotFoundError: No module named 'scipy.special._ufuncs'

查看:78
本文介绍了ModuleNotFoundError: 没有名为“scipy.special._ufuncs"的模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在 Python3.6 上安装了 scipy:

sudo apt-get install python3-scipypip3 安装 scipy

但是,它不适用于此错误.:

ModuleNotFoundError: 没有名为scipy.special._ufuncs"的模块

我该怎么办?

非常感谢您的帮助.

解决方案

ufuncs(又名 通用函数)是NumPy<的一部分/a> 框架.使用 SciPy 时,需要先安装 NumPy,因为它是一个依赖项.您收到此 ModuleNotFoundError 可能是由于 NumPy 包不可用.

在你尝试任何事情之前,列出当前安装的包:

pip3 列表

如果未安装 NumPy,请尝试安装它:

pip3 安装 numpy

您似乎已经尝试使用 ubuntu 软件包安装程序安装 scipy.这就是为什么你的 scipy 版本是 0.17.有时,某些 ubuntu 软件包可能已过时.因此,最好使用官方的包管理器,例如 PyPI 在 Python 的情况下.

先卸载包管理器安装的scipy:

sudo apt-get purge python3-scipy

卸载成功后,使用PyPI重新安装:

pip3 安装 scipy

这将从 python 包索引安装最新版本(1.1.0).>

如果一切顺利,您应该能够毫无错误地运行代码.

I already installed scipy on Python3.6:

sudo apt-get install python3-scipy
pip3 install scipy

But, it does not work with this error.:

ModuleNotFoundError: No module named 'scipy.special._ufuncs'

How can I do?

Thanks very much for your help.

解决方案

The ufuncs (aka Universal Functions) is part of the NumPy framework. When working with SciPy, it is necessary to install NumPy first as it's a dependency. You are getting this ModuleNotFoundError is likely due to the unavailability of NumPy package.

Before you try anything, list the currently installed packages:

pip3 list

If NumPy isn't installed then try installing it:

pip3 install numpy

Edit:

It seems that you had tried install scipy using ubuntu package installer. That's why your scipy version is 0.17. Sometimes it is possible that some ubuntu packages are outdated. Therefore, it's better to use the official package managers, like PyPI in case of Python.

First uninstall the scipy installed by the package manager:

sudo apt-get purge python3-scipy

When uninstalled successfully, reinstall it using PyPI:

pip3 install scipy

This will install the latest version (1.1.0) from python package index.

If all goes well, you should be able to run your code without any errors.

这篇关于ModuleNotFoundError: 没有名为“scipy.special._ufuncs"的模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆