I am trying to use darts library to forecast price using transformer neural nets. through ubuntu20.4 terminal and python 3.10.
The below is my code, where I just calling and Importing necessary libraries:
from os.path import dirname, basename
from os import getcwd
import sys
def fix_pythonpath_if_working_locally():
"""Add the parent path to pythonpath if current working dir is darts/examples"""
cwd = getcwd()
if basename(cwd) == 'examples':
sys.path.insert(0, dirname(cwd))
fix_pythonpath_if_working_locally()
# Commented out IPython magic to ensure Python compatibility.
# %load_ext autoreload
# %autoreload 2
# %matplotlib inl
import pandas as pd
import numpy as np
import datetime
import time
from datetime import datetime
from sklearn import preprocessing
from sklearn.preprocessing import OneHotEncoder
from sklearn.preprocessing import LabelEncoder
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split
from sklearn.model_selection import train_test_split
from sklearn.utils import shuffle
from sklearn.preprocessing import MinMaxScaler
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import shutil
import os
import seaborn as sns
import torch
from torch import nn
import torch.nn.functional as F
import torch.optim as optim
from torch.utils.tensorboard import SummaryWriter
from tqdm import tqdm_notebook as tqdm
import u8darts
from u8darts import TimeSeries
from u8darts.dataprocessing.transformers import Scaler
from u8darts.models import TransformerModel, ExponentialSmoothing
from u8darts.metrics import mape
from u8darts.utils.statistics import check_seasonality, plot_acf
import warnings
warnings.filterwarnings("ignore")
import logging
But I have got this error:
Traceback (most recent call last):
File "/vol/0/home/kherad/reihane/darts.py", line 59, in <module>
import u8darts
ModuleNotFoundError: No module named 'u8darts'
How can I fix this error?(I have use
pip install u8darts
in terminal and installed successfully)