473,396 Members | 1,996 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 5341
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Rama Calaga | last post by:
Hi, I use both python and gnuplot a lot, but I am unable to find a way to embed gnuplot "window/canvas" into tkinter. BLT option in PMW is not so powerful and not so great, any suggestions ?? ...
7
by: Jive | last post by:
Here's my sitch: I use gnuplot.py at work, platform Win32. I want to upgrade to Python 2.4. Gnuplot.py uses extension module Numeric. Numeric is now "unsupported." The documentation says "If...
0
by: Cousin Stanley | last post by:
Experimenting with the gnuplot package under Debian Linux, I've found that the -reverse option when used to start gnuplot from the command-line will produce plots that are color-reversed and...
9
by: syd | last post by:
I don't even know where to begin. This is just bizarre. I just picked up the Gnuplot.py module (a light interface to gnuplot commands) and was messing around with it today. I've got a tiny...
6
by: Joseph Suprenant | last post by:
Hello all, I have a C++ program, it does some calculations on things and then prints out a file in the format in which GNUPLOT can use. So my question is how would i call GNUPLOT from my C++...
0
by: Kamil Grymuza | last post by:
Can anyone help me controlling gnuplot from my program? I can't use any 3rd party libraries or so. I found on the net, that i can be done via pipes, but i don't know how to use them. All i need to...
2
by: Titi Anggono | last post by:
Hi all, I have some questions: 1. Can we use Tkinter for web application such as Java ? 2. I use gnuplot.py module for interfacing with gnuplot in linux. Can we make the plot result shown in...
1
by: Nicola Kaiser | last post by:
Hi, I´m using Gnuplot via gnuplot.py and I´m looking for a way to get the plotting output (terminal set to png in my case) piped in a string instead of to stdout or a file. Is there any...
11
by: cybervigilante | last post by:
I can't seem to change the include path on my local winmachine no matter what I do. It comes up as includ_path .;C:\php5\pear in phpinfo() but there is no such file. I installed the WAMP package...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.