question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Installing a local package with `pipenv install '-e .'` doesn't save dependencies

See original GitHub issue
Describe your environment
  1. Linux
  2. Python version: 3.4
  3. Pipenv version: 8.2.7
Expected result

Installing a local package with pipenv install '-e .' should install the local package then install its dependencies, then save all of that in the Pipfile and Pipfile.lock.

Actual result

The first install command pipfile install '-e .' correctly installs all expected packages and saves the expected results into Pipfile, but the Pipfile.lock only contains the local package and non of its dependencies.

Steps to replicate
$ pipenv --three
Creating a virtualenv for this project…
Using /path/to/python/bin/python3 to create virtualenv…
⠋Already using interpreter /path/to/python/bin/python3
Using base prefix '/path/to/python'
New python executable in /home/chris/.local/share/virtualenvs/pipenv-local-lock-bug-l-tO7M9D/bin/python3
Also creating executable in /home/chris/.local/share/virtualenvs/pipenv-local-lock-bug-l-tO7M9D/bin/python
Installing setuptools, pip, wheel...done.

Virtualenv location: /home/chris/.local/share/virtualenvs/pipenv-local-lock-bug-l-tO7M9D
Creating a Pipfile for this project…
chris $ pipenv install '-e .'
Installing -e .…
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒Obtaining file:///home/chris/demos/pipenv-local-lock-bug
Collecting Flask (from foobar==1.0.0)
  Using cached Flask-0.12.2-py2.py3-none-any.whl
Collecting click>=2.0 (from Flask->foobar==1.0.0)
  Using cached click-6.7-py2.py3-none-any.whl
Collecting itsdangerous>=0.21 (from Flask->foobar==1.0.0)
Collecting Jinja2>=2.4 (from Flask->foobar==1.0.0)
  Using cached Jinja2-2.9.6-py2.py3-none-any.whl
Collecting Werkzeug>=0.7 (from Flask->foobar==1.0.0)
  Using cached Werkzeug-0.12.2-py2.py3-none-any.whl
Collecting MarkupSafe>=0.23 (from Jinja2>=2.4->Flask->foobar==1.0.0)
Installing collected packages: click, itsdangerous, MarkupSafe, Jinja2, Werkzeug, Flask, foobar
  Running setup.py develop for foobar
Successfully installed Flask-0.12.2 Jinja2-2.9.6 MarkupSafe-1.0 Werkzeug-0.12.2 click-6.7 foobar itsdangerous-0.24

Adding -e . to Pipfile's [packages]…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
Updated Pipfile.lock (e45bed)!
chris $ pipenv run pip freeze
click==6.7
Flask==0.12.2
foobar==1.0.0
itsdangerous==0.24
Jinja2==2.9.6
MarkupSafe==1.0
Werkzeug==0.12.2
chris $ pipenv --three
Virtualenv already exists!
Removing existing virtualenv…
Creating a virtualenv for this project…
Using /path/to/python/bin/python3 to create virtualenv…
⠋  Already using interpreter /path/to/python/bin/python3
Using base prefix '/path/to/python'
New python executable in /home/chris/.local/share/virtualenvs/pipenv-local-lock-bug-l-tO7M9D/bin/python3
Also creating executable in /home/chris/.local/share/virtualenvs/pipenv-local-lock-bug-l-tO7M9D/bin/python
Installing setuptools, pip, wheel...done.

Virtualenv location: /home/chris/.local/share/virtualenvs/pipenv-local-lock-bug-l-tO7M9D
chris $ pipenv install
Installing dependencies from Pipfile.lock (e45bed)…
  🐍   ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 1/1 — 00:00:01
To activate this project's virtualenv, run the following:
 $ pipenv shell
chris $ pipenv run pip freeze
foobar==1.0.0
chris $ pipenv lock --verbose --clear
Locking [dev-packages] dependencies…
Using pip: -i https://pypi.python.org/simple

                          ROUND 1
Current constraints:

Finding the best candidates:

Finding secondary dependencies:
------------------------------------------------------------
Result of round 1: stable, done
Locking [packages] dependencies…
Using pip: -i https://pypi.python.org/simple

                          ROUND 1
Current constraints:

Finding the best candidates:

Finding secondary dependencies:
------------------------------------------------------------
Result of round 1: stable, done
Updated Pipfile.lock (e45bed)!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:6
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

9reactions
chrisphilip322commented, Mar 20, 2018

I updated to pipenv==11.8.3 and this issue seems to have been fixed. I am able to install a local package and have its dependencies locked in Pipfile.lock and I am able to install from Pipfile.lock.

2reactions
chrisphilip322commented, Nov 2, 2017

Relevant Files

Pipfile

[[source]]

verify_ssl = true
url = "https://pypi.python.org/simple"
name = "pypi"


[dev-packages]



[requires]

python_version = "3.4"


[packages]

"e1839a8" = {path = ".", editable = true}

Pipfile.lock

{
    "_meta": {
        "hash": {
            "sha256": "ab499050fd277d2e6eb0a8dc5a743672c2b43a1be18fe764bf1152d864e45bed"
        },
        "host-environment-markers": "REDACTED",
        "pipfile-spec": 6,
        "requires": {
            "python_version": "3.4"
        },
        "sources": [
            {
                "name": "pypi",
                "url": "https://pypi.python.org/simple",
                "verify_ssl": true
            }
        ]
    },
    "default": {
        "e1839a8": {
            "editable": true,
            "path": "."
        }
    },
    "develop": {}
}

setup.py

from setuptools import setup, find_packages

setup(
    name='foobar',
    version='1.0.0',
    author='macbeth322',
    package_dir={'': 'src'},
    packages=find_packages('src'),
    install_requires=[
        'Flask',
    ],
)
Read more comments on GitHub >

github_iconTop Results From Across the Web

Build and install local package with pip and pipenv
You can setup a new env with the good version with: pipenv --python 3.6 command. pipenv install [local path to my project folder...
Read more >
Basic Usage of Pipenv - Read the Docs
$ pipenv install is used for installing packages into the pipenv virtual environment and updating your Pipfile. Along with the basic install command,...
Read more >
pipenv Documentation - Read the Docs
Installing pipenv via Homebrew or Linuxbrew will keep pipenv and all of its dependencies in an isolated virtual envi- ronment so it doesn't...
Read more >
Simplifying Python Builds. A Single Source of Truth for…
If you were to run a pipenv install -e . for local testing of the package this would ... Have my Pipfile install...
Read more >
Using Python's pip to Manage Your Projects' Dependencies
Set up pip in your working environment; Fix common errors related to working with pip; Install and uninstall packages with pip ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found