469,338 Members | 8,242 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,338 developers. It's quick & easy.

How to change settings directory to run gnuplot on linux [solved?]

Hi, I'm a chemist trying to use the python script GaussSum.py with gnuplot for creating dataplots, and need some help. Whenever I try to produce a plot from the GaussSum GUI I get the error

sh: line 1: /Users/kristine/Desktop/GaussSum-1.0.5/gnuplot400/bin/wgnuplot.exe: No such file or directory

in my terminal. At the moment, I have gnuplot in the path /usr/local/bin instead. So I need to know how to change the settings directory to enable GaussSum to call gnuplot. Can anyone advise me on what or where to edit in the script please? I've pasted a section of the GaussSum.py where I'm guessing should be editted.

Thanks in advance!

Expand|Select|Wrap|Line Numbers
  1.     def preferences(self):
  2.         # The Preferences Dialog Box
  3.         oldsettings=copy.deepcopy(self.settings) # Remember the old settings
  4.         d=PreferencesPopupBox(root,self.settings,title="Settings")
  5.         if self.settings!=oldsettings: # if there are any changes
  6.             self.saveprefs()
  7.  
  8.     def saveprefs(self):
  9.         # Save the settings
  10.         appdata=os.getenv("HOME")
  11.         settingsfile=os.path.join(appdata,".GaussSum1.0","GaussSum.ini")
  12.         writeoutconfigfile(self.settings,settingsfile)
  13.  
  14.  
  15.     def readprefs(self):
  16.         # Check for GaussSum.ini in $HOME/GaussSum1.0 (XP)
  17.         #                        or $HOME/.gausssum1.0 (Linux)
  18.  
  19.         appdata=os.getenv("HOME")
  20.         self.settings={}
  21.  
  22.         if appdata==None: # Must not be a Windows machine!!
  23.             self.screen.write("Environmental variable HOME is not defined!\n\
  24.                                I cannot continue, as I need HOME to know\
  25.                                where to store GaussSum settings.\n")
  26.         else: # If everything is normal so far
  27.             settingsdir=os.path.join(appdata,".GaussSum1.0")
  28.             settingsfile=os.path.join(settingsdir,"GaussSum.ini")
  29.  
  30.             if os.path.isfile(settingsfile): # Check for settings file
  31.                 # Found it! - so read it in.
  32.                 self.settings=readinconfigfile(settingsfile)
  33.  
  34.             else: # Initialise the settings file (and directory)
  35.                 if not os.path.isdir(settingsdir):
  36.                     os.mkdir(settingsdir)
  37.                 self.settings={'global settings.filetype':'Gaussian',
  38.                                'global settings.gnuplot':os.path.join(sys.path[0],"gnuplot400","bin","wgnuplot.exe"),
  39.                                'find.text1':'SCF Done',
  40.                                'find.text2':'k 501%k502',
  41.                                'find.text3':'imaginary',
  42.                                'find.text4':'Framework',
  43.                                'ir_raman.start':'0',
  44.                                'ir_raman.end':'4000',
  45.                                'ir_raman.numpoints':'500',
  46.                                'ir_raman.fwhm':'3',
  47.                                'mo.start':'-20',
  48.                                'mo.end':'0',
  49.                                'mo.fwhm':'0.3',
  50.                                'uvvis.start':'300',
  51.                                'uvvis.end':'800',
  52.                                'uvvis.numpoints':'500',
  53.                                'uvvis.fwhm':'3000',
  54.                                'uvvis.sigma':'0.2',
  55.                                'eddm.cubman':'C:\\Gaussian\\cubman.exe',
  56.                                'eddm.formchk':'C:\\Gaussian\\formchk.exe',
  57.                                'eddm.cubegen':'C:\\Gaussian\\cubegen.exe',
  58.                                'nmr.data':os.path.join(settingsdir,"nmrdata.txt")
  59.                                }
  60.                 self.saveprefs() # Save the inital settings file
Oct 24 '06 #1
2 5115
bvdet
2,851 Expert Mod 2GB
I guess sometimes when having problems with Python stuff, so I will guess here. Have you tried to determine your current value of 'sys.path[0]? If it is '/Users/kristine/Desktop/GaussSum-1.0.5', you may try substituting your path here:
Expand|Select|Wrap|Line Numbers
  1.  else: # Initialise the settings file (and directory)
  2.                 if not os.path.isdir(settingsdir):
  3.                     os.mkdir(settingsdir)
  4.                 self.settings={'global settings.filetype':'Gaussian',
  5.                                'global settings.gnuplot':os.path.join('usr', 'local', 'bin'),
  6.                                .......
  7.  
Sometimes I get lucky, but not usually the first time.
Oct 24 '06 #2
bartonc
6,596 Expert 4TB
Looks like the key is here:

Expand|Select|Wrap|Line Numbers
  1.     def readprefs(self):
  2.         # Check for GaussSum.ini in $HOME/GaussSum1.0 (XP)
  3.         # or $HOME/.gausssum1.0 (Linux)
  4.  
  5.         appdata=os.getenv("HOME")
  6.  
My guess is that the since $HOME is /Users/kristine/Desktop/, you need the /GaussSum-1.0.5 directory there with /gnuplot400/bin/wgnuplot.exe in it.
If you don't want the directory there, look in the .gausssum1.0 file and change the path if it's in there.
Good luck,
Barton
Oct 24 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Rama Calaga | last post: by
reply views Thread by Cousin Stanley | last post: by
6 posts views Thread by Joseph Suprenant | last post: by
reply views Thread by Kamil Grymuza | last post: by
2 posts views Thread by Titi Anggono | last post: by
1 post views Thread by Nicola Kaiser | last post: by
11 posts views Thread by cybervigilante | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Purva khokhar | last post: by
1 post views Thread by haryvincent176 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.