Installing PyXLL is as simple as running pip install pyxll
followed by pyxll install
.
Note
You do not need a license key to start using the free PyXLL trial
To activate the free 30 day trial when the installer asks “Do you have a PyXLL license key?” enter “n”.
This will install PyXLL without a license key, activating the 30 day free trial automatically.
Install the PyXLL package using pip
Open a command line prompt and install the pyxll package using pip in the usual way.
If you are using conda or a virtual environment then you should activate it before doing this step.
>> pip install pyxll
Install the PyXLL Excel add-in
After pip installing pyxll is complete run the following command to download and install the PyXLL Excel add-in:
>> pyxll install
Follow the on screen instructions to complete the installation.
When the installer asks “Have you already downloaded the PyXLL add-in?”, enter “n” and the installer will download everything you need automatically.
If you prefer, you can download the PyXLL add-in from the download page, but please be sure to select the correct Python and Excel options to get the right version of the PyXLL add-in.
To activate the free 30 day trial when the installer asks “Do you have a PyXLL license key?” enter “n”. This will install PyXLL without a license key, activating the 30 day free trial automatically.
Tip
If you have already downloaded PyXLL from the download page you can drag and drop the zip file from Windows Explorer onto the command prompt when asked for the path!
Start Excel and try the examples
If the PyXLL add-in has been successfully installed then now when you start Excel it will be loaded automatically.
In the folder you chose to install PyXLL into in step 2 you will find some examples, alongside the PyXLL add-in and its configuration file.
If you can’t remember where you installed PyXLL use the pyxll status
command to check (or
check the About
option in the PyXLL menu in Excel).
The files you should find in the PyXLL installation folder include:
The pyxll.cfg configuration file
This is the PyXLL configuration file and you will need to modify this to load your own Python modules.
The example configuration file installed includes documentation of the available settings. You can find more information about PyXLL’s configuration options in the Configuring PyXLL section of the user guide.
An example Excel workbook and some example code in the ‘examples’ folder
In here you will find lots of examples to help you understand how to use the PyXLL add-in. All of the examples are loaded in the default PyXLL configuration and so all you need to do is to open the examples workbook to try them out.
After you have been through the examples feel free to remove them from your pyxll.cfg configuration file.
The log files
The default configuration sets the log path to a logs
folder in the PyXLL installation folder. In
this logs folder you will find the PyXLL log file.
Any errors will be logged to this file, including the full Python stack trace for exceptions thrown when running Excel worksheet functions and macros. This should be the first place you look if you are having any problems.
Tip
You can enable debug logging for even more information about what’s going on by setting
vebosity = debug
in the [LOG]
section of your config file.
[LOG]
verbosity = debug
If you have any trouble using the installer please contact us to let us know. You can find additional instructions for how to use the command line tool here.
It is also possible to install the PyXLL add-in manually as described in the next section.
In the folder you’ve installed PyXLL into you will find an example workbook, examples.xlsx. This contains a number of examples to demonstrate some of the features of PyXLL. You can find the Python code for these examples in the examples folder in your PyXLL installation.
Try adding your own modules (.py files) and writing your own functions.
To add your own modules you will need to add them to the modules list that you can find in the pyxll.cfg file. Use pyxll configure to quickly open the config file.
You can include modules from other folders too, not just the examples folder. Add your own folders to the pythonpath setting in the pyxll.cfg file.
See Worksheet Functions for details of how you can expose your own Python functions to Excel as worksheet functions, or browse the User Guide for information about the other features of PyXLL.
Not able to use pip or the download fails because of a corporate firewall or proxy server
You can download and install PyXLL manually instead of using pip
and pyxll install
by following the manual installation instructions.
The ‘pyxll’ command isn’t recognised even after running ‘pip install pyxll’
This can be caused by your Python Scripts folder not being on your system path.
You can run the pyxll install
command using python -m pyxll install
instead,
which works in exactly the same way.
Getting a ‘pythonXXX.dll not found’ error when starting Excel
This is caused by the version of Python being used being different from the version of Python the PyXLL add-in was built for.
If you are using the command line installer, let that download the correct version for you by entering “n” when asked if you have already downloaded PyXLL.
If you prefer to download the PyXLL add-in manually, download it again but be careful to select the correct Python version on the download form.
Troubleshooting other issues
Any errors will be written to the PyXLL log file when starting Excel. Check the log file for errors and warnings to find out what is going wrong.
By default, the log file is located in the logs
folder where you installed PyXLL. If
you are not sure where that is you can use the pyxll status
command to find out, or
check the About
menu option in the PyXLL menu in Excel.
If you are stuck you may find the answer you need by searching our FAQ, or contact us for more help.