I am trying to migrate to pipenv
. I traditionally used setup.py
with pip
and did pip install -e .
to install the module as a package, so that I can achieve stuff like from myproject.xyz.abc import myClass
from anywhere within the project.
How do I achieve the similar effect with pipenv
and get rid of the setup.py
?
Note: I am using python 2.7
.
Pipenv was never dead. The author of that article doesn't know what he's talking about. The latest release of pipenv was 25 days ago and there were 8 releases in 2020. He also says he uses pyenv for virtual environment management, but pyenv doesn't even do that.
While pip can install Python packages, Pipenv is recommended as it's a higher-level tool that simplifies dependency management for common use cases. This does a user installation to prevent breaking any system-wide packages.
Pipenv is a packaging tool for Python that solves some common problems associated with the typical workflow using pip , virtualenv , and the good old requirements. txt . In addition to addressing some common issues, it consolidates and simplifies the development process to a single command line tool.
If you are working with your personal projects and not installing pipenv, I recommend installing pyenv-virtualenv. If you are working in a team or with more than one system, I recommend you to install pipenv which I am covering next.
Pipenv: A Guide to the New Python Packaging Tool. Pipenv is a packaging tool for Python that solves some common problems associated with the typical workflow using pip, virtualenv, and the good old requirements.txt. In addition to addressing some common issues, it consolidates and simplifies the development process to a single command line tool.
Pipenv-Setup A beautiful python package development tool: sync dependencies in Pipfile or Pipfile.lock to setup.py. Never need again to change dependencies manually in setup.py, and enjoy the same dependency locking or semantic versioning. Or just check whether setup.py and Pipfile are consistent and sync dependency when necessary.
An alternative to pipenv install -e, if you want to test your actual source distribution, is to actually build your source distribution of foobar, then pipenv installfrom that. libraries$ python3.8 setup.py sdist ...
$ pipenv install --system This is useful for managing the system Python, and deployment infrastructure (e.g. Heroku does this). ☤ Pipenv and Other Python Distributions¶
pipenv 9.0.0 has been released, which should allow you to use pipenv install -e .
as expected.
pipenv install -e
is buggy and has been fixed in master (pull request). It will be available in the next release, sometime after Thanksgiving.
Temporary workaround for now is:
pipenv shell pip install -e .
After the release, you should be able to run pipenv install -e .
similar to what you'd expect with pip
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With