Showing posts with label Wheels. Show all posts
Showing posts with label Wheels. Show all posts

Wednesday, 8 February 2017

Pandas wheel building

Pandas is a great library for data analysis but working with it on windows with a set version of numpy can be problematic. We deploy packages internally as wheels, and our code relies on a later version of numpy.

So what's the solution, build a wheel with the version of numpy that we use, this can be done if you have the python compiler for windows.

We use Python 2.7 for which you can find the installer here

virtualenv pandas
cd pandas\scripts
activate
cd ../..
pip install numpy==1.9.3+mkl --no-index --find-links=z:\PythonWheels
cd Source
python setup.py build_ext --inplace --force
python setup.py bdist_wheel

Voila, one wheel built with numpy==1.9.3+mkl, this can then be installed by pip on various environments.

Friday, 2 October 2015

Creating PyVisa Wheel install on Windows

So I have some legacy software that requires PyVisa 1.3 and I'm building wheels for all the packages that require this as this is the new standard for python packaging.

I was having issues creating the wheel file or even installing from the tar file from PyPi until I came across this bug report and it worked a treat.

To sum up all the actions that I needed to do.

1. Get the Tar file.
2. Extract the source.
3. make the following changes

setup.cfg:
-prefix = /usr 
In 'setup.py' home_dir can be derived in a platform independent fashion:
setup.py:
- home_dir = os.environ['HOME']
+ home_dir = os.path.expanduser('~')

4. Navigate to the root of the source and make the wheel file

python setup.py bdist_wheel

Viola you have a windows wheel file that can be installed fast and effective to all virtual environments.

The newer versions are much easier to package into wheel files. I will be sure to post up about other packages that I have any issues with and the solutions to them as well.