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.

Specify local folder to use for dependency.

See original GitHub issue

Be sure to check the existing issues (both open and closed!), and make sure you are running the latest version of Pipenv.

Check the diagnose documentation for common issues and the PEEP list before posting! We may close your issue if it is very similar to one of them. Please be considerate and follow the PEEP process, or be on your way.

Make sure to mention your debugging experience if the documented solution failed.

Is your feature request related to a problem? Please describe.

I have a project that is structured like this:

project
| 
|-package
|     |-src
|     |-setup.py
|-package_extras
|     |-src
|     |-setup.py
|-package_common
|     |-src
|     |-setup.py

In package/setup.py and package-extras/setup.py I have specified that that package-common as a dependency. When developing the program, I prefer to use editable installs so that I can quickly change and test all three packages. I have added the following to my Pipfile:

[packages]
package_common = {editable=true, path="./package_common}
package= {editable=true, path="./package}
package_extras = {editable=true, path="./package_extras}

When running pipenv update, pipenv checks the dependencies of package and package-extras and determines that it needs to install package-common, however it only searches https://pypi.org/simple, does not find the package, and then errors out.

Describe the solution you’d like

An additional argument or option available for pipenv that will allow me to specify that a dependency of a package is found in a local folder.

Describe alternatives you’ve considered

  • Manually Installing local packages one-by-one
    • While useable, it somewhat defeats the purpose of using pipenv
  • Installing packages from a repository, or from a VCS:
    • None of these packages are currently available on a repo or VCS Server
    • Doing this prevents the packages from being editable.

Additional context

Add any other context or screenshots about the feature request here. It may be a good idea to mention that platform and Python version you are on.

Python 3.8 Ubuntu x64


$ pipenv --support

Pipenv version: '2021.5.29'

Pipenv location: '/home/gabe/.local/lib/python3.8/site-packages/pipenv'

Python location: '/usr/bin/python3'

Python installations found:

  • 3.8.10: /usr/bin/python3.8
  • 3.8.10: /usr/bin/python3
  • 3.8.10: /bin/python3.8
  • 3.8.10: /bin/python3

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.8.10',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '5.4.0-89-generic',
 'platform_system': 'Linux',
 'platform_version': '#100-Ubuntu SMP Fri Sep 24 14:50:10 UTC 2021',
 'python_full_version': '3.8.10',
 'python_version': '3.8',
 'sys_platform': 'linux'}

System environment variables:

  • SHELL
  • PWD
  • LOGNAME
  • XDG_SESSION_TYPE
  • MOTD_SHOWN
  • HOME
  • LANG
  • LS_COLORS
  • SSH_CONNECTION
  • LESSCLOSE
  • XDG_SESSION_CLASS
  • TERM
  • LESSOPEN
  • USER
  • SHLVL
  • XDG_SESSION_ID
  • XDG_RUNTIME_DIR
  • SSH_CLIENT
  • XDG_DATA_DIRS
  • PATH
  • DBUS_SESSION_BUS_ADDRESS
  • SSH_TTY
  • OLDPWD
  • _
  • PIP_DISABLE_PIP_VERSION_CHECK
  • PYTHONDONTWRITEBYTECODE
  • PIP_SHIMS_BASE_MODULE
  • PIP_PYTHON_PATH
  • PYTHONFINDER_IGNORE_UNSUPPORTED

Pipenv–specific environment variables:

Debug–specific environment variables:

  • PATH: /home/gabe/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
  • SHELL: /bin/bash
  • LANG: en_US.UTF-8
  • PWD: /home/gabe/testproj

Contents of Pipfile (‘/home/gabe/testproj/Pipfile’):

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

[packages]
package-common = {editable = true, path = "./package_common"}
package-extras = {editable = true, path = "./package_extras"}
package = {editable = true, path = "./package"}


[dev-packages]

[requires]
python_version = "3.8"

Contents of Pipfile.lock (‘/home/gabe/testproj/Pipfile.lock’):

{
    "_meta": {
        "hash": {
            "sha256": "3de06bf6bb1fcffa06b1bbf79a729ef99d0b3be88b2f5b05478af33f74ffb8a7"
        },
        "pipfile-spec": 6,
        "requires": {
            "python_version": "3.8"
        },
        "sources": [
            {
                "name": "pypi",
                "url": "https://pypi.org/simple",
                "verify_ssl": true
            }
        ]
    },
    "default": {
        "package-common": {
            "editable": true,
            "path": "./package_common"
        }
    },
    "develop": {}
}

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:7

github_iconTop GitHub Comments

1reaction
marsfancommented, Jan 4, 2022

@matteius Sorry for taking so long to reply. Was away from my relevant code.

I’m still having the same issue as I initially reported. pipenv install -e package_common works, but then pipenv install -e package fails afterwards.

I am using setup.cfg instead of setup.py. Not sure why I wrote setup.py in my initial example.

In the [options] section of package/setup.cfg I have the following:

[options]
packages = find:
install_requires =
    package_common
    requests

The exception that I am getting is could not find a version that satisfies the requirement package_common (from versions: none)

The issue appears to be that pipenv does not know to look in local directories for installing dependencies.

0reactions
matteiuscommented, Aug 28, 2022

@marsfan This should work now for editable dependencies that depend on each other for the latest pipenv version, but for this case, you likely need to add both packages as editable to the Pipfile to work.

Read more comments on GitHub >

github_iconTop Results From Across the Web

node.js - Local dependency in package.json - Stack Overflow
I wanted to use a set of local dependencies written in TypeScript, and none of the answers here worked for me ...
Read more >
npm install supports local packages and dependencies
The npm install command supports local development and allows to quickly install and symlink local modules and packages.
Read more >
Deploy Path-Based Local Dependencies - DevSpace
Example: Use dev.yaml for Dependency's DevSpace Configuration​ ... running devspace deploy -p [profile] within the folder of the dependency.
Read more >
How to use local Node packages as project dependencies
How to use local Node packages as project dependencies · Install yalc. Install yalc · Publish a package to your local yalc store....
Read more >
The paket.local file - fsprojects on GitHub
The paket.local file is used for testing changes before releasing new version ... is the same as used in paket.dependencies for specifying git...
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