'my python package can be installed on my local conda env but can not be installed on other envs or systems
I have created my own python package and uploaded it in https://test.pypi.org/ which installed and worked fine in my conda virtual environment but when I want to install it on other systems or environments, it seems that it cant install the dependencies. i get this error:
ERROR: You must give at least one requirement to install (see "pip help install")
my setup.py file is:
from setuptools import setup, find_packages
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setup(
name = "mypackage",
version = "0.0.31",
author = "my name",
author_email= "[email protected]",
description = "a description",
long_description = long_description,
long_description_content_type = "text/markdown",
packages = ["mypackage"],
python_requires = ">=3.9",
install_requires = [
"pandas>=1.4.2",
"pyro-api>=0.1.2",
"pyro-ppl>=1.8.0",
"numpy>=1.21.5",
],
)
I'm on Ubuntu 22.04 and using following commands to install the package:
- python setup.py sdist
- twine upload --repository testpypi dist/mypackage-0.0.31.tar.gz
- pip install -i https://test.pypi.org/simple/mypackage
Solution 1:[1]
In the command
pip install -i https://test.pypi.org/simple/mypackage
you provide only the index but not the requirement(s). The correct syntax is
pip install -i https://test.pypi.org/simple/ mypackage
Also with
pip install -i https://test.pypi.org/simple/ mypackage
you allowed pip to install only from test.pypi.org and there is no pandas>=1.3.3
at https://test.pypi.org/project/pandas. You need to allow pip to use pypi.org. This way:
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple mypackage
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 |