当前位置: 首页 > 工具软件 > Blitz > 使用案例 >

解决:Python安装Blitz的包后出现ModuleNotFoundError: No module named ‘blitz.modules‘错误

丁翊歌
2023-12-01

问题描述:

源代码如下:

import pandas as pd
import numpy as np

import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F

from blitz.modules import BayesianLSTM
from blitz.utils import variational_estimator

from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.linear_model import LinearRegression

import matplotlib.pyplot as plt
%matplotlib inline

from collections import deque

Python安装Blitz的包后出现ModuleNotFoundError: No module named 'blitz.modules’错误

ModuleNotFoundError: No module named 'blitz.modules'

解决方案:

其实原因就在于安装的方式不太对,需要直接在cmd中输入:

pip install blitz-bayesian-pytorch

就可以完美解决该问题啦~~开心心~~~ヾ(◍°∇°◍)ノ゙(◕ᴗ◕✿)

解决思路来源:

就是在百度上搜,然后看到一个网页写着Python包blitz-bayesian-pytorch 0.2.7,于是想到是不是自己的install内容不太对,果然pip install这个就对啦 开心~

参考文献:

https://www.cnpython.com/pypi/blitz-bayesian-pytorch
https://blog.csdn.net/Dust_Evc/article/details/125325258
https://zhuanlan.zhihu.com/p/416872266

 类似资料: