Cannot install from a local wheel
See original GitHub issueI have a project where I want to install a package (cassiopeia
) that depends on pycurl
. I’m on Windows, and pycurl
currently does not provide a binary wheel for Python 3.6, nor does it build without a prebuilt libcurl being available. I can however get a wheel from Christoph Gohlke’s website.
I’d like to hold the pycurl wheel in my project directory, under wheels/pycurl*.whl
. I could then supply --find-links
to pip and install pycurl from there.
Specifying an environment variable PIP_FIND_LINKS
sort of works, but I can’t find any way to record the fact that I want to include the wheels
directory in the search path permanently, so that I don’t have to (remember to) set an environment variable every time I rebuild the environmnent.
I found https://github.com/pypa/pipfile which gives examples of more complex ways of specifying things in a pipfile, but I can’t make this work.
Describe you environment
- Windows
- Python version:
python 3.6.2
- Pipenv version:
pipenv, version 8.2.6
Expected result
To be able to configure “find-links = ./wheels” somewhere, probably in the Pipenv file, and have it pick up wheels from that location. (I’d expect to be able to use a relative path, to mean “relative to the project directory”, or an absolute path for wheels I store globally).
Actual result
I need to manually set PIP_FIND_LINKS
before installing via pipenv, and then unset it afterwards, so that it doesn’t affect other invocations of pip.
Steps to replicate
pipenv install
. Pipfile is
[[source]]
url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"
[packages]
cassiopeia = "*"
pycurl = {file = "./wheels/pycurl-7.43.0-cp36-cp36m-win_amd64.whl"}
[dev-packages]
Output is:
>pipenv install
Creating a virtualenv for this project…
Using real prefix 'C:\\Users\\pfmoore\\AppData\\Local\\Programs\\Python\\Python36'
New python executable in C:\Users\pfmoore\.virtualenvs\riot_data-4b7hkvZN\Scripts\python.exe
Installing setuptools, pip, wheel...done.
Virtualenv location: C:\Users\pfmoore\.virtualenvs\riot_data-4b7hkvZN
Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
Updated Pipfile.lock (17f190)!
Installing dependencies from Pipfile.lock (17f190)…
An error occurred while installing pycurl==7.43.0! Will try again.
================================ 8/8 - 00:00:17
Installing initially–failed dependencies…
Collecting pycurl==7.43.0 ----------- 0/1 - 00:00:00
THESE PACKAGES DO NOT MATCH THE HASHES FROM Pipfile.lock!. If you have updated the package versions, please update the hashes. Othe
rwise, examine the package contents carefully; someone may have tampered with them.
pycurl==7.43.0 from file:///C:/Work/Projects/riot_data/wheels/pycurl-7.43.0-cp36-cp36m-win_amd64.whl (from -r C:\Users\pfmoore\AppData\Local\Temp\pipenv-y27xl4s1-requirement.txt (line 1)):
Expected sha256 de2980f2839029ffa2917fcc1eb84b2dc736f0a30a5413645e514a2b61df04ed
Expected or d6cb0917ce564c9edc377ae436bc0963ee72be8873c90bcce7470f1670c3baef
Expected or 1ba222eafcb740805d5c9fe778a47d2704bf764abe9a2546de90f159e4c3a116
Expected or f614c93422f31761764a002297b56a0c7f0aeaee7badb0fb43764bda13467697
Expected or b0af8badfda56b175e190cf0fb1a18d2bd600a677d3b5d9f7a579823eec74fa4
Expected or 9db493308f092b87d8113cea322886f07c2f1b64f9839dffd4a65c300f91244b
Expected or 26dcfb05ecbaa27ffaa71a4a3add217ec9e1cee2998b727e1b9e6eff7264d5f8
Expected or 413b82b25795dcd0656e2d254892a16f531d88eccabc3a97c9c9451781caf5e8
Expected or 89758f2375fe44b139fcc11e305a060c75a4a89178b5066a3894055fe069a80e
Expected or 991d221a59c5546370e618241ec05e7d85efd7c5126fb33387de0a12c2cfe8e4
Expected or 39a7399e7da031f4648bd6ea273b02c0cf203471b63fe3629d19ebfd13e5701f
Expected or 9997e9994860cc99f2622de4133e0dd1756797852645dc6942b58142014f2e59
Expected or aa975c19b79b6aa6c0518c0cc2ae33528900478f0b500531dbcdbf05beec584c
Expected or 7d1ffc138132a7dcb322d41b1f7d5ed7e2f9bb0dea3103ae5ca25fae2a1f689b
Expected or 074a565bc33cfc484fa87339136876f1d8176bd30bb214235e11382b363beef9
Expected or d6ac0f902cb82cab13bc9488fb5240cf86325bd24800dc5ab677f8044993f6fc
Expected or 61d4b1a2dc1ecdb3b6d4188d63ab884e8768cfc85f37f48c481935b784920137
Expected or 1339972f6faf9e7feb54e0d62b018dcea6c99fb5ca46fef4a8d20c2a810d1f2d
Expected or 30983ec2f88ee0d26d290f276563c26bc1d302f1f6fc447092368bce7a93f0ea
Expected or 9075d35c8bafb96a836a7558b37fe697ec04646f76239254b06e87eb360097c7
Expected or 36c3a2d6b4ca31f39ac84fe9b7616d338191f956710c7912c546ffef18600f2f
Expected or 024fba378134633694b7a64ec7cb8ef9a98e3ce6b5635247b51b7282b96f33de
Expected or 826866c43ef532b7633e24332b7f4bc6b309e72b33631c2b06258fdb284dd55b
Expected or 59f637ffe21a90b6155df34b9fdf3030b6453859110db8700bf17f569c6449d6
Expected or 614687bdc73246ce85f73b7199d533a222efdda954e84a6bd692fef25fa3b6ac
Got 7b9443007238914a6cc7fb6c3442aa00f06868b141837097f249adf54add11b6
================================ 0/1 - 00:00:01
>pipenv run pip list
Package Version
------------- -------
cassiopeia 3.0.13
datapipelines 1.0.2
decorator 4.1.2
merakicommons 1.0.2
networkx 2.0
olefile 0.44
Pillow 4.3.0
pip 9.0.1
setuptools 36.6.0
wheel 0.30.0
Note that pycurl is missing from the output of pip list
.
Issue Analytics
- State:
- Created 6 years ago
- Comments:39 (36 by maintainers)
Hmm, I’m not sure it’s that niche. Needing to use prebuilt wheels is fairly common on Windows, and Christoph Gohlke maintains an extensive and well-known archive of such wheels, particularly for the scientific stack (although it is true that more and more projects now host wheels on PyPI). So while I’m OK with the idea that it’s an enhancement, I think it’s a fairly important use case.
Also, even if it’s not supported directly by pipenv yet, documentation on ways of working round the limitation would be useful (I assume that hosting the wheel in a local index like devpi would work, for example).
@erinxocon No problem. I completely understand.
My main question isn’t so much whether things work well/badly, or even if there’s a bug. My real question is whether this scenario is currently supported or not. If it’s not supported, that’s fine - I can raise a new feature request explaining my requirement and asking if it could be supported. If it is supported, then the docs don’t explain it very well. If someone can clarify how to set things up, I’m happy to try to write a doc PR to improve things. (There may also be bugs in the implementation, if it’s not a well-used feature - I’m happy to be a guinea pig in that case, and report any problems I hit).
My impression is that actually, this simply isn’t something anyone has thought through, so it might work, but more as a side-effect of how other features work than as a fully fleshed out use case. If that’s true, I’d be inclined to just treat it as a feature request, rather than struggle to try to make the existing features handle an unexpected corner case.