'FileNotFoundError: Model does not exist. Check your path and try again
i am trying to create a project folder for my results to be sent with this code:
fldr = 'D:/release/Sample models/sioux_falls_2020_02_15'
proj_name = 'SiouxFalls.sqlite'
dt_fldr = '0_tntp_data' #*
prj_fldr = '1_project' #*
skm_fldr = '2_skim_results' #*
assg_fldr = '4_assignment_results' #*
dstr_fldr = '5_distribution_results' #*
frcst_fldr = '6_forecast' #*
ftr_fldr = '7_future_year_assignment' #*
p = Parameters() #*
p.parameters['system']['logging_directory'] = fldr #*
p.write_back() #*
# We the project open, we can tell the logger to direct all messages to the terminal as well
stdout_handler = logging.StreamHandler(sys.stdout)
formatter = logging.Formatter("%(asctime)s;%(name)s;%(levelname)s ; %(message)s")
stdout_handler.setFormatter(formatter)
logger.addHandler(stdout_handler)
############# PROJECT########## *
project = Project() #*
project.load(join(fldr, prj_fldr, proj_name)) #*
however, I am receiving this error in my terminal:
File "test1.py", line 63, in <module>
project.load(join(fldr, prj_fldr, proj_name)) #*
File "/home/karabo/.local/lib/python3.8/site-packages/aequilibrae/project/project.py", line 119, in load
self.open(project_path)
File "/home/karabo/.local/lib/python3.8/site-packages/aequilibrae/project/project.py", line 57, in open
raise FileNotFoundError("Model does not exist. Check your path and try again")
FileNotFoundError: Model does not exist. Check your path and try again
Any help would be greatly appreciated.
Solution 1:[1]
The issue here is that the path needs to be set to the folder where the project database is, as AequilibraE projects are a set of files inside a folder (Example in the documentation. So I suspect the appropriate code would be:
fldr = 'D:/release/Sample models/sioux_falls_2020_02_15'
project = Project()
project.load(fldr)
Disclosure: I am the creator of the AequilibraE package.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | PCamargo |