-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Are all "extras" installed by default? #1599
Comments
If extras are not installed by default, can you please add some feature for this usecase? |
I don't think you want
If you really want this, you probably need to do some architecture detection in try:
import cv2
except ImportError:
warnings.warn("OpenCV not installed: webcam support disabled") ...or whatever you do to detect it. |
We already do this. But people complain that they cannot install out app using pip on raspberry pi, because opencv-python can't be installed by pip install on ARM.
I am not aware of any reliable way to detect architecture ARM vs PC. Also this might need some requirements that are not installed. Maybe we can try to run pip install opencv-python in setup.py, but i would call that ugly hack. Also it's not easy to call pip from python script. If you call it as os command it might be in PATH as pip or pip2 and you will never know which one is the right one (because pip sometimes refer to pip3). And calling pip as method internally is not officialy supported and is prevented. |
As far as I know there is no real way to do this, and it's a shame. You could possibly do some funkiness with It's also not something we can fix in For the moment, I think you have the following options:
As for the correct solution, I suggest we take that up on the packaging problems repository, because this is not a problem that can be solved in |
What is the default behaviour? Will extras install when not explicitly requested during pip install?
I am working on setup.py for package, which has optional dependency on OpenCV for webcam support, but it can work even without webcam.
Problem is that on ARM systems, there is no OpenCV package available in PyPI. So i would like my package to install without it. I've understood, that i can add it to
extras_require={}
, but i am not sure how this will work.When people do
pip install mypackage
i want webcam support to install if available, but to be silently ignored if not available. But i am afraid that it will install only if people will dopip install mypackage[webcam]
.What is the default behaviour? Will extras install when not explicitly requested during pip install?
The text was updated successfully, but these errors were encountered: