Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pipenv vs setup.py

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.

like image 1000
khan Avatar asked Nov 10 '17 16:11

khan


People also ask

Is Pipenv obsolete?

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.

Is Pipenv better than pip?

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.

Why should I use Pipenv?

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.

Should I use virtualenv or Pipenv?

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.

What is pipenv in Python?

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.

What is pipenv-setup?

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.

Is there an alternative to pipenv install-E?

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 ...

What does $pipenv install--system do?

$ pipenv install --system This is useful for managing the system Python, and deployment infrastructure (e.g. Heroku does this). ☤ Pipenv and Other Python Distributions¶


1 Answers

Update:

pipenv 9.0.0 has been released, which should allow you to use pipenv install -e . as expected.

Original answer:

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.

like image 98
cs01 Avatar answered Sep 20 '22 21:09

cs01