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.

extra-index-url that works with pip does not work with pipenv install

See original GitHub issue

Issue description

Pytorch nightly can be installed using this pip command:

pip install torch_nightly -f https://download.pytorch.org/whl/nightly/cu100/torch_nightly.html

I am unable to install the same package using pipenv install.

I added this source entry in my Pipfile

[[source]]
name = "pytorch-nightly"
url = "https://download.pytorch.org/whl/nightly/cu100/torch_nightly.html"
verify_ssl = true

and added torch-nightly under packages like this:

[packages]
torch-nightly = {version="*", index="pytorch-nightly"}

Expected result

Installation of torch-nightly from pytorch’s index

Actual result

ERROR: ERROR: Could not find a version that matches torch-nightly

Steps to replicate

Add the above [[source]] and [packages] entries in your Pipfile and run pipenv install


$ pipenv --support

Pipenv version: '2018.11.15.dev0'

Pipenv location: '/usr/lib/python3.7/site-packages/pipenv'

Python location: '/usr/bin/python'

Python installations found:

  • 3.7.3: /usr/bin/python3
  • 3.7.3: /usr/bin/python3.7m
  • 3.7.2: /home/kureta/.pyenv/versions/dimensions-venv/bin/python
  • 3.7.2: /home/kureta/.pyenv/versions/exif-move-venv/bin/python
  • 3.7.2: /home/kureta/.pyenv/versions/DRIT-venv/bin/python
  • 3.7.2: /home/kureta/.pyenv/versions/tf-venv/bin/python
  • 3.7.2: /home/kureta/.pyenv/versions/wgan-gp-venv/bin/python
  • 3.7.2: /home/kureta/.pyenv/versions/zachary-venv/bin/python
  • 3.7.2: /home/kureta/.pyenv/versions/stylegan-venv/bin/python
  • 3.7.2: /home/kureta/.pyenv/versions/3.7.2/bin/python
  • 3.7.2: /home/kureta/.pyenv/versions/3.7.2/bin/python3.7m
  • 2.7.16: /usr/bin/python2

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.7.3',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '4.19.31-rt18-4-rt-bfq',
 'platform_system': 'Linux',
 'platform_version': '#1 SMP PREEMPT RT Sat Apr 13 17:52:33 +03 2019',
 'python_full_version': '3.7.3',
 'python_version': '3.7',
 'sys_platform': 'linux'}

System environment variables:

  • SHELL
  • DESKTOP_SESSION
  • GTK_MODULES
  • XDG_SEAT
  • PWD
  • LOGNAME
  • QT_QPA_PLATFORMTHEME
  • XDG_SESSION_TYPE
  • DSSI_PATH
  • XAUTHORITY
  • HOME
  • LANG
  • VST_PATH
  • XDG_CURRENT_DESKTOP
  • INVOCATION_ID
  • XDG_SESSION_CLASS
  • USER
  • DISPLAY
  • SHLVL
  • XDG_VTNR
  • XDG_SESSION_ID
  • XDG_RUNTIME_DIR
  • MAVEN_OPTS
  • JOURNAL_STREAM
  • PATH
  • DBUS_SESSION_BUS_ADDRESS
  • LV2_PATH
  • MAIL
  • LADSPA_PATH
  • CADENCE_AUTO_STARTED
  • _
  • KITTY_WINDOW_ID
  • WINDOWID
  • TERM
  • COLORTERM
  • TERMINFO
  • OLDPWD
  • ZSH
  • GEM_HOME
  • EDITOR
  • ALTERNATE_EDITOR
  • PAGER
  • LESS
  • LSCOLORS
  • LS_COLORS
  • PYENV_SHELL
  • LC_CTYPE
  • 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/kureta/.pyenv/shims:/home/kureta/.gem/ruby/2.6.0/bin:/home/kureta/.local/bin:/home/kureta/.gem/ruby/2.6.0/bin:/home/kureta/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/opt/cuda/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/kureta/.pyenv/bin
  • SHELL: /usr/bin/zsh
  • EDITOR: vim
  • LANG: en_US.UTF-8
  • PWD: /home/kureta/Documents/repos/berlin

Contents of Pipfile (‘/home/kureta/Documents/repos/berlin/Pipfile’):

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

[[source]]
name = "pytorch"
url = "https://download.pytorch.org/whl/nightly/cu100/torch_nightly.html"
verify_ssl = true

[dev-packages]

[packages]
numpy = "*"
opencv-python = "*"
essentia = "*"
jack-client = "*"
torch-nightly = {version="*", index="pytorch"}
torchvision-nightly = "*"

[requires]
python_version = "3.7"

[pipenv]
allow_prereleases = true

Contents of Pipfile.lock (‘/home/kureta/Documents/repos/berlin/Pipfile.lock’):

{
    "_meta": {
        "hash": {
            "sha256": "463d71343037600bdf8b22cda39a97f0e9cc6cd9cd9bf65dc299658435997b81"
        },
        "pipfile-spec": 6,
        "requires": {
            "python_version": "3.7"
        },
        "sources": [
            {
                "name": "pypi",
                "url": "https://pypi.org/simple",
                "verify_ssl": true
            },
            {
                "name": "pytorch",
                "url": "https://download.pytorch.org/whl/nightly/cu100/torch_nightly.html",
                "verify_ssl": true
            }
        ]
    },
    "default": {},
    "develop": {}
}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
frostmingcommented, Apr 18, 2019

@kureta I emphasized in my last comment that [source] section works like --index-url not --find-links, so it is normal that adding a non-index link to source won’t work.

To make the Pipfile itself reproducible, you can specify the dependency with file url like this:

[packages]
torch-nightly = {file = "https://download.pytorch.org/whee/download/link.whl"}

Is this possible?

0reactions
kuretacommented, May 21, 2019

@ajrcampbell just go to https://download.pytorch.org/whl/nightly/cu100/torch_nightly.html and view source code. Download the latest .whl from the list and add it to your Pipfile like this

[packages]
torch-nightly = {file = "https://download.pytorch.org/whee/download/link.whl"}

Or add this environment variable:

PIP_FIND_LINKS="https://download.pytorch.org/whl/nightly/cu100/torch_nightly.html"

and add torch-nightly to your Pipfile

[packages]
torch-nightly = "*"

However, torch is a very large package and, for me, it took a lot of time to lock and/or install anything while I had torch-nightly in my Pipfile, so I downloaded the latest wheel and added it as a local file to like so:

 [packages]
torch-nightly = {file = "~/Downloads/torch.whl"}

It still took a long time to lock and I finally moved on to venv and pip.

Read more comments on GitHub >

github_iconTop Results From Across the Web

extra-index-url does not work with pipenv install #1406 - GitHub
For me the $PIP_EXTRA_INDEX_URL mentioned there works with pipenv install foo but doesn't work with pipenv lock . 1
Read more >
extra-index-url is not getting used properly when used in pip ...
I can't figure out what it is I'm doing wrong with the pip.conf file. It works as well if I install the package...
Read more >
extra-index-url` to install private packages from GitLab CI
So I only see 3 solutions for this problem: Enable hash-checking mode by freezing my setup.py dependencies to a requirements.txt (possibly using ...
Read more >
Advanced Usage of Pipenv - Read the Docs
Dependencies of wheels provided in a Pipfile will not be captured by $ pipenv lock . There are some known issues with using...
Read more >
pip install - pip documentation v22.3.1
Description#. Install packages from: PyPI (and other indexes) using requirement specifiers. VCS project urls. Local project directories.
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