dhitools icon indicating copy to clipboard operation
dhitools copied to clipboard

help ///

Open zzme110 opened this issue 6 years ago • 12 comments

An Error Has Occurred,when i ran this dode: dhitools/notebooks/dfs012_analysis.ipynb, and my version of python is 3.7. (anconda) Can u help me solve this error?,thanks error: File "C:\ProgramData\Anaconda3\lib\site-packages\dhitools\dfs.py", line 45, in dfs_info self.num_items = dfs_object.ItemInfo.Count AttributeError: 'list' object has no attribute 'Count'

zzme110 avatar Jun 23 '19 14:06 zzme110

Which version of SDK do you install? Which line does this error occur? I think this error comes from the SDK dependency settings.

famiuer avatar Jun 23 '19 15:06 famiuer

My sdk is 2019. I will check the mistake according to your suggestion tomorrow. My programming skills are poor. It took a long time and it was frustrating. Thank you for your help!

zzme110 avatar Jun 23 '19 18:06 zzme110

Which version of pythonnet do you have?

maximlt avatar Jun 23 '19 22:06 maximlt

pythonnet 2. 4.0

zzme110 avatar Jun 24 '19 01:06 zzme110

image

zzme110 avatar Jun 24 '19 01:06 zzme110

I can run the program now, but I don't fully understand the principle. This time I used conda install -c pythonnet instead of pip install pythonnet and then it worked. I just wonder why conda install -c pythonnet pythonnet must be used.

zzme110 avatar Jun 24 '19 03:06 zzme110

When you download pythonnet through the pythonnet channel, you get the 2.3 version, while you get the 2.4 version with pip. Different versions, hence different behaviours apparently, that's why your code broke. If you prefer to use conda, you could download pythonnet on the conda-forge channel (conda install -c conda-forge pythonnet)

maximlt avatar Jun 24 '19 05:06 maximlt

Thank you ! and i want to know how can i get the information of sdk's methods or functions ? Because I want to make some other tools.

zzme110 avatar Jun 24 '19 12:06 zzme110

Here are a few useful links: http://doc.mikepoweredbydhi.help/webhelp/2017/DHI_DFS/html/N_.htm http://doc.mikepoweredbydhi.help/webhelp/2017/DHI_PFS/html/N_DHI_PFS.htm http://doc.mikepoweredbydhi.help/webhelp/2017/DHI_Projections/html/N_DHI_Projections.htm https://github.com/DHI

maximlt avatar Jun 24 '19 14:06 maximlt

The mistake happened again, After my test, the attribute of iteminfo cannot be explained, The pythonnet 2.4.0 has been installed and other uninstalled. I used the anconda running it . I retested it on a different computer and got the same result

zzme110 avatar Jun 27 '19 04:06 zzme110

I found the answer that 2.4 version leads this error.

zzme110 avatar Jun 27 '19 08:06 zzme110