【发布时间】:2021-04-03 09:49:28
【问题描述】:
我在 Anaconda Prompt(在 Windows 10 上)中安装了 yfinance:pip install yfinance --user。
我收到了消息:
警告:脚本 sample.exe 安装在不在 PATH 上的“C:\Users\joseph\AppData\Roaming\Python\Python37\Scripts”中。 考虑将此目录添加到 PATH,或者,如果您希望禁止显示此警告,请使用 --no-warn-script-location。
我在System variables 中添加了C:\Users\joseph\AppData\Roaming\Python\Python37\Scripts 到Path 的路径。
但我在 Python (Spyder 3.7) 中导入 yfinance 时仍然收到错误消息:
ìmport yfinance
ModuleNotFoundError: 没有名为“yfinance”的模块
【问题讨论】:
-
您是否尝试在将 sample.exe 添加到 PATH 后重新安装 yfinance,假设安装失败?
-
你的意思是我应该卸载它并重新安装它吗?
-
如果你已经成功编辑了你的 PATH,(下面来自 Aditya Sarin 的优秀答案),当你运行时会发生什么,pip install yfinance --user
-
我得到了很多:要求已经满足
标签: python pip path environment-variables yfinance