Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Import Error
#1
Hello everyone

I downloaded a Github repo.
this is the main directory
Quote:baselines common configs envs firl fuck logs README.md run.sh utils

 import sys, os, time
  6 
  7 for i in sys.path:
  8     print(i)
  9 
 10 import numpy as np
 11 import torch
 12 import gym
 13 from ruamel.yaml import YAML
 14 
 15 from firl.divs.f_div import f_div_loss, f_div_current_state_loss
 16 from firl.divs.ipm import ipm_loss
 17 from firl.models.reward import MLPReward
 18 from firl.models.discrim import SMMIRLDisc as Disc
 19 from firl.models.discrim import SMMIRLCritic as Critic
 20 from common.sac import ReplayBuffer, SAC
 21 
 22 import envs
 23 from envs.tasks.grid_task import expert_density
 24 #from utils import system, collect, logger, eval
 25 from fk import system
 26 #from utils.plots.train_plot import plot, plot_disc, plot_submission
 27 #from utils import plot_submission
 28 from sklearn import neighbors
In line 24 (uncomment)
I will get an error that
Output:
Traceback (most recent call last): File "firl/irl_density.py", line 24, in <module> from utils import system, collect, logger, eval ImportError: cannot import name 'system'
I copied the folder into "fk" folder in this case its working Wall

What could be the reason? I am not allowed to use the name "utils" as folder
Thank you very much :)

Best Regards
Chris
Reply


Messages In This Thread
Import Error - by Christian - Apr-17-2021, 08:40 PM
RE: Import Error - by bowlofred - Apr-17-2021, 09:25 PM
RE: Import Error - by Christian - Apr-17-2021, 10:45 PM
RE: Import Error - by bowlofred - Apr-17-2021, 11:27 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  import module with syntax error Skaperen 7 605 Jun-22-2021, 10:38 AM
Last Post: Skaperen
  Folium import error kashif_flavio 2 849 Dec-07-2020, 08:58 AM
Last Post: bowlofred
  Import error Beingcode 0 912 Nov-20-2020, 02:57 AM
Last Post: Beingcode
Smile Import error with local file colt 1 618 Nov-08-2020, 07:56 AM
Last Post: Gribouillis
  switch from version 3.5.3 to 3.8.6 get import error python001 9 1,151 Oct-31-2020, 03:02 PM
Last Post: python001
  import yaml error for python3 maiya 4 5,449 Jul-15-2020, 06:07 PM
Last Post: Gribouillis
  Which app do I import to fix this error? ErnestTBass 6 1,783 Apr-26-2020, 08:43 PM
Last Post: snippsat
  Error while humansize module import. johnkgson 3 1,493 Apr-26-2020, 08:37 AM
Last Post: johnkgson
  Importing module from a package results in import error goghvv 2 874 Mar-27-2020, 07:13 PM
Last Post: goghvv
  Python 2.7 Import error. Directory and filename conflict petcoo00 2 915 Feb-02-2020, 08:46 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020