Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pip install from pypi works, but from testpypi fails (cannot find requirements)

Tags:

python

pip

pypi

I'm trying to create my first python package. To not bungle the whole deal, I've been attempting to upload it to the testpypi servers. That seems to go fine (sdist creates and upload doesn't show any errors). However, when I try to install it to a new virtualenv from https://testpypi.python.org/pypi, it complains about my install requirements, e.g.:

pip install -i https://testpypi.python.org/pypi poirot Collecting poirot   Downloading https://testpypi.python.org/packages/source/p/poirot/poirot-0.0.15.tar.gz Collecting tqdm==3.4.0 (from poirot)   Could not find a version that satisfies the requirement tqdm==3.4.0 (from poirot) (from versions: ) No matching distribution found for tqdm==3.4.0 (from poirot)  

tqdm and Jinja2 are my only requirements. I tried specifying the versions, not specifying—error each way.

It appears that it's trying to find tqdm and Jinja2 on the testpypi server and not finding them (because they're only available at regular pypi). Uploading the package to the non-test server and running pip install worked.

What do I need to add to the setup.py file (below) to get it to find the requirements when uploaded to testpypi?

Thanks!

try:     from setuptools import setup except ImportError:     from distutils.core import setup  setup(name='poirot',       version='0.0.15',       description="Search a git repository's revision history for text patterns.",       url='https://github.com/dcgov/poirot',       license='https://raw.githubusercontent.com/DCgov/poirot/master/LICENSE.md',       packages=['poirot'],       install_requires=['tqdm==3.4.0', 'Jinja2==2.8'],       test_suite='nose.collector',       tests_require=['nose-progressive'],       classifiers=[         'Environment :: Console',         'Intended Audience :: Developers',         'Programming Language :: Python',         'Programming Language :: Python :: 2.7',         'Programming Language :: Python :: 3.3',         'Programming Language :: Python :: 3.4',         'Programming Language :: Python :: 3.5'       ],       include_package_data=True,       scripts=['bin/big-grey-cells', 'bin/little-grey-cells'],       zip_safe=False) 
like image 662
lfbet Avatar asked Dec 29 '15 16:12

lfbet


People also ask

Does pip install from PyPI?

Install moduleIt can install packages from the PyPi repository. It's the official repository for python modules. Software you install with pip is downloaded from the PyPi repo and installed.

Why can't I install using pip?

One of the most common problems with running Python tools like pip is the “not on PATH” error. This means that Python cannot find the tool you're trying to run in your current directory. In most cases, you'll need to navigate to the directory in which the tool is installed before you can run the command to launch it.

How do I install pip packages from requirements txt?

Use the pip install -r requirements. txt command to install all of the Python modules and packages listed in your requirements. txt file.


1 Answers

Update

PyPI has upgraded its site. According to the docs, the new advice is:

pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple poirot

  • --index-url points to your package on TestPyPI.
  • --extra-index-url points to dependencies on PyPI.
  • poirot is your package.

Out-dated

Try pip install --extra-index-url https://testpypi.python.org/pypi poirot.

See also a reference post.

like image 163
pylang Avatar answered Sep 19 '22 15:09

pylang