This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
There are several reasons why you may want to include wheel files with your YXI tool installer, rather than rely on pip to install the tool's dependencies from the internet:
1. To avoid having to install a C compiler for certain packages
Some pip-installed Python packages pulled from the internet require a C compiler to be present on the system - especially on certain versions of Windows. Wheel files can negate this requirement. The wordcloud package is an example (or at least was; the documentation has changed and the issue may have been resolved). A user on Windows 7 was getting the following error when trying to install an early version of the Word Cloud tool that didn't leverage wheel files:
An error occurred during the installation of the Python tool.
Command ""c:\programdata\alteryx\tools\word cloud\scripts\python.exe" -u -c "import setuptools,tokenize;__file__='C:\\Users\\XXX\\AppData\\Local\\Temp\\pip-install-_3mv1gkm\\wordcloud\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code,__file__, 'exec'))" install --record C:\Users\XXX\AppData\Local\Temp\pip-record-ytx42h3y\install-record.txt --single-version-externally-managed --compile --install-headers
That error is incomplete and doesn't pinpoint the problem, but in this case it is due to the lack of a C compiler installed on the system. Changing the requirements.txt file contents from:
A corporate firewall may interfere with pip grabbing Python packages from the internet. A user trying to install the Word Cloud tool experienced this when they encountered the following error when trying to install the tool:
An error occurred during installation of the Python tool.
Could not find a version that satisfies the requirement cycler==0.10.0 (from -r requirements.txt (line 1)) (from versions: )
and including wheel files for all dependent packages resolved the issue. This updated Word Cloud tool is attached for reference.
3. To speed up install time
Python packages can be relatively large (all the wheel files required for the Word Cloud tool above add up to 23.5 MB). If you're worried that the downloading of these packages through pip upon the install of your tool will be time consuming (particularly if your internet download speeds may be questionable), then leveraging wheel files may be a good option.
Create or locate the required wheel files. Pythonwheels.com is a popular source, but unofficial repos are widely available, such as the aforementioned repo for the particular wordcloud wheel we needed above. Make sure they are compatible with Python 3.6.0 (the version included with Alteryx 2018.2) and 64-bit Windows.
Follow directions for creating the YXI, with the following additions just prior to creating the zip archive:
Create a subfolder called wheels and place the wheel files within this folder.
Alter the requirements.txt file to refer to the wheel file. For example change wordcloud==1.4.1 to ./wheels/wordcloud-1.4.1-cp36-cp36m-win_amd64.whl.