-1

I am currently creating a python library, and I want to find what is the best way for a user to install it on their computer.

It is not distributed on Pypi (or Pypi test) for now, so I want them to install it manually easily from their clone of the git repo.

I couldn't find a lot of up-to-date information, with the new way of building libraries (with a pyproject.toml).

A coworker told me he just uses pip install . from the root of the library. On the other hand, since I prefer to use virtual environments, I build the library with python -m build. I then install my library in an other venv with the .whl file generated, with pip install /path/to/the/library/dist/my_library.whl.

Is this the correct way to do it ? Is there a better or simpler way for users to manually install my library ?

2

1 Answer 1

0

The best way to manually install a Python library during development is indeed to use pip install . or pip install -e . in the library's root directory.

The method you described - building a wheel and installing it - it also valid, particularly if you want users to distribute a pre-built package within an organization or limited scope.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.