1

I have setup.py like this:

setup(
    name='pyomexmeta',
    version=version,
    license='MIT',
    long_description=open('README.md').read(),
    long_description_content_type="text/markdown",
    author='Ciaran Welsh',
    author_email='cwelsh2@uw.edu',
    url='https://github.com/sys-bio/libomexmeta',
    keywords=['annotation', 'rdf'],
    # install_requires=open('requirements.txt').read().split('\n'),
    install_requires=["pypiwin32"],
    packages=['pyomexmeta'],
    package_dir={'pyomexmeta': 'src/pyomexmeta'},
    package_data={'pyomexmeta': [
        'LICENCE.txt',
    ] + binaries},
    include_package_data=True,
    classifiers=[_f for _f in CLASSIFIERS.split('\n') if _f],
    platforms=["Windows", "Linux", "Unix"],  # "Mac OS-X", - not yet supported.
)

The important part for this question in install_requires=['pypiwin32']. When I try to install my package from testpypi inside a fresh conda environment I get an error:

PS D:\libOmexMeta> conda create -y --name omex python=3.7
PS D:\libOmexMeta> conda activate omex
PS D:\libOmexMeta> pip install --index-url https://test.pypi.org/simple/ pyomexmeta

The error I get is this:

ERROR: Could not find a version that satisfies the requirement pypiwin32 (from pyomexmeta) (from versions: none)
ERROR: No matching distribution found for pypiwin32 (from pyomexmeta)

yet, when I do

 PS D:\libOmexMeta> pip install pypiwin32

it installs without fail.

Anybody know what's going on here?

Note, same thing happenes with pywin32.

CristiFati
  • 38,250
  • 9
  • 50
  • 87
CiaranWelsh
  • 7,014
  • 10
  • 53
  • 106
  • What version of pip are you on? If you upgrade with `pip install --upgrade pip`, do you get a more helpful message? If you pass `-v` to the failing command, do you get any useful debugging info? – Joseph Sible-Reinstate Monica Jul 03 '20 at 17:48

1 Answers1

1

Before everything, check [SO]: ImportError: No module named win32com.client (@CristiFati's answer) regarding PyPIWin32.

Listing [PyPA.PIP]: pip install.

By passing --index-url https://test.pypi.org/simple, you changed PIP's (default) repository, to the one given as argument. But that seems to be broken for PyPIWin32 ([PyPI.Test]: Links for pypiwin32).
PyWin32 isn't even listed there.

On the other hand, in pip install pypiwin32's case, it used the default repository where it found the package and things went fine.

Test:

[cfati@CFATI-5510-0:e:\Work\Dev\StackOverflow\q062697213]> sopr.bat
### Set shorter prompt to better fit when pasted in StackOverflow (or other) pages ###

[prompt]>
[prompt]> :: Search default repo
[prompt]> "e:\Work\Dev\VEnvs\py_pc064_03.07.06_test0\Scripts\python.exe" -m pip -v search pypiwin32
Getting credentials from keyring for pypi.org
Starting new HTTPS connection (1): pypi.org:443
https://pypi.org:443 "POST /pypi HTTP/1.1" 200 200
pypiwin32 (223)  -

[prompt]>
[prompt]> :: Search custom repo
[prompt]> "e:\Work\Dev\VEnvs\py_pc064_03.07.06_test0\Scripts\python.exe" -m pip -v search -i https://test.pypi.org/simple pypiwin32
Getting credentials from keyring for test.pypi.org
Starting new HTTPS connection (1): test.pypi.org:443
https://test.pypi.org:443 "POST /simple HTTP/1.1" 301 205
Looking up "https://test.pypi.org/simple/" in the cache
Current age based on date: 134
Freshness lifetime from max-age: 600
The response is "fresh", returning cached response
600 > 134
ERROR: Exception:
Traceback (most recent call last):
  File "e:\Work\Dev\VEnvs\py_pc064_03.07.06_test0\lib\site-packages\pip\_internal\cli\base_command.py", line 186, in _main
    status = self.run(options, args)
  File "e:\Work\Dev\VEnvs\py_pc064_03.07.06_test0\lib\site-packages\pip\_internal\commands\search.py", line 52, in run
    pypi_hits = self.search(query, options)
  File "e:\Work\Dev\VEnvs\py_pc064_03.07.06_test0\lib\site-packages\pip\_internal\commands\search.py", line 71, in search
    hits = pypi.search({'name': query, 'summary': query}, 'or')
  File "c:\Install\pc064\Python\Python\03.07.06\Lib\xmlrpc\client.py", line 1112, in __call__
    return self.__send(self.__name, args)
  File "c:\Install\pc064\Python\Python\03.07.06\Lib\xmlrpc\client.py", line 1452, in __request
    verbose=self.__verbose
  File "e:\Work\Dev\VEnvs\py_pc064_03.07.06_test0\lib\site-packages\pip\_internal\network\xmlrpc.py", line 38, in request
    return self.parse_response(response.raw)
  File "c:\Install\pc064\Python\Python\03.07.06\Lib\xmlrpc\client.py", line 1342, in parse_response
    return u.close()
  File "c:\Install\pc064\Python\Python\03.07.06\Lib\xmlrpc\client.py", line 654, in close
    raise ResponseError()
xmlrpc.client.ResponseError: ResponseError()

To get past your problem, either:

  • Since you already installed the dependencies, don't try to install them by passing --no-deps: pip install --no-deps --index-url https://test.pypi.org/simple pyomexmeta

  • Specify additional repositories (the default one), by passing --extra-index-url (! didn't test it !)

Check the notes from [GitHub]: sys-bio/libOmexMeta - sys-bio.github.io/libsemsim-docs.

You might also want to take a look at [Anaconda]: Using Pip in a Conda Environment.

CristiFati
  • 38,250
  • 9
  • 50
  • 87
  • Well I never would have figured that one out ha thanks for the answer. Note, that libsemsim/omexmeta is the library I'm writing/testing and I'm only half way through writing the docs - so probably not much good info there :P The important thing is that this will be fixed and will work fine when I publish to pypi (not pypi test) - so I can basically do nothing for now. – CiaranWelsh Jul 06 '20 at 22:00
  • Lol, I didn't look at the repo owner :). That's correct! – CristiFati Jul 07 '20 at 08:19