(Updated December 24, 2014)
By far the easiest way for a Canopy subscriber (commercial or academic) to install PyXLL (either purchased or 30-day trial) is from the Canopy Package Manager or with the "enpkg" command line utility. This custom build of PyXLL handles most of the details of configuring PyXLL to work with both Excel and Canopy User Python.
Please note that for fundamental technical reasons, PyXLL is only available for Excel on Windows. For Mac or Linux users who wish to take advantage of PyXLL, you can use it (as many of us at Enthought do), in a Windows Virtual Machine such as Fusion. Your single PyXLL and Canopy licenses are good on as many physical and virtual machines as you individually use.
To install PyXLL for use with Canopy Python, please follow these steps:
- Launch the Package Manager from the Canopy Welcome Screen.
- Select “Available Packages” and search for “pyxll”. Select the “pyxll” package from the list and click the “Install” button to the right to have Canopy download and install PyXLL for you.
Next (steps 3-5), you will edit the pyxll.cfg config file to configure PyXLL on your machine.
Start by launching the “Canopy Command Prompt” from the Canopy Tools menu.
At the Windows command prompt type:
This will launch Canopy and open the pyxll.cfg configuration file for editing.
Here are the edits that you should make to this configuration file.
(For detailed discussion of the format of this file, see this article in the PyXLL documentation: https://www.pyxll.com/docs/index.html#config-file.)
* In the "[PYXLL]" section of the configuration file, set "pythonpath" to specify one or more directories where where you will put your Python modules to define Excel-callable functions. For now, for convenience, this may be the same as where you’ve extracted the archive to.
* Set "modules" to the name of the Python module where your first functions will be defined. You can add more module names later.
* In the "[log]" section, set
file to where you want log files to be written.
* If you have a license key, copy it to the license section as described in the documentation. If you do not have a license key, your PyXLL trial is good for 30 days.
Note: For sharing spreadsheets, anyone using a spreadsheet that uses PyXLL functionality will need to have a working installation of Canopy (Python) & PyXLL, along with all custom Python source code used by the PyXLL module. Otherwise, the user may be able to open the spreadsheet to a static view of the last saved state of the spreadsheet, but will generate errors if any cells are refreshed (either manually or automatically by the spreadsheet/PyXLL).
Please do not enter support requests in article comments
Please use article comments for suggestions to improve the article. For individual support requests, please follow these guidelines.