Home > OS >  Python2.7 import module failure
Python2.7 import module failure

Time:09-30

Ubantu14.04 version installed Python, version 2.7 and version 3.4, respectively,
I run a prepxml with Python2.7. Py, appear No module named tsinsar, but with Python3.4 can import, but appear 'module' object has No attribute 'TSXML, under tsinsar file set p y, and the default search path contains Python2.7 and 3.4 tsinsar path,
The question has bothered me for a long time, the great spirit guide!!!!!!

Prepxml. Py code for:
The import tsinsar as ts
The import argparse
The import numpy as np

Def the 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 ()


The parse ()
G=ts. TSXML (' data ')
G.p repare_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.w ritexml (' data. XML)


G=ts. TSXML (' params)
G.p repare_sbas_xml (nvalid=60, netramp=True, atmos='TROPO', uwcheck=False, regu=True, masterdate='20070107', filt waste=0.4, tropolooks=6)
G.w ritexml (' sbas. XML)


G=ts. TSXML (' params)
G.p repare_mints_xml (netramp=True, atmos='TROPO', demerr=False, uwcheck=True, regu=False, masterdate='20070107')
G.w ritexml (' mints. XML)

And mistakes are:
@ XXX XXX - OptiPlex - 960: ~/DATA/kuchiera $ python2.7 prepxml. Py

Traceback (the most recent call last) :
The File "prepxml. Py", line 1, the in & lt; module>
The import tsinsar as ts
ImportError: No module named tsinsar

@ XXX XXX - OptiPlex - 960: ~/DATA/kuchiera $ python3.4 prepxml. Py

Traceback (the most recent call last) :
The File "prepxml. Py", line 11, the in & lt; module>
G=ts. TSXML (' data ')
AttributeError: 'module' object has no attribute 'TSXML'

CodePudding user response:

Hello, excuse me are you solved this problem, I also encountered such a problem

CodePudding user response:

Already know, is the environment variable is wrong
  • Related