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

Fixed bad command in Tutorials -> Packaging Python Projects #1604

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

shitwolfymakes
Copy link

@shitwolfymakes shitwolfymakes commented Oct 2, 2024

The command template currently present in Installing your newly uploaded package:

python3 -m pip install --index-url https://test.pypi.org/simple/ --no-deps example-package-YOUR-USERNAME-HERE

Results in the following error:

Looking in indexes: https://test.pypi.org/simple/
ERROR: Could not find a version that satisfies the requirement openbambucommands-shitwolfymakes (from versions: none)
ERROR: No matching distribution found for openbambucommands-shitwolfymakes

Trying again with the command:

python3 -m pip install --index-url https://test.pypi.org/simple/ --no-deps openbambucommands

Results in a successful installation:

Looking in indexes: https://test.pypi.org/simple/
Collecting openbambucommands
  Downloading https://test-files.pythonhosted.org/packages/0f/c8/3530b5a3aa7e1f6cb23e1b83b0b3608d1bcce6a32197dfbd2ba247ef9998/openbambucommands-0.1.0-py3-none-any.whl.metadata (1.2 kB)
Downloading https://test-files.pythonhosted.org/packages/0f/c8/3530b5a3aa7e1f6cb23e1b83b0b3608d1bcce6a32197dfbd2ba247ef9998/openbambucommands-0.1.0-py3-none-any.whl (3.5 kB)
Installing collected packages: openbambucommands
Successfully installed openbambucommands-0.1.0

I'm not sure if this is caused by a lack of package name collisions, or something else, but it seems the appropriate command template should be python3 -m pip install --index-url https://test.pypi.org/simple/ --no-deps example-package. If that is not the case I can add a sentence or two explaining the circumstances under which -YOUR-USERNAME-HERE would need to be added.


📚 Documentation preview 📚: https://python-packaging-user-guide--1604.org.readthedocs.build/en/1604/

@sinoroc
Copy link
Contributor

sinoroc commented Oct 2, 2024

How did you name your project? What name did you write in pyproject.toml? That name is the distribution package name, and that is the name that is used on PyPI and that you should use when you install with pip.

@sinoroc
Copy link
Contributor

sinoroc commented Oct 2, 2024

The tutorial clearly says for pyproject.toml:

[project]
name = "example_package_YOUR_USERNAME_HERE"

so the pip installation command is correct.

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

Successfully merging this pull request may close these issues.

2 participants