ubantu14.04版本中安裝了Python,分別為2.7版本的和3.4版本的。
我用Python2.7運行一個prepxml.py,出現 No module named tsinsar,但是用Python3.4可以匯入,但是出現'module' object has no attribute 'TSXML。tsinsar檔案下有__init__.py,并且Python2.7和3.4的默認搜索路徑包含tsinsar的路徑。
這個問題困擾了我好長時間,求大神指點迷津!!!
prepxml.py的代碼為:
import tsinsar as ts
import argparse
import numpy as np
def parse():
parser= argparse.ArgumentParser(description='Preparation of XML files for setting up the processing chain. Check tsinsar/tsxml.py for details on the parameters.')
parser.parse_args()
parse()
g = ts.TSXML('data')
g.prepare_data_xml('kuchiera',proc='GAMMA',xlim=None,ylim=None,rxlim=None,rylim=None,latfile='lat-geo.bin',lonfile='lon-geo.bin',hgtfile='hgt-geo.bin',inc=38.7,cohth=0.05,chgendian='False',masktype='f4',unwfmt='FLT',corfmt='FLT',demfmt='FLT')
g.writexml('data.xml')
g = ts.TSXML('params')
g.prepare_sbas_xml(nvalid=60,netramp=True,atmos='TROPO',uwcheck=False,regu=True,masterdate='20070107',filt=0.4,tropolooks=6)
g.writexml('sbas.xml')
g = ts.TSXML('params')
g.prepare_mints_xml(netramp=True,atmos='TROPO',demerr=False,uwcheck=True,regu=False,masterdate='20070107')
g.writexml('mints.xml')
出現的而錯誤為:
xxx@xxx-OptiPlex-960:~/DATA/kuchiera$ python2.7 prepxml.py
Traceback (most recent call last):
File "prepxml.py", line 1, in <module>
import tsinsar as ts
ImportError: No module named tsinsar
xxx@xxx-OptiPlex-960:~/DATA/kuchiera$ python3.4 prepxml.py
Traceback (most recent call last):
File "prepxml.py", line 11, in <module>
g = ts.TSXML('data')
AttributeError: 'module' object has no attribute 'TSXML'
uj5u.com熱心網友回復:
您好,請問您這個問題解決了嗎,我也遇到了這樣的問題uj5u.com熱心網友回復:
已經知道了,原來是環境變數弄錯了轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/99053.html
標籤:系統維護與使用區
上一篇:Cpu使用率高達200%
下一篇:raspbian壁紙?
