ChartDirector Ver 3.0 (Python Edition)
Installation
Windows Installation
This section describes how to install ChartDirector for Python under Windows. For
the Linux, FreeBSD or Solaris version, please refer to
Linux/FreeBSD/Solaris Installation.
Python Version Compatibility on Windows
ChartDirector for Python on Windows has been tested with the following Python versions:
- Python 2.2.x (the latest Python release as of the date of this document)
- Python 2.1.x
- Python 2.0.x
- Python 1.6.x
- Python 1.5.x
Installing ChartDirector for Python on Windows
ChartDirector for Python on Windows is distributed as a zip file. To install
ChartDirector:
- Unzip the ChartDirector distribution.
- The ChartDirector for Python module and its supporting DLLs are in the
"ChartDirector\lib" subdirectory. Copy all files in the "ChartDirector\lib"
subdirectory to a subdirectory in the Python module search path in your system.
If you do not know what is the Python module search path in your system, you may
enter the following command to find out.
python -c "import sys;print sys.path"
|
If you could not access any of the subdirectories in the default Python module
search path (e.g. you are using a virtual web host, and the system directories
are inaccessible to you), there are a number of alternative methods to install
the ChartDirector for Python module. For example:
- Copy all files in "ChartDirector\lib" to the same directory as the script.
- Set the PYTHONPATH environment variable to add an extra subdirectory to the
Python module search path.
- Directly manipulate the "sys.path" variable in your Python script to change
the Python module search path for your script.
Installing Sample Programs on Windows
ChartDirector for Python comes with numerous sample Python scripts under the
"ChartDirector\pythondemo" and "ChartDirector\pythondemo_cgi" subdirectories. The
former is for standalone scripts, while the latter is for CGI scripts. They are
good examples and tutorials on how to use ChartDirector.
You may run these sample scripts to verify that ChartDirector is correctly
installed.
To run the standalone ChartDirector sample scripts:
- In the command line prompt, change to the "ChartDirector\pythondemo"
subdirectory.
Note: If you have not installed the ChartDirector for Python modules in a
directory in your Python module search path, you would need to copy all files in
"ChartDirector\lib" to the "ChartDirector\pythondemo" subdirectory.
- Type "python [script_name]". For example, the command "python simplebar.py"
should generate a PNG chart image called "simplebar.png".
To run the ChartDirector sample CGI scripts:
- Copy all files in "ChartDirector\pythondemo_cgi" to your web server's CGI
directory.
Note: If you have not installed the ChartDirector for Python modules in a
directory in your Python module search path, you would need to copy all files in
"ChartDirector\lib" the same CGI script directory as the ChartDirector sample
scripts.
- Browse the sample scripts by using a browser to access the sample scripts
index page "index.py".
If for some reason, you cannot see the charts, please click on the "check
installation" link on main index page. This will perform a diagnostic test
and display any error encountered.
Installing ChartDirector License on Windows
If you have purchased a license to use ChartDirector, you should have a license
code delivered to you via email and postal mail.
To install the license code, follow the steps below:
- Save the license code in an ASCII text file, and name the file
"chartdir.lic". The ASCII text file should contain just one line,
which is the license code. A sample license file is available at
http://www.advsofteng.com/chartdir.lic
for your reference.
- Put the license file in the same directory as "chartdir.dll", which should
be in the directory where the ChartDirector for Python modules are installed or
copied to.
- If you are using ChartDirector with a web server, make sure the web server
"anonymous user" has sufficient privileges to read the license file.
Using ChartDirector for Python on Windows
Any Python prorgam that uses ChartDirector should include the following statement:
import pychartdir
or
from * import pychartdir
Depending on how you have installed ChartDirector, you may need to copy the ChartDirector
for Python modules to your script directory. Please refer to the
installation
instructions for details.
Linux/FreeBSD/Solaris Installation
This section describes how to install ChartDirector for Python under
Linux/FreeBSD/Solaris. For the Windows version, please refer to
Windows
Installation.
Python Version Compatibility on Linux/FreeBSD/Solaris
ChartDirector for Python on Linux/FreeBSD/Solaris has been tested with the
following Python versions:
- Python 2.2.x (the latest Python release as of the date of this document)
- Python 2.1.x
- Python 2.0.x
- Python 1.6.x
- Python 1.5.x
Installing ChartDirector for Python on Linux/FreeBSD/Solaris
ChartDirector for Perl on Linux/FreeBSD/Solaris is distributed as a tar.gz file.
To install ChartDirector:
If you could not access any of the subdirectories in the default Python module
search path (e.g. you are using a virtual web host, and the system directories
are inaccessible to you), there are a number of alternative methods to install
the ChartDirector for Python module. For example:
- Copy *everything* (recrusive copy) in "ChartDirector/lib" to the same
directory as the script.
- Set the PYTHONPATH environment variable to add an extra subdirectory to the
Python module search path.
- Directly manipulate the "sys.path" variable in your Python script to change
the Python module search path for your script.
Installing Sample Programs on Linux/FreeBSD/Solaris
ChartDirector for Python comes with numerous sample Python scripts under the
"ChartDirector/pythondemo" and "ChartDirector/pythondemo_cgi" subdirectories. The
former is for standalone scripts, while the latter is for CGI scripts. They are
good examples and tutorials on how to use ChartDirector.
You may run these sample scripts to verify that ChartDirector is correctly
installed.
To run the standalone ChartDirector sample scripts:
- In the command line prompt, change to the "ChartDirector/pythondemo"
subdirectory.
Note: If you have not installed the ChartDirector for Python modules in a
directory in your Python module search path, you would need to copy *everything*
(recrusive copy) in "ChartDirector/lib" to the "ChartDirector/pythondemo"
subdirectory.
- Type "python [script_name]". For example, the command "python simplebar.py"
should generate a PNG chart image called "simplebar.png".
To run the ChartDirector sample CGI scripts:
- Copy all files in "ChartDirector/pythondemo_cgi" to your web server's CGI
directory.
Note: If you have not installed the ChartDirector for Python modules in a
directory in your Python module search path, you would need to copy *everything*
(recrusive copy) in "ChartDirector/lib" the same CGI script directory as the
ChartDirector sample scripts.
- Browse the sample scripts by using a browser to access the sample scripts
index page "index.py".
Note that all ChartDirector sample scripts assume the Python interpreter is at
"#!/usr/bin/python" for Linux, and "#!/usr/local/bin/python" for FreeBSD and
Solaris. If your Python interpreter is not at the expected location, you could
create a symbolic link at the expected location to point to the actual location
of your Python interpreter. (Of course, you could also change all scripts to use
"#!", but it is much easier to just make a link.)
|
If for some reason, you cannot see the charts, please click on the "check
installation" link on main index page. This will perform a diagnostic test
and display any error encountered.
Installing ChartDirector License on Linux/FreeBSD/Solaris
If you have purchased a license to use ChartDirector, you should have a license
code delivered to you via email and postal mail.
To install the license code, follow the steps below:
- Save the license code in an ASCII text file, and name the file
"chartdir.lic". The ASCII text file should contain just one line,
which is the license code. A sample license file is available at
http://www.advsofteng.com/chartdir.lic
for your reference.
- Put the license file in the same directory as "libchartdir.so", which should
be in the directory where the ChartDirector for Python modules are installed or
copied to.
- If you are using ChartDirector with a web server, make sure the web server
"anonymous user" has sufficient privileges to read the license file.
Using ChartDirector for Python on Linux/FreeBSD/Solaris
Any Python prorgam that uses ChartDirector should include the following statement:
import pychartdir
or
from * import pychartdir
Depending on how you have installed ChartDirector, you may need to copy the ChartDirector
for Python modules to your script directory. Please refer to the
installation
instructions for details.
© 2003 Advanced Software Engineering Limited. All rights reserved.