TypeError: 'NoneType' object is not iterable

340 views
Skip to first unread message

Sven Borgstrom

unread,
Dec 13, 2021, 12:48:07 PM12/13/21
to MintPy
Hi Yunjun,

I have a problem using "view.py" script, resulting in the error message in the subject.
For instance, if I run "view.py waterMask.h5", I get:

Traceback (most recent call last):
  File "/Users/Sven/python/miniconda3/envs/mintpy/bin/view.py", line 8, in <module>
    sys.exit(main())
  File "/Users/Sven/python/MintPy/mintpy/view.py", line 1663, in main
    obj.configure()
  File "/Users/Sven/python/MintPy/mintpy/view.py", line 1538, in configure
    inps = cmd_line_parse(self.iargs)
  File "/Users/Sven/python/MintPy/mintpy/view.py", line 175, in cmd_line_parse
    geo_opt_names = list(set(geo_opt_names) & set(iargs))
TypeError: 'NoneType' object is not iterable

I suppose it depends on something wrong in my MintPy installation, because I have MintPy also in my office PC and the script works fine, or maybe this is a python error.
How can I try to fix this?
Thanks and sorry for disturbing you.
Sven.

Jiageng wang

unread,
Dec 15, 2021, 2:37:43 AM12/15/21
to MintPy
Same problem :<, I think maybe the different version of script in python and git?

Jiageng wang

unread,
Dec 15, 2021, 3:51:30 AM12/15/21
to MintPy
I checked the python files in anaconda - mintpy, I think the problem is due to the miss of input parameters.
I must thank Joseph Kennedy for adding it into conda-forge first, and it may be a causing reason.

If you copy it out and try to use the script like this, it will work. You can use this method temporally.
like this:
home/wjg/Insar_App_tools/Mintpy/mintpy/view.py /mnt/Disk2/QLM_CZD/mintpy/velocity.h5 
So the view.py is okay, the parameters are alright

So here is my suggestion to fix it, and I hope it can help

Whether if there is a parameter loss when processing bin/view.py -> lib/python/site-packages?
beacuse there`s sys.argv[0:] to sys.argv[1:0]

Whether if the format of geo_opt_names cant recognise the iargs for input file?
because there is no iargs for input file

Zhang Yunjun

unread,
Dec 15, 2021, 2:39:23 PM12/15/21
to MintPy
Hi all,

I had the same issue as you before (https://github.com/yunjunz/MintPy/issues/5). And as Jiageng has pointed out, it's due to the pip install, which is also used in the conda install. So it's an installation issue, not a bug in the script itself. And this appears to be a problem for view.py only as far as I can tell. 

The old installation procedure (install dependencies via conda, and install mintpy via env variable setup) still works.

I hope to push a fix for this after AGU.

Yunjun
Reply all
Reply to author
Forward
0 new messages