Open zasddsgg opened 1 month ago
@zasddsgg, thanks for posting this issue!
Recently matplotlib restructured their imports. Yesterday I made updates to the bioindustrial-park and fixed this issue. Could you try updating your local bioindustrial-park, biosteam, and thermosteam again?
Updating should take care of the error... Note that the code lines in the repo are different (since just yesterday):
I re-used git clone
to download the latest Bioindustrial-Park, biosteam and thermosteam
. After installation, when the code ran to cs.cornstover_sys.save_report('cornstover.xlsx')
, The following errors are reported.
FileNotFoundError Traceback (most recent call last)
File D:\anaconda\envs\zddd\lib\site-packages\biosteam\_system.py:3346, in System.save_report(self, file, dpi, **stream_properties)
3345 worksheet = writer.book.create_sheet('Flowsheet')
-> 3346 flowsheet = openpyxl.drawing.image.Image('flowsheet.png')
3347 worksheet.add_image(flowsheet, anchor='A1')
File D:\anaconda\envs\zddd\lib\site-packages\openpyxl\drawing\image.py:32, in Image.__init__(self, img)
31 mark_to_close = isinstance(img, str)
---> 32 image = _import_image(img)
33 self.width, self.height = image.size
File D:\anaconda\envs\zddd\lib\site-packages\openpyxl\drawing\image.py:16, in _import_image(img)
15 if not isinstance(img, PILImage.Image):
---> 16 img = PILImage.open(img)
18 return img
File D:\anaconda\envs\zddd\lib\site-packages\PIL\Image.py:3277, in open(fp, mode, formats)
3276 if filename:
-> 3277 fp = builtins.open(filename, "rb")
3278 exclusive_fp = True
FileNotFoundError: [Errno 2] No such file or directory: 'D:\\biosteam_study\\flowsheet.png'
During handling of the above exception, another exception occurred:
AttributeError Traceback (most recent call last)
Cell In[1], line 10
8 cs.cornstover_sys.diagram(format='png')
9 tea=create_cellulosic_ethanol_tea(cs.cornstover_sys)
---> 10 cs.cornstover_sys.save_report('cornstover.xlsx')
11 print(tea._DPI(tea.installed_equipment_cost)/1000000)
12 print(tea._TDC(tea._DPI(tea.installed_equipment_cost))/1000000)
File D:\anaconda\envs\zddd\lib\site-packages\biosteam\_system.py:3359, in System.save_report(self, file, dpi, **stream_properties)
3356 except:
3357 warn("problem in saving flowsheet; please submit issue to BioSTEAM with"
3358 "your current version of openpyxl and xlsx writer", RuntimeWarning)
-> 3359 worksheet.insert_image('A1', 'flowsheet.png')
3360 diagram_completed = True
3362 tea = self.TEA
AttributeError: 'Worksheet' object has no attribute 'insert_image'
Besides, after running the code cs.cornstover_sys.diagram(format='png')
, there is no diagram appears.
Could I consult you If I only use cd Bioindustrial-Park, pip install .
to install. Is it OK (this process seems to automatically install biosteam and thermosteam)? Or do I have to use the cd biosteam, pip install . , cd thermosteam, pip install .
after cd Bioindustrial-Park, pip install .
to reinstall biosteam and thermosteam?
@zasddsgg, did you get a new computer or reset your old one? Please follow these steps to install graphviz on your computer: https://forum.graphviz.org/t/new-simplified-installation-procedure-on-windows/224#format-svg-not-recognized-use-one-of
You may need to add graphviz to your system path as well.
If the problem persists, run the following and send me the traceback:
>>> from biosteam import preferences
>>> preferences.raise_exception = True
>>> from biorefineries import cornstover as cs
>>> cs.cornstover_sys.diagram(format='png')
Thanks,
I got it. The problem has been solved.
For installation by git clone , could I consult you If I only use cd Bioindustrial-Park, pip install . to install. Is it OK (this process seems to automatically install biosteam and thermosteam)? Or do I have to use the cd biosteam, pip install . , cd thermosteam, pip install . after cd Bioindustrial-Park, pip install . to reinstall biosteam and thermosteam?
In my process, do I need to set preferences.raise_exception = True.
Thanks for your help again.
Hello, I have installed biorefineries, biosteam and thermosteam with code
pip install .
andgit clone
. However, when I call the following code, I will encounter the following error. May I ask you how to solve it? I use git clone https://github.com/BioSTEAMDevelopmentGroup/Bioindustrial-Park.git, git clone https://github.com/BioSTEAMDevelopmentGroup/biosteam.git and git clone https://github.com/BioSTEAMDevelopmentGroup/thermosteam.git, and cd Bioindustrial-Park folder, usepip install .
, cd biosteam folder, usepip install .
, cd thermosteam folder, usepip install .
to install biorefineries, biosteam and thermosteam.The code is as follows:
The error information is as follows: