Re: [Tutor] sitecustomize
On 07/02/2012 03:17 PM, Ali Torkamani wrote: > Hi, > I'm absolutely newbie, and appreciate your help, I'm using Spyder, some > times it randomly get the following error: The first place I found Spyder was here: https://en.wikipedia.org/wiki/SPYDER which is an anti-aircraft system based partly on the Python-5 mssile. But presumably you mean: http://pypi.python.org/pypi/spyder > 'import sitecustomize' failed; use -v for traceback > > while, I'm not importing and have no idea what is importing it, site is automatically imported by Python during startup. It lets you customize things in a global way before starting your particular script. And one of the things it does it to import sitecustomize See this link: http://docs.python.org/library/site.html and also: http://www.doughellmann.com/PyMOTW/site/ My guess is that something's wrong with your Spyder installation, and you should check on their mailing list. But the first thing you might do is to add -v as your error message suggests. For some reason Spyder is hiding 3/4 of your error. -- DaveA ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] sitecustomize
On 7/2/2012 12:17 PM Ali Torkamani said... Hi, I'm absolutely newbie, and appreciate your help, I'm using Spyder, some times it randomly get the following error: 'import sitecustomize' failed; use -v for traceback This appears to be somewhat common as if you google for 'spyder sitecustomize' you'll get lots of hits and references. I'd start there -- it certainly doesn't seem to be a learning python issue. Emile while, I'm not importing and have no idea what is importing it, this happens even if my code is as simple as following: import sys import pdb #import traceback import numpy as np #import scipy as sp #import cmath class GaussianProcess(object): def __init__(self,data=None,data_mask=None): self.data,self.data_mask=data,data_mask if data==None and data_mask==None: self.GeneraterandomData(100,5,3,2) def GeneraterandomData(self,N,C,Lag,nUnknown): # N number of Samples, C: number of features, Lag: Number of autoregressions, nUnknown: number of unknown features at each time pdb.set_trace() self.data=np.random.rand(N,C) self.data_mask=np.ones((Lag,C)) self.data_mask[0,0:nUnknown]=0 return self.data,self.data_mask def main(argv=None): if argv==None: argv=sys.argv GP=GaussianProcess(); #print(GP.data,GP.data_mask) print("Done!") if __name__=="__main__": sys.exit(main()) Thanks, Ali ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
[Tutor] sitecustomize
Hi, I'm absolutely newbie, and appreciate your help, I'm using Spyder, some times it randomly get the following error: 'import sitecustomize' failed; use -v for traceback while, I'm not importing and have no idea what is importing it, this happens even if my code is as simple as following: import sys import pdb #import traceback import numpy as np #import scipy as sp #import cmath class GaussianProcess(object): def __init__(self,data=None,data_mask=None): self.data,self.data_mask=data,data_mask if data==None and data_mask==None: self.GeneraterandomData(100,5,3,2) def GeneraterandomData(self,N,C,Lag,nUnknown): # N number of Samples, C: number of features, Lag: Number of autoregressions, nUnknown: number of unknown features at each time pdb.set_trace() self.data=np.random.rand(N,C) self.data_mask=np.ones((Lag,C)) self.data_mask[0,0:nUnknown]=0 return self.data,self.data_mask def main(argv=None): if argv==None: argv=sys.argv GP=GaussianProcess(); #print(GP.data,GP.data_mask) print("Done!") if __name__=="__main__": sys.exit(main()) Thanks, Ali ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor