-
-
Notifications
You must be signed in to change notification settings - Fork 592
Unable to pip install jsonschema because of setup_requires vcversioner #276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi. Thanks for opening this. Can you provide a bit more detail on your setup and what specifically you're running into -- I'm not sure I can tell from your description. It sounds like possibly you're saying that you generated an offline sdist and then couldn't install it -- vcversioner is a setup-time dep. It's needed to generate version information and it should be running every time the setup.py runs. If you want to avoid it presumably you want to generate e.g. a wheel instead. |
Quoting https://pip.pypa.io/en/latest/user_guide/ :
I really don't think I need a wheel package here, it is just an issue with Here is what happens for me when I try to install
I found a workaround, but it is hacky :
|
ISTM then that this isn't a setuptools issue, this is working as expected. If you do want a completely offline install that didn't invoke a Gonna close this for now, but if you want to discuss further feel free to reopen / follow up. Appreciate the report though certainly. |
Thanks for your answer |
I understand this has been closed and you're probably busy with other things, but unfortunately the same issue is preventing me from using jsonschema (and by extension, all of the libraries that depend on it). I'm experiencing the same problem as Lucas-C, except I can't use a wheel for offline install because pip's --no-binary flag is required by my deployment environment. I also can't seem to edit the easy_install settings due to a permissions issue. I'm behind a corporate firewall and we maintain an internal python package registry, but the setup.py script keeps looking for the external PyPi registry and failing in my build/deploy environment (because it's cut off from the regular internet). Is there any way to give that script an argument to look elsewhere besides PyPi? Or any other suggestions for how to get around this? Again, I know you're busy so don't feel obligated to fix this yourself. If you can point me in the right direction for some other options I'd be happy to look into it myself and even make a pull request if I come up with something. Let me know, thanks! |
Hm, that doesn't sound likely to be related -- if you can't use wheels, you still can use sdists, which should ship with a version.txt -- have you tried that? If it's contacting PyPI it wouldn't be for version issues, it'd sound like you're missing a dep. |
Thanks for the response. When jsonschema's setup.py script runs after collecting jsonschema, it looks to PyPi to download jsonschema's vcversioner dependency at setup time, but again PyPi is blocked. Even separately installing vcversioner before installing jsonschema doesn't work for some reason. It always tries to reach out to PyPi even if the vcversioner dependency is present on the machine. Here's my install command (leaving out the url of my company's repo):
And here's the log output where the install fails (again leaving out my company's url, but you can see that it finds jsonschema fine but then can't find its vcversioner dependency):
This happens even though I told pip to use the internal corporate repo instead of PyPi. As mentioned before, setup.py doesn't use pip so it doesn't know to look at the internal repo for the vcversioner dependency. Let me know if you have other questions or if I'm being unclear in any way. Thanks again! |
You should be able to use a pydistutils.cfg (which you can put in ~ amongst some other places) I believe to get easy_install to also be looking at your internal corporate PyPI. |
TL;DR - that might not work because of how my application gets deployed. Explanation follows: We use Pivotal Cloud Foundry to deploy our applications. The python buildpack for PCF states that, for offline deployment environments, all dependencies must be downloaded and "vendored" beforehand, then sent to the deployment environment - where they are installed from the downloaded archives. The docs can be viewed here (they're not too long). I was able to do what you said and get easy_install to use the corporate pypi for the first stage - the initial downloading and archiving of the dependencies. However, for the next step where it gets sent to the remote deployment environment that has no internet connection, it has the same problem as before. It collects jsonschema, runs the same setup.py script, and tries to look for vcversioner in regular pypi. Since vcversioner isn't an install-time dependency it doesn't get downloaded and archived in the same way as all the other dependencies; setup.py only looks for it at setup time. But the remote deployment environment doesn't have the same config file as the previous step, so it fails again. In addition, I don't think I'm able to add that config file to the deployment environment. Manual access is discouraged and these servers get destroyed/rebuilt all the time so doing it manually would suck. And I'm not sure if Cloud Foundry lets you run arbitrary bash scripts on the deployment servers before the buildpack gets used, but that's something I can look into further. Again, I appreciate the help. I know this is a scenario that most people might not run into but it's been frustrating. I'm going to continue looking into it tomorrow so I will update if I find out I was wrong and I am able to get that config file out there. |
To follow up, I opened the above ticket with Pivotal themselves to see if there's a way I can configure my deployment environment with the fix you mentioned. It will depend on what they say; if it's not possible then I might just not be able to use this library unfortunately. Hopefully there's another workaround though. |
This is hurting downstream packages as well. Same error when trying to install altair which depends on jsonschema. |
@iandanforth is it also in some sort of weirdly constrained environment? I still don't see a jsonschema bug here but happy to keep discussing until we get to a conclusion |
Odd maybe, but I wouldn't say constrained OSX - 10.13.2 - High Sierra I install dependencies for new projects using pipenv so
Installing vcversioner separately works and then installing jsonschema works as expected. |
@iandanforth setuptools 0.6c11 is absurdly old :) (about 10 years so). Your issue is that it's so old it doesn't understand what needs to happen for the install I'd suspect. Upgrade to a reasonably modern one and I think you'll be fine. Credit to @dimino for noticing. |
Confirmed! Thanks osx system python! |
It's likely the next version of I'm still not convinced there's any For the build/install environment case, I'd encourage you guys to file bugs upstream if you're concerned about the interaction between |
6b673312 Merge pull request #276 from malcolmsparks/patch-1 4b55dc38 Renamed JUXT's Clojure implementation to jinx b173eaa2 Merge pull request #275 from Zac-HD/tweaks 3768953e Valid test for contains: false 798351be Valid test for contains: false git-subtree-dir: json git-subtree-split: 6b6733126e5cd571fc6b7a1a5a8190a09d6cb7b9
I basically have the same issue as #257.
The problem is well detailed here :
Basically,
setup_requires
is very cumbersome option when you want to avoid a simplepip install
to talk to Pypi.Even the fix detailed on pypa/pip#410 does not work for me as I don't use a local directory for my dependencies but an online repository of artifacts.
Do you think
setup_requires
could be removed ?The text was updated successfully, but these errors were encountered: