My question is similar to this question, yet different.
I am the maintainer of the Python package omrdatasettools where I provide users with small helper scripts to perform dataset downloads, etc. My scripts have dependencies on their own, e.g., lxml or tqdm. I want people to be able to install my library and use it, however when you create a new conda environment and call pip install omrdatasettools the installation fails because it does not find the necessary packages.
What I've done so far: I've added all necessary libraries into the install_requires-section of my setup.py
setup(
...
install_requires=['Pillow', 'muscima', "mung", "numpy", "tqdm", "scikit-image", "lxml"]
...
)
and I am building and distributing the package with the commands:
python setup.py sdist
twine upload --repository pypi dist/*
Uploading works as expected and now users should be able to run
conda create --name tempTest python==3.7
activate tempTest
pip install omrdatasettools
and use my library. However, when you run these lines, you get the following error:
Collecting omrdatasettools
Downloading omrdatasettools-1.2.tar.gz (39 kB)
ERROR: Command errored out with exit status 1:
command: /Users/alex/opt/anaconda3/envs/tempTest/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/bs/1t82d5697dn_nd32ngbq_9bh0000gn/T/pip-install-s56i2r4e/omrdatasettools/setup.py'"'"'; __file__='"'"'/private/var/folders/bs/1t82d5697dn_nd32ngbq_9bh0000gn/T/pip-install-s56i2r4e/omrdatasettools/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/bs/1t82d5697dn_nd32ngbq_9bh0000gn/T/pip-install-s56i2r4e/omrdatasettools/pip-egg-info
cwd: /private/var/folders/bs/1t82d5697dn_nd32ngbq_9bh0000gn/T/pip-install-s56i2r4e/omrdatasettools/
Complete output (9 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/bs/1t82d5697dn_nd32ngbq_9bh0000gn/T/pip-install-s56i2r4e/omrdatasettools/setup.py", line 8, in <module>
import omrdatasettools
File "/private/var/folders/bs/1t82d5697dn_nd32ngbq_9bh0000gn/T/pip-install-s56i2r4e/omrdatasettools/omrdatasettools/__init__.py", line 3, in <module>
from .Downloader import *
File "/private/var/folders/bs/1t82d5697dn_nd32ngbq_9bh0000gn/T/pip-install-s56i2r4e/omrdatasettools/omrdatasettools/Downloader.py", line 9, in <module>
from lxml import etree
ModuleNotFoundError: No module named 'lxml'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
I read something about pip not finding the right repository to download those dependencies, but I am not sure what I am missing here. If you install all necessary dependencies first and then my package, everything works.
Any help would be highly appreciated!