pypi / legacy

This PyPI is no more! See https://github.com/pypa/warehouse.
Other
61 stars 46 forks source link

Couldn't find index page for 'pytest-runner' (maybe misspelled?) #693

Closed splashcd closed 7 years ago

splashcd commented 7 years ago

Not sure what the root of this issue is here, but hopefully the error output provided with enable you to assist me with resolving the issue I receive when trying to make my project.


  Downloading log4mongo-1.6.1.tar.gz
    Complete output from command python setup.py egg_info:
    Download error on https://pypi.python.org/simple/pytest-runner/: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661) -- Some packages may not be found!
    Couldn't find index page for 'pytest-runner' (maybe misspelled?)
    Download error on https://pypi.python.org/simple/: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661) -- Some packages may not be found!
    No local packages or working download links found for pytest-runner
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-p3bfpr/log4mongo/setup.py", line 46, in <module>
        'Topic :: System :: Monitoring'
      File "/usr/lib/python2.7/distutils/core.py", line 111, in setup
        _setup_distribution = dist = klass(attrs)
      File "/usr/lib/python2.7/site-packages/setuptools/dist.py", line 315, in __init__
        self.fetch_build_eggs(attrs['setup_requires'])
      File "/usr/lib/python2.7/site-packages/setuptools/dist.py", line 361, in fetch_build_eggs
        replace_conflicting=True,
      File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 850, in resolve
        dist = best[req.key] = env.best_match(req, ws, installer)
      File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1122, in best_match
        return self.obtain(req, installer)
      File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1134, in obtain
        return installer(requirement)
      File "/usr/lib/python2.7/site-packages/setuptools/dist.py", line 429, in fetch_build_egg
        return cmd.easy_install(req)
      File "/usr/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 659, in easy_install
        raise DistutilsError(msg)
    distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('pytest-runner')

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-p3bfpr/log4mongo/
You are using pip version 9.0.0, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
The command '/bin/sh -c pip install --compile -r requirements.txt' returned a non-zero code: 1
make: *** [dev] Error 1```
jamadden commented 7 years ago

The proximate cause of the failure is the SSL validation errors, but I don't believe this is a problem with PyPI itself. For example, I am able to use the excellent httpie program to fetch those URLs without any SSL issues:

$ http https://pypi.python.org/simple/pytest-runner
HTTP/1.1 301 Moved Permanently
Accept-Ranges: bytes
Age: 30528
Cache-Control: max-age=600, public
Connection: keep-alive
Content-Length: 0
Date: Fri, 25 Aug 2017 20:44:03 GMT
Fastly-Debug-Digest: 01a7a78e1dbf1a0fd983c96796fdd87188bf23c3304cb8cc18cb43bfa5df9854
Location: /simple/pytest-runner/
Server: nginx/1.10.3
Strict-Transport-Security: max-age=31536000; includeSubDomains
Via: 1.1 varnish
Via: 1.1 varnish
X-Cache: HIT, HIT
X-Cache-Hits: 1, 1
X-Clacks-Overhead: GNU Terry Pratchett
X-Content-Type-Options: nosniff
X-Frame-Options: deny
X-Permitted-Cross-Domain-Policies: none
X-Served-By: cache-iad2137-IAD, cache-dfw1820-DFW
X-Timer: S1503693843.054143,VS0,VE0
X-XSS-Protection: 1; mode=block

This would probably be one of two things:

  1. Some sort of transient error with the CDN that you happen to be hitting. Do you get the same error from httpie installed in this environment? What about from a web browser? If yes to both, try waiting awhile and trying again.
  2. An issue with the SSL certificate chain in your environment. I don't know what operating system, distribution, or environment you're using, so I can't offer much advice on how to resolve that. Sometimes installing certifi from PyPI (I know, chicken-and-egg, you'll have to download it manually) resolves the problem; you could test that in an isolated virtual environment.
splashcd commented 7 years ago

I appreciate the feedback @jamadden I'm not including pytest-runner in my code, it is a dependency in log4mongo, so I'll need to research. I'm running make via terminal on OSx 10.12.6

jamadden commented 7 years ago

I'm running make via terminal on OSx 10.12.6

I happen to be on that platform too. The system certificate chain for /usr/bin/python2.7 works for me (as do the ones installed by MacPorts under /opt/local). That is, they can all 'pip install log4mongo' without issue.

splashcd commented 7 years ago

The interesting thing is that I can also run pip install log4mongo without issue. It's only in the collect/download portion of the make where the issue pops up

jamadden commented 7 years ago

If you can point us to the project you’re trying to build someone might be able to take a look at it.

splashcd commented 7 years ago

https://github.com/splashcd/log4mongofail Cloning and running make dev should replicate the failure I'm seeing...

jamadden commented 7 years ago

Oh, you didn't mention it involves docker. Doesn't the Dockerfile run in the virtual machine? So the issue would be with that environment.

I did reproduce the problem with the supplied Dockerfile. As I suggested, installing certifi first with RUN pip install certifi fixed the issue:

Step 6 : RUN pip install certifi
 ---> Running in 5e5e77191024
Collecting certifi
  Downloading certifi-2017.7.27.1-py2.py3-none-any.whl (349kB)
Installing collected packages: certifi
Successfully installed certifi-2017.7.27.1
You are using pip version 9.0.0, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
 ---> 0154974335e2
Removing intermediate container 5e5e77191024
Step 7 : RUN pip install --compile -r requirements.txt
 ---> Running in 53aa4f364d29
Collecting pyyaml (from -r requirements.txt (line 1))
  Downloading PyYAML-3.12.tar.gz (253kB)
Collecting log4mongo (from -r requirements.txt (line 2))
  Downloading log4mongo-1.6.1.tar.gz
Collecting pymongo (from log4mongo->-r requirements.txt (line 2))
  Downloading pymongo-3.5.1.tar.gz (1.3MB)
Installing collected packages: pyyaml, pymongo, log4mongo
  Running setup.py install for pyyaml: started
    Running setup.py install for pyyaml: finished with status 'done'
  Running setup.py install for pymongo: started
    Running setup.py install for pymongo: finished with status 'done'
  Running setup.py install for log4mongo: started
    Running setup.py install for log4mongo: finished with status 'done'
Successfully installed log4mongo-1.6.1 pymongo-3.5.1 pyyaml-3.12
...

(Although I later get an unrelated error:

...
Successfully installed log4mongo-1.6.1 pymongo-3.5.1 pyyaml-3.12
You are using pip version 9.0.0, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
 ---> 3c20f4f0e9ab
Removing intermediate container 53aa4f364d29
Step 8 : RUN pip install --compile .
 ---> Running in c9651c349be1
Processing /tmp
    Complete output from command python setup.py egg_info:
    running egg_info
    creating pip-egg-info/test.egg-info
    writing requirements to pip-egg-info/test.egg-info/requires.txt
    writing pip-egg-info/test.egg-info/PKG-INFO
    writing top-level names to pip-egg-info/test.egg-info/top_level.txt
    writing dependency_links to pip-egg-info/test.egg-info/dependency_links.txt
    writing manifest file 'pip-egg-info/test.egg-info/SOURCES.txt'
    warning: manifest_maker: standard file '-c' not found

    error: package directory 'log4mongofail' does not exist

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-cl5NAw-build/

)

Now, whether installing certifi is the blessed way to set up the cert chain on Alpine Linux, I have no idea. But it does work.

jamadden commented 7 years ago

Oh, and the reason pip install certifi worked, but installing pytest-runner didn't is because pytest-runner is listed in the setup_requires (not install_requires) data for log4mongo, and that's processed by setuptools, not pip, and they obviously handle SSL differently. So another way to fix this specific issue would be to install pytest-runner first before attempting to install log4mongo.

splashcd commented 7 years ago

Thank you @jamadden and I apologize for not previously mentioning docker.
Your solution gets me back on track. Not sure why the build decided to break this week, as I've been building it over the past 6 months.

jamadden commented 7 years ago

Happy to help.