无法引用numpy_financial模块问题如何解决?

import numpy_financial as npf

=====================

def sta001(k, nyear, xd):
d2 = npf.fv(k, nyear, -xd, -xd);
d2 = round(d2)
return d2

=====================

运行报错:
Traceback (most recent call last):
File “/Users/zhangmiao/Desktop/lianghua/c01_01_k101.py”, line 4, in
import numpy_financial as npf
ModuleNotFoundError: No module named ‘numpy_financial’

我确定已经使用pip安装了numpy_financial,在anaconda的环境里也能看到numpy_financial。
请教高手指点。

讨论数量: 2
Jason990420

How and where you run your script ? the same, how and where the module installed ? It maybe caused by which the python run.

4个月前 评论

你运行的py环境和你的anaconda是同一个环境吗?你要确保你看到的和你运行的是同一个环境,最简单就是你用python3 -m pip list 一下,有没有你这个库。

4个月前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!