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.

Interdependent editable packages

See original GitHub issue

First of all, thanks for all the work on this great package!

I am working on a project updating some old packages that are not distributed via PyPI but via our own package index. Using pipenv with our own package index works great. However, in my dev environment, I’d like to install them editable from github, checking out the correct branch. I can do so by calling the pipenv install -e git+git@github.com:<>/<>.git@<>, which works fine.

The dependency graph of the relevant packages is as follows:

lizard-blockbox==1.1
  - lizard-ui [required: Any, installed: 4.50]
  - lizard-management-command-runner [required: Any, installed: 0.2]
    - lizard-ui [required: Any, installed: 4.50]

Pipenv version: `‘11.10.1.dev4’


Expected result

Correct installation of three packages from github.

Actual result

Pipenv starts installing lizard-blockbox, which has a dependency on lizard-management-command-runner. This is not on Pypi and installation fails.

Steps to replicate

Generate the Pipfile as follows (the order is important – see dependency graph):

pipenv --two
pipenv install -e git+git@github.com:lizardsystem/lizard-ui.git@4.50#egg=lizard-ui
pipenv install -e git+git@github.com:lizardsystem/lizard-management-command-runner.git@0.2#egg=lizard-management-command-runner
pipenv install -e git+git@github.com:lizardsystem/lizard-blockbox.git@1.1#egg=lizard-blockbox

Resulting Pipfile

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

[packages]
lizard-ui = {git = "git@github.com:lizardsystem/lizard-ui.git", editable = true, ref = "4.50"}
lizard-management-command-runner = {git = "git@github.com:lizardsystem/lizard-management-command-runner.git", editable = true, ref = "0.2"}
lizard-blockbox = {git = "git@github.com:lizardsystem/lizard-blockbox.git", editable = true, ref = "1.1"}

[dev-packages]

[requires]
python_version = "2.7"

Then remove the environment and install again: pipenv --rm; pipenv --two; pipenv install --deploy.

The following error is logged:

pipenv install --deploy
Installing dependencies from Pipfile.lock (17d58e)…
An error occurred while installing -e git+git@github.com:lizardsystem/lizard-blockbox.git@1.1#egg=lizard-blockbox! Will try again.
  🐍   ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 18/18 — 00:00:16
An error occurred while installing -e git+git@github.com:lizardsystem/lizard-management-command-runner.git@0.2#egg=lizard-management-command-runner! Will try again.
Installing initially–failed dependencies…
Obtaining lizard-blockbox from git+git@github.com:lizardsystem/lizard-blockbox.git@1.1#egg=lizard-blockbox
  Updating ./.venv/src/lizard-blockbox clone (to revision 1.1)
Requirement already satisfied: Django<2,>=1.9 in ./.venv/lib/python2.7/site-packages (from lizard-blockbox) (1.11.13)
Collecting lizard-management-command-runner>=0.2 (from lizard-blockbox)

  Could not find a version that satisfies the requirement lizard-management-command-runner>=0.2 (from lizard-blockbox) (from versions: )
No matching distribution found for lizard-management-command-runner>=0.2 (from lizard-blockbox)

  ☤  ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 0/2 — 00:00:
Proposed fix

Best solution would be to “blacklist” other specified VCS packages when installing a VCS package. But pip does not provide this option.

It seems to be a use case for the sequential install option; but how would I determine the installation order then?

Other solution might be (bit hacky) convincing pip that VCS dependencies already exist before installing and then force-reinstall at the actual pip install.

Now I just retry deployment until it does not fail. Mostly it works on the second try.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
caspervdwcommented, Apr 26, 2018

That was fast! Thanks. Setting editable = false gives me precisely the same issue (after removing env and lockfile)

0reactions
cwill747commented, Aug 22, 2018

Note that this works in pip, if you use dependency_links like so:

setup(
  name="com.example.b",
  version="1.0.0",
  install_requires = [ "com.example.a==1.0.0"],
  dependency_links = [ "git+ssh://git@<snip>#egg=com.example.a&subdirectory=a" ]
)

pip install -e /path/to/monorepo/b

This correctly installs com.example.a, but pipenv throws the same error as above

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to pip install interdependent packages from a local ...
I'm having issues with pip failing to install editable packages from a local directory. I was able to install the packages manually using ......
Read more >
Interdependence - Slide Team
Interdependence found in: Interdependence dimensional image with text boxes, Team effectiveness powerpoint presentation slide template, ...
Read more >
How to develop multiple inter-dependent Python packages?
What I'm looking for: Developing multiple Python packages in ... Note: Poetry 1.2 will include an —editable flag to automate this step, ...
Read more >
Can we consider --editable a bad practice? - Red Hat Developer
Editable installs are editable versions of a specific package—they can be easily adjusted locally and there is no direct way of controlling what ......
Read more >
Distributing Python Packages: Defining Dependencies
One part of the process that can be a little challenging during the building of a package distribution is specifying the dependencies that ......
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