Skip to main content

A test package for verifying which Python is in use and where `pip` is installing packages

Project description

package-installation-test

This package is designed to verify that you can successfully install Python packages from PyPI using pip, and subsequently use them. In particular, it is meant to test that you are installing packages to the correct Python installation. It is written to complement a question on Stack Overflow about this problem, to allow for testing the solutions offered there.

Installation

Install this package from PyPI using pip install package-installation-test. Alternately, clone the repository, navigate to the root of the repository, and then use pip install . to install it. Note the . at the end of the latter command (specifying the current directory).

Note carefully that the installed package has a different name from the name used on PyPI and in this repository; although we install package-installation-test (notice that this is not a valid Python identifier anyway), code will refer to the package as example_package.

Command-line use

Once installed, you should be able to "run" the package as a module, using python -m example_package.

Installation will also create a wrapper executable called demo-example-package, which you can run at the command line by that name.

Either of these options should print a diagnostic message that looks like:

Version 1.0.0 of example_package successfully installed.
The source code is in <...>.

where the <...> is replaced by the actual path where the code was installed.

API

You can verify that the code is usable as a package by importing it from the interactive prompt:

>>> import example_package
>>>

This provides two functions:

main - prints the same message as before.

home - returns the path to where the code was installed, as a pathlib.Path instance.

Both of these functions take no arguments.

Troubleshooting

If the above steps don't work as advertised, the problem is almost certainly that pip installed to a different installation of Python than the one you are trying to use. (If the demo-example-package doesn't work, that's because you installed to a Python installation that isn't the first one on the PATH.

Please read the corresponding question and answer on Stack Overflow to understand how to solve the problem.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

package-installation-test-1.0.0.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file package-installation-test-1.0.0.tar.gz.

File metadata

  • Download URL: package-installation-test-1.0.0.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.1 CPython/3.8.10 Linux/5.4.0-126-generic

File hashes

Hashes for package-installation-test-1.0.0.tar.gz
Algorithm Hash digest
SHA256 7bab64f5f76cf31b1e0629895b01d02185662d7c1a33b37b4cd2a21afffcf984
MD5 acd8d3b912ba266bee75bdebc86aec79
BLAKE2b-256 d1b012ddf7b07ee6dfca0a83e198eb869570ae1c3b502899b9d5077b7e1893b6

See more details on using hashes here.

File details

Details for the file package_installation_test-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for package_installation_test-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d367c5e99a83509443337a68d46424f0e52e0f098f3ed80646f00df25093318a
MD5 893895149a63cdda95fa7f5bc1429310
BLAKE2b-256 902e1a808344ee608158e3a2c4d96a9b15652e1425d52870da925cddee4bd1d9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page