I created a python package with a dependency that fails to install using pip due to some missing wheels and non pure-pythonic code (needs a Microsoft Visuals Compiler). Other dependencies are installed normally using pip.
the problematic dependency (geopandas->pyproj) is only used in part of my package so I was wondering if I could allow the user to install my package using pip with all functionality except the functions that require the dependency. If the user wants to use the functions in the package that requires the dependency one could simply install it in addition to my package allowing for more flexibility (make use of pip, conda, compile etc.):
pip install mypackage
conda install dependency
and then
import mypackage
import dependency
bar = mypackage.function_that_requires_dependency(foo)
If the user cannot install the dependency, it can still use all parts of my package that do not rely on it.
pip install mypackage
and then
import mypackage
bar = mypackage.function_that_does_not_require_dependency(foo)
Is there a way to accomplish this? I currently have all my imports at the beginning of my init.py file.