|
PYTHONPATH on Ubuntu Linux |
Posted by quantlabs on Jan-11-2019 13:58 |
|
HI there
I have set my PYTHONPATH in my Ubuntu Linux .profile to:
export PYTHONPATH=$PYTHONPATH:/home/myuser/DOCS/Documents/python/chartdirector/ChartDirector/lib
When the library files reside for the Linux version of ChartDirector. I can see the PYTHONPATH is correct for the searchable directory needed for ChartDirectory.
When I test the import with a raw Python 3.6.7. interpreter, I get an error as explained below:
import FinanceChart
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/caustic/DOCS/Documents/python/chartdirector/ChartDirector/lib/FinanceChart.py", line 2, in <module>
from pychartdir import *
File "/home/caustic/DOCS/Documents/python/chartdirector/ChartDirector/lib/pychartdir.py", line 5, in <module>
cdDll = __import__("pychartdir" + cdSysVer[0] + cdSysVer[2])
ImportError: /usr/lib/python3.6/lib-dynload/pychartdir36.so: invalid ELF header
One item I noted was that pychartdir36.so nor pychartdir35.so existed in the Linux ZIP download. The import above needed pychartdir36.so since it reported this file was missing. I manually copied this pychartdir36.so from my working Mac version to the appropriate directory in my Ubuntu Linux environment. Is there something or a step I am missing ? Awesome support and product so expect a new customer soon.
Thanks |
Re: PYTHONPATH on Ubuntu Linux |
Posted by quantlabs on Jan-11-2019 14:08 |
|
I am also using Ubuntu 18.04. SHould I downgrade my Python interpreter to v 3.4 to get running properly? |
Re: PYTHONPATH on Ubuntu Linux |
Posted by Peter Kwan on Jan-12-2019 01:03 |
|
Hi quantlabs,
I have just downloaded ChartDirector for Python for Linux (x86_64) and also for Linux (i386/i686). In both distributions, I can find pychartdir36.so. In fact, there is even a pychartdir37.so.
If your Linux Python is 64-bit, please use the Linux for (x86_64). If your Linux Python is 32-bit, please use the Linux for (i386/i686). You cannot use the Mac OS version on a Linux computer.
Please make sure you download the latest version from our web site directly. You need a ChartDirector distribution that is downloaded after Python 3.6 is released, otherwise it cannot possibly have Python 3.6 support. (The latest release is updated on Sept 2018 for Python 3.7 support.)
Please copy everything from "ChartDirector/lib" to a directory in your Python search path. (It needs not just pychartdir36.so, but also libchartdir.so and the fonts subdirectory.) Copying everything ensures it works for all Python versions released as of now.
Hope this can help.
Regards
Peter Kwan |
Re: PYTHONPATH on Ubuntu Linux |
Posted by quantlabs on Jan-12-2019 01:35 |
|
Hi peter
Thanks for the updates. Everything is working now! |
|