Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing some packages using --index-url fails on pipx 0.15.6.0 #598

Closed
diazona opened this issue Jan 14, 2021 · 1 comment
Closed

Installing some packages using --index-url fails on pipx 0.15.6.0 #598

diazona opened this issue Jan 14, 2021 · 1 comment

Comments

@diazona
Copy link

diazona commented Jan 14, 2021

Describe the bug

Installing some packages with the --index-url option pointing at a private repository fails with this error:

Internal error with venv metadata inspection.

Unable to install ellipsix-pipxbugtest.
Check the name or spec for errors, and verify that it can be installed with pip.

I've managed to reproduce this with pipx 0.15.6.0 and current master (184799c), but 0.15.5.1 and earlier versions of pipx install the package with no problems.

I've tried to check if this is a problem in my package, but I haven't found anything to indicate so.

How to reproduce

  1. Acquire a wheel or source distribution of https://github.com/diazona/pipx-bug-test-project. Either clone and build it yourself with python setup.py sdist bdist_wheel or pyproject-build -sw, or for convenience I've posted the files on my website: wheel or sdist

  2. Create the following directory structure for a local PyPI mirror

    <server root>/
        ellipsix-pipxbugtest/
            ellipsix.pipxbugtest-0.0.0-py3-none-any.whl
            ellipsix.pipxbugtest-0.0.0.tar.gz
    
  3. Run python3 -m http.server from the <server root> directory

  4. Run pipx install with --index-url pointing to the server.

I get the following output:

$ pipx install --verbose --index-url http://localhost:8000 ellipsix.pipxbugtest
pipx >(setup:704): pipx version is 0.15.6.0.dev0
pipx >(setup:705): Default python interpreter is '/home/diazona/tmp/pipx-bug-test-venv/bin/python3.8'
pipx >(package_name_from_spec:299): Determined package name: ellipsix-pipxbugtest
pipx >(package_name_from_spec:300): Package name determined in 0.0s
creating virtual environment...
pipx >(run_subprocess:120): running /home/diazona/tmp/pipx-bug-test-venv/bin/python3.8 -m venv --without-pip /home/diazona/tmp/pipx-bug-test-venv/libexec/pipx/venvs/ellipsix-pipxbugtest
pipx >(run_subprocess:120): running /home/diazona/tmp/pipx-bug-test-venv/libexec/pipx/venvs/ellipsix-pipxbugtest/bin/python -c import sysconfig; print(sysconfig.get_path('purelib'))
pipx >(run_subprocess:120): running /home/diazona/tmp/pipx-bug-test-venv/libexec/pipx/shared/bin/python -c import sysconfig; print(sysconfig.get_path('purelib'))
pipx >(run_subprocess:120): running /home/diazona/tmp/pipx-bug-test-venv/libexec/pipx/venvs/ellipsix-pipxbugtest/bin/python --version
pipx >(_parsed_package_to_package_or_url:128): cleaned package spec: ellipsix-pipxbugtest
installing ellipsix-pipxbugtest...
pipx >(run_subprocess:120): running /home/diazona/tmp/pipx-bug-test-venv/libexec/pipx/venvs/ellipsix-pipxbugtest/bin/python -m pip install --index-url http://localhost:8000 ellipsix-pipxbugtest
pipx >(run_subprocess:120): running /home/diazona/tmp/pipx-bug-test-venv/libexec/pipx/venvs/ellipsix-pipxbugtest/bin/python -c <contents of venv_metadata_inspector.py> ellipsix-pipxbugtest /home/diazona/tmp/pipx-bug-test-venv/libexec/pipx/venvs/ellipsix-pipxbugtest/bin
pipx >(get_venv_metadata_for_package:314): Internal error with venv metadata inspection.
pipx >(get_venv_metadata_for_package:315): venv_metadata_inspector.py Traceback:
Traceback (most recent call last):
  File "<string>", line 159, in <module>
  File "<string>", line 120, in main
  File "<string>", line 37, in get_apps
  File "/home/diazona/tmp/pipx-bug-test-venv/libexec/pipx/shared/lib/python3.8/site-packages/pkg_resources/__init__.py", line 480, in get_distribution
    dist = get_provider(dist)
  File "/home/diazona/tmp/pipx-bug-test-venv/libexec/pipx/shared/lib/python3.8/site-packages/pkg_resources/__init__.py", line 356, in get_provider
    return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
  File "/home/diazona/tmp/pipx-bug-test-venv/libexec/pipx/shared/lib/python3.8/site-packages/pkg_resources/__init__.py", line 899, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/home/diazona/tmp/pipx-bug-test-venv/libexec/pipx/shared/lib/python3.8/site-packages/pkg_resources/__init__.py", line 785, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'ellipsix-pipxbugtest' distribution was not found and is required by the application
pipx >(_parsed_package_to_package_or_url:128): cleaned package spec: ellipsix-pipxbugtest

pipx >(rmdir:25): removing directory /home/diazona/tmp/pipx-bug-test-venv/libexec/pipx/venvs/ellipsix-pipxbugtest
Unable to install ellipsix-pipxbugtest.
Check the name or spec for errors, and verify that it can be installed with pip.

Note that all the following commands work fine, assuming the file has been downloaded:

$ pipx install git+https://github.com/diazona/pipx-bug-test-project.git
$ pipx install ellipsix.pipxbugtest-0.0.0.tar.gz
$ pipx install ellipsix.pipxbugtest-0.0.0-py3-none-any.whl

Installing the package with pip (whether from a downloaded file, a repository URL, using --index-url, etc.) works fine as well.

Expected behavior

It should install successfully:

$ pipx install --index-url http://localhost:8000 ellipsix.pipxbugtest
  installed package ellipsix.pipxbugtest 0.0.0, Python 3.8.6
  These apps are now globally available
    - pipx-test-script
done! ✨ 🌟 ✨
@diazona
Copy link
Author

diazona commented Jan 14, 2021

Whoops, I realized just after posting that this looks like the same issue as #587 and I guess #528. Sorry for the distraction!

@diazona diazona closed this as completed Jan 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant