Skip to content
Advertisement

Numpy install requirement on package fails on pip install from PyPI but not from .whl

I recently build my first python package and tried to test distribution with test.pypi.org (Github repo Test PyPI)

Code for building the dist:

JavaScript

Code for uploading to Test PyPI:

JavaScript

Then I created and empty conda env to test the installation with:

JavaScript

In this enviroment I used succesfully pip install with wheel file:

JavaScript

But if I try to install it from Test PyPI numpy installation fails (it is in install_requirements en setup.cfg file). Code:

JavaScript

Setup.cfg code:

JavaScript

Setup.py

JavaScript

First lines of error (extremly long error msg): enter image description here

Advertisement

Answer

If you look at your error message, you can see

JavaScript

So it is also using a whl file. However, the way numpy is installed differs. In your error message, it is clear that numpy is trying to compile from source, which is not suprising, since you set the index to https://test.pypi.org/simple/ and there is only source distributions of numpy under that index. If you allow that the dependencies can be pulled from pypi, by setting test.pypi as an extra-index with --extra-index-url then everything works (tested in a fresh conda env created with the command you have provided):

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement