I created a Python package, uploaded it to TestPyPI, and try to install it to a new virtual environment. pip cannot install the required packages, but if I try to install the same packages with pip install -r requirements.txt
, it works.
I created my setup.py
file following the guidelines listed in Packaging Python Projects. I uploaded my package to TestPyPI and try to install it to a brand new virtual environment with Python 3.6.4
and pip 19.1.1
.
Here is my install instruction: pip install -i https://test.pypi.org/simple/ my-package-name==0.0.1
Here is what I have in setuptools.setup
call (only related stuff):
packages=setuptools.find_packages(),
classifiers=[
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
],
install_requires=[
"requests",
"jsonpickle",
"pandas",
"matplotlib",
"seaborn",
"Pillow"
]
It starts by successfull installing matplotlib, but I get the following error later:
ERROR: Could not find a version that satisfies the requirement jsonpickle (from my-package-name==0.0.1) (from versions: none)
ERROR: No matching distribution found for jsonpickle (from my-package-name==0.0.1)
I also tried with specifying package versions, but then I cannot install any packages.
As I have told, I can install the packages just fine by using pip install -r requirements.txt
command.
This is an unfortunate (and known) downside to TestPyPI: The issue is that jsonpickle
does not exist on TestPyPI, and by installing your package from there, you are telling pip
to look for dependencies there as well.
Instead, you should publish to PyPI instead, and use a pre-release version so as not to pollute your versions. You can delete these pre-releases from the project later.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With