Ronikos
Ronikos

Reputation: 447

How to install wheels within setup.py

I'm creating a project that has dependencies on packages from PyPI. Namely :

['comtypes', 'docx', 'qrcode', 'PyPDF2', 'pyqtgraph', 'PyQt5', 'numpy', 'PIL','opencv-python']

However, some of these (for example opencv-python) only contain wheel files on PyPI. https://pypi.python.org/simple/opencv-python/

From my understanding, setuptools is not compatible with .whl. Is there any way to install the dependencies from a setup.py, ideally without the use of pip?

Upvotes: 9

Views: 7642

Answers (2)

RACKGNOME
RACKGNOME

Reputation: 1143

I had this exact same problem. The issue was that I was trying to use

python setup.py develop

to install the dependencies. When you use this command it attempts to use easy-install to install the dependencies, and if the dependencies are wheel files, it will fail.

We want to use pip, so try the following command in the directory in which your setup.py file is located

pip install .

Your setup.py structure doesn't even need to change! Hope this helps mate.

Inspiration/Ref: easy_install tensorflow-gpu fails

Same question (basically): Can I use pip instead of easy_install for python setup.py install dependency resolution?

Upvotes: 2

Vibhutha Kumarage
Vibhutha Kumarage

Reputation: 1399

Download the .whl file and run

pip install <directory>/xxxx.whl

on the terminal/cmd/powershell

Upvotes: 2

Related Questions