Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pipenv fails to install torch 1.3 #4171

Closed
andreaferretti opened this issue Apr 2, 2020 · 1 comment · Fixed by #4747
Closed

Pipenv fails to install torch 1.3 #4171

andreaferretti opened this issue Apr 2, 2020 · 1 comment · Fixed by #4747
Labels
Type: Question ❔ This is a question or a request for support.

Comments

@andreaferretti
Copy link

Issue description

I fail to install torch 1.3, even in a clean pipenv environment. What is even more strange, the error message mentions an incompatibility between the explicit requirement of version 1.3 and the requirement of torch 1.4 (which I never asked in the first place!)

The command that triggers the failure is pipenv install torch==1.3 torchvision

Notice that torchvision, at its most recent release, only requires version 1.2 of torch.

Expected result

An environment with pytorch 1.3 and torchvision

Actual result

An error

Creating a virtualenv for this project…
Pipfile: /Users/andrea/esperimenti/test/Pipfile
Using /Users/andrea/.bin/miniconda3/bin/python (3.6.10) to create virtualenv…
⠹ Creating virtual environment...Already using interpreter /Users/andrea/.bin/miniconda3/bin/python
Using base prefix '/Users/andrea/.bin/miniconda3'
New python executable in /Users/andrea/.local/share/virtualenvs/test-9gdPc5Hh/bin/python
Installing setuptools, pip, wheel...
done.

✔ Successfully created virtual environment! 
Virtualenv location: /Users/andrea/.local/share/virtualenvs/test-9gdPc5Hh
Installing torch==1.3…
Adding torch to Pipfile's [packages]…
✔ Installation Succeeded 
Installing torchvision…
Adding torchvision to Pipfile's [packages]…
✔ Installation Succeeded 
Pipfile.lock (677ead) out of date, updating to (7d45ef)…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
✘ Locking Failed! 
[pipenv.exceptions.ResolutionFailure]:   File "/Users/andrea/.bin/miniconda3/lib/python3.6/site-packages/pipenv/resolver.py", line 69, in resolve
[pipenv.exceptions.ResolutionFailure]:       req_dir=requirements_dir
[pipenv.exceptions.ResolutionFailure]:   File "/Users/andrea/.bin/miniconda3/lib/python3.6/site-packages/pipenv/utils.py", line 726, in resolve_deps
[pipenv.exceptions.ResolutionFailure]:       req_dir=req_dir,
[pipenv.exceptions.ResolutionFailure]:   File "/Users/andrea/.bin/miniconda3/lib/python3.6/site-packages/pipenv/utils.py", line 480, in actually_resolve_deps
[pipenv.exceptions.ResolutionFailure]:       resolved_tree = resolver.resolve()
[pipenv.exceptions.ResolutionFailure]:   File "/Users/andrea/.bin/miniconda3/lib/python3.6/site-packages/pipenv/utils.py", line 395, in resolve
[pipenv.exceptions.ResolutionFailure]:       raise ResolutionFailure(message=str(e))
[pipenv.exceptions.ResolutionFailure]:       pipenv.exceptions.ResolutionFailure: ERROR: ERROR: Could not find a version that matches torch==1.3,==1.3.1
[pipenv.exceptions.ResolutionFailure]:       Tried: 0.1.2, 0.1.2.post1, 0.1.2.post2, 0.3.0.post4, 0.3.0.post4, 0.3.0.post4, 0.3.1, 0.3.1, 0.3.1, 0.3.1, 0.3.1, 0.3.1, 0.3.1, 0.4.0, 0.4.0, 0.4.0, 0.4.0, 0.4.0, 0.4.0, 0.4.0, 0.4.1, 0.4.1, 0.4.1, 0.4.1, 0.4.1, 0.4.1, 0.4.1, 0.4.1, 0.4.1, 0.4.1.post2, 1.0.0, 1.0.0, 1.0.0, 1.0.0, 1.0.0, 1.0.0, 1.0.0, 1.0.0, 1.0.0, 1.0.1, 1.0.1, 1.0.1, 1.0.1, 1.0.1, 1.0.1, 1.0.1, 1.0.1, 1.0.1, 1.0.1.post2, 1.0.1.post2, 1.0.1.post2, 1.0.1.post2, 1.0.1.post2, 1.0.1.post2, 1.0.1.post2, 1.0.1.post2, 1.0.1.post2, 1.1.0, 1.1.0, 1.1.0, 1.1.0, 1.1.0, 1.1.0, 1.1.0, 1.1.0, 1.1.0, 1.1.0.post2, 1.1.0.post2, 1.1.0.post2, 1.1.0.post2, 1.2.0, 1.2.0, 1.2.0, 1.2.0, 1.2.0, 1.2.0, 1.2.0, 1.2.0, 1.2.0, 1.3.0, 1.3.0, 1.3.0, 1.3.0, 1.3.0, 1.3.0, 1.3.0, 1.3.0, 1.3.0.post2, 1.3.0.post2, 1.3.0.post2, 1.3.0.post2, 1.3.1, 1.3.1, 1.3.1, 1.3.1, 1.3.1, 1.3.1, 1.3.1, 1.3.1, 1.3.1, 1.4.0, 1.4.0, 1.4.0, 1.4.0, 1.4.0, 1.4.0, 1.4.0, 1.4.0, 1.4.0, 1.4.0, 1.4.0
[pipenv.exceptions.ResolutionFailure]: Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
  First try clearing your dependency cache with $ pipenv lock --clear, then try the original command again.
 Alternatively, you can use $ pipenv install --skip-lock to bypass this mechanism, then run $ pipenv graph to inspect the situation.
  Hint: try $ pipenv lock --pre if it is a pre-release dependency.
ERROR: ERROR: Could not find a version that matches torch==1.3,==1.3.1
Tried: 0.1.2, 0.1.2.post1, 0.1.2.post2, 0.3.0.post4, 0.3.0.post4, 0.3.0.post4, 0.3.1, 0.3.1, 0.3.1, 0.3.1, 0.3.1, 0.3.1, 0.3.1, 0.4.0, 0.4.0, 0.4.0, 0.4.0, 0.4.0, 0.4.0, 0.4.0, 0.4.1, 0.4.1, 0.4.1, 0.4.1, 0.4.1, 0.4.1, 0.4.1, 0.4.1, 0.4.1, 0.4.1.post2, 1.0.0, 1.0.0, 1.0.0, 1.0.0, 1.0.0, 1.0.0, 1.0.0, 1.0.0, 1.0.0, 1.0.1, 1.0.1, 1.0.1, 1.0.1, 1.0.1, 1.0.1, 1.0.1, 1.0.1, 1.0.1, 1.0.1.post2, 1.0.1.post2, 1.0.1.post2, 1.0.1.post2, 1.0.1.post2, 1.0.1.post2, 1.0.1.post2, 1.0.1.post2, 1.0.1.post2, 1.1.0, 1.1.0, 1.1.0, 1.1.0, 1.1.0, 1.1.0, 1.1.0, 1.1.0, 1.1.0, 1.1.0.post2, 1.1.0.post2, 1.1.0.post2, 1.1.0.post2, 1.2.0, 1.2.0, 1.2.0, 1.2.0, 1.2.0, 1.2.0, 1.2.0, 1.2.0, 1.2.0, 1.3.0, 1.3.0, 1.3.0, 1.3.0, 1.3.0, 1.3.0, 1.3.0, 1.3.0, 1.3.0.post2, 1.3.0.post2, 1.3.0.post2, 1.3.0.post2, 1.3.1, 1.3.1, 1.3.1, 1.3.1, 1.3.1, 1.3.1, 1.3.1, 1.3.1, 1.3.1, 1.4.0, 1.4.0, 1.4.0, 1.4.0, 1.4.0, 1.4.0, 1.4.0, 1.4.0, 1.4.0, 1.4.0, 1.4.0
There are incompatible versions in the resolved dependencies.
[pipenv.exceptions.ResolutionFailure]:       req_dir=requirements_dir
[pipenv.exceptions.ResolutionFailure]:   File "/Users/andrea/.bin/miniconda3/lib/python3.6/site-packages/pipenv/utils.py", line 726, in resolve_deps
[pipenv.exceptions.ResolutionFailure]:       req_dir=req_dir,
[pipenv.exceptions.ResolutionFailure]:   File "/Users/andrea/.bin/miniconda3/lib/python3.6/site-packages/pipenv/utils.py", line 480, in actually_resolve_deps
[pipenv.exceptions.ResolutionFailure]:       resolved_tree = resolver.resolve()
[pipenv.exceptions.ResolutionFailure]:   File "/Users/andrea/.bin/miniconda3/lib/python3.6/site-packages/pipenv/utils.py", line 395, in resolve
[pipenv.exceptions.ResolutionFailure]:       raise ResolutionFailure(message=str(e))
[pipenv.exceptions.ResolutionFailure]:       pipenv.exceptions.ResolutionFailure: ERROR: ERROR: Could not find a version that matches torch==1.3,==1.3.1
[pipenv.exceptions.ResolutionFailure]:       Tried: 0.1.2, 0.1.2.post1, 0.1.2.post2, 0.3.0.post4, 0.3.0.post4, 0.3.0.post4, 0.3.1, 0.3.1, 0.3.1, 0.3.1, 0.3.1, 0.3.1, 0.3.1, 0.4.0, 0.4.0, 0.4.0, 0.4.0, 0.4.0, 0.4.0, 0.4.0, 0.4.1, 0.4.1, 0.4.1, 0.4.1, 0.4.1, 0.4.1, 0.4.1, 0.4.1, 0.4.1, 0.4.1.post2, 1.0.0, 1.0.0, 1.0.0, 1.0.0, 1.0.0, 1.0.0, 1.0.0, 1.0.0, 1.0.0, 1.0.1, 1.0.1, 1.0.1, 1.0.1, 1.0.1, 1.0.1, 1.0.1, 1.0.1, 1.0.1, 1.0.1.post2, 1.0.1.post2, 1.0.1.post2, 1.0.1.post2, 1.0.1.post2, 1.0.1.post2, 1.0.1.post2, 1.0.1.post2, 1.0.1.post2, 1.1.0, 1.1.0, 1.1.0, 1.1.0, 1.1.0, 1.1.0, 1.1.0, 1.1.0, 1.1.0, 1.1.0.post2, 1.1.0.post2, 1.1.0.post2, 1.1.0.post2, 1.2.0, 1.2.0, 1.2.0, 1.2.0, 1.2.0, 1.2.0, 1.2.0, 1.2.0, 1.2.0, 1.3.0, 1.3.0, 1.3.0, 1.3.0, 1.3.0, 1.3.0, 1.3.0, 1.3.0, 1.3.0.post2, 1.3.0.post2, 1.3.0.post2, 1.3.0.post2, 1.3.1, 1.3.1, 1.3.1, 1.3.1, 1.3.1, 1.3.1, 1.3.1, 1.3.1, 1.3.1, 1.4.0, 1.4.0, 1.4.0, 1.4.0, 1.4.0, 1.4.0, 1.4.0, 1.4.0, 1.4.0, 1.4.0, 1.4.0
[pipenv.exceptions.ResolutionFailure]: Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
  First try clearing your dependency cache with $ pipenv lock --clear, then try the original command again.
 Alternatively, you can use $ pipenv install --skip-lock to bypass this mechanism, then run $ pipenv graph to inspect the situation.
  Hint: try $ pipenv lock --pre if it is a pre-release dependency.
ERROR: ERROR: Could not find a version that matches torch==1.3,==1.3.1
Tried: 0.1.2, 0.1.2.post1, 0.1.2.post2, 0.3.0.post4, 0.3.0.post4, 0.3.0.post4, 0.3.1, 0.3.1, 0.3.1, 0.3.1, 0.3.1, 0.3.1, 0.3.1, 0.4.0, 0.4.0, 0.4.0, 0.4.0, 0.4.0, 0.4.0, 0.4.0, 0.4.1, 0.4.1, 0.4.1, 0.4.1, 0.4.1, 0.4.1, 0.4.1, 0.4.1, 0.4.1, 0.4.1.post2, 1.0.0, 1.0.0, 1.0.0, 1.0.0, 1.0.0, 1.0.0, 1.0.0, 1.0.0, 1.0.0, 1.0.1, 1.0.1, 1.0.1, 1.0.1, 1.0.1, 1.0.1, 1.0.1, 1.0.1, 1.0.1, 1.0.1.post2, 1.0.1.post2, 1.0.1.post2, 1.0.1.post2, 1.0.1.post2, 1.0.1.post2, 1.0.1.post2, 1.0.1.post2, 1.0.1.post2, 1.1.0, 1.1.0, 1.1.0, 1.1.0, 1.1.0, 1.1.0, 1.1.0, 1.1.0, 1.1.0, 1.1.0.post2, 1.1.0.post2, 1.1.0.post2, 1.1.0.post2, 1.2.0, 1.2.0, 1.2.0, 1.2.0, 1.2.0, 1.2.0, 1.2.0, 1.2.0, 1.2.0, 1.3.0, 1.3.0, 1.3.0, 1.3.0, 1.3.0, 1.3.0, 1.3.0, 1.3.0, 1.3.0.post2, 1.3.0.post2, 1.3.0.post2, 1.3.0.post2, 1.3.1, 1.3.1, 1.3.1, 1.3.1, 1.3.1, 1.3.1, 1.3.1, 1.3.1, 1.3.1, 1.4.0, 1.4.0, 1.4.0, 1.4.0, 1.4.0, 1.4.0, 1.4.0, 1.4.0, 1.4.0, 1.4.0, 1.4.0
There are incompatible versions in the resolved dependencies.

When possible, provide the verbose output (--verbose), especially for locking and dependencies resolving issues.

Steps to replicate

From a clean environment, no Pipfile:

pipenv install torch==1.3 torchvision

I should also mention that I tried the following commands, with no results:

pipenv-resolver --clean
pipenv-resolver --clean torch
pipenv-resolver --clean torchvision

Please run $ pipenv --support, and paste the results here. Don't put backticks (`) around it! The output already contains Markdown formatting.

$ pipenv --support

Pipenv version: '2018.11.26'

Pipenv location: '/Users/andrea/.bin/miniconda3/lib/python3.6/site-packages/pipenv'

Python location: '/Users/andrea/.bin/miniconda3/bin/python'

Python installations found:

  • 3.7.6: /usr/local/bin/python3
  • 3.7.6: /usr/local/bin/python3.7m
  • 3.7.2: /Users/andrea/.pyenv/versions/3.7.2/bin/python
  • 3.7.2: /Users/andrea/.pyenv/versions/3.7.2/bin/python3.7m
  • 3.6.10: /Users/andrea/.bin/miniconda3/bin/python
  • 3.6.8: /Users/andrea/.pyenv/versions/3.6.8/bin/python
  • 3.6.8: /Users/andrea/.pyenv/versions/3.6.8/bin/python3.6m
  • 2.7.10: /usr/bin/python
  • 2.7.10: /usr/bin/python2.7
  • 2.7.10: /usr/bin/pythonw
  • 2.6.9: /usr/bin/python2.6

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.6.10',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '16.7.0',
 'platform_system': 'Darwin',
 'platform_version': 'Darwin Kernel Version 16.7.0: Sun Jun  2 20:26:31 PDT '
                     '2019; root:xnu-3789.73.50~1/RELEASE_X86_64',
 'python_full_version': '3.6.10',
 'python_version': '3.6',
 'sys_platform': 'darwin'}

System environment variables:

  • TERM_PROGRAM
  • NVM_CD_FLAGS
  • TERM
  • SHELL
  • TMPDIR
  • Apple_PubSub_Socket_Render
  • TERM_PROGRAM_VERSION
  • OLDPWD
  • TERM_SESSION_ID
  • NVM_DIR
  • USER
  • SSH_AUTH_SOCK
  • __CF_USER_TEXT_ENCODING
  • PATH
  • PWD
  • EDITOR
  • LANG
  • XPC_FLAGS
  • HISTCONTROL
  • XPC_SERVICE_NAME
  • PYENV_SHELL
  • HOME
  • SHLVL
  • LOGNAME
  • NVM_BIN
  • SECURITYSESSIONID
  • _
  • 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: /Users/andrea/.poetry/bin:/usr/local/opt/gnu-getopt/bin:/Users/andrea/.nvm/versions/node/v10.1.0/bin:/Users/andrea/.pyenv/shims:/Users/andrea/.bin:/Users/andrea/.mynim/bin:/Users/andrea/.nimble/bin:/Users/andrea/.bin/miniconda3/bin:/Applications/CoqIDE_8.9.0.app/Contents/Resources/bin:/Users/andrea/.bin/flutter/bin:/Users/andrea/Applications/factor:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin
  • SHELL: /bin/bash
  • EDITOR: nano
  • LANG: it_IT.UTF-8
  • PWD: /Users/andrea/esperimenti/test

Contents of Pipfile ('/Users/andrea/esperimenti/test/Pipfile'):

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

[dev-packages]

[packages]
torch = "==1.3"
torchvision = "==0.4.2"

[requires]
python_version = "3.6"

Contents of Pipfile.lock ('/Users/andrea/esperimenti/test/Pipfile.lock'):

{
    "_meta": {
        "hash": {
            "sha256": "7f319d4e25c6f6cbdc321e10e0a71cad160a92e8ffb6e4b8d9a11bb5257d45ef"
        },
        "pipfile-spec": 6,
        "requires": {
            "python_version": "3.6"
        },
        "sources": [
            {
                "name": "pypi",
                "url": "https://pypi.org/simple",
                "verify_ssl": true
            }
        ]
    },
    "default": {
        "numpy": {
            "hashes": [
                "sha256:1598a6de323508cfeed6b7cd6c4efb43324f4692e20d1f76e1feec7f59013448",
                "sha256:1b0ece94018ae21163d1f651b527156e1f03943b986188dd81bc7e066eae9d1c",
                "sha256:2e40be731ad618cb4974d5ba60d373cdf4f1b8dcbf1dcf4d9dff5e212baf69c5",
                "sha256:4ba59db1fcc27ea31368af524dcf874d9277f21fd2e1f7f1e2e0c75ee61419ed",
                "sha256:59ca9c6592da581a03d42cc4e270732552243dc45e87248aa8d636d53812f6a5",
                "sha256:5e0feb76849ca3e83dd396254e47c7dba65b3fa9ed3df67c2556293ae3e16de3",
                "sha256:6d205249a0293e62bbb3898c4c2e1ff8a22f98375a34775a259a0523111a8f6c",
                "sha256:6fcc5a3990e269f86d388f165a089259893851437b904f422d301cdce4ff25c8",
                "sha256:82847f2765835c8e5308f136bc34018d09b49037ec23ecc42b246424c767056b",
                "sha256:87902e5c03355335fc5992a74ba0247a70d937f326d852fc613b7f53516c0963",
                "sha256:9ab21d1cb156a620d3999dd92f7d1c86824c622873841d6b080ca5495fa10fef",
                "sha256:a1baa1dc8ecd88fb2d2a651671a84b9938461e8a8eed13e2f0a812a94084d1fa",
                "sha256:a244f7af80dacf21054386539699ce29bcc64796ed9850c99a34b41305630286",
                "sha256:a35af656a7ba1d3decdd4fae5322b87277de8ac98b7d9da657d9e212ece76a61",
                "sha256:b1fe1a6f3a6f355f6c29789b5927f8bd4f134a4bd9a781099a7c4f66af8850f5",
                "sha256:b5ad0adb51b2dee7d0ee75a69e9871e2ddfb061c73ea8bc439376298141f77f5",
                "sha256:ba3c7a2814ec8a176bb71f91478293d633c08582119e713a0c5351c0f77698da",
                "sha256:cd77d58fb2acf57c1d1ee2835567cd70e6f1835e32090538f17f8a3a99e5e34b",
                "sha256:cdb3a70285e8220875e4d2bc394e49b4988bdb1298ffa4e0bd81b2f613be397c",
                "sha256:deb529c40c3f1e38d53d5ae6cd077c21f1d49e13afc7936f7f868455e16b64a0",
                "sha256:e7894793e6e8540dbeac77c87b489e331947813511108ae097f1715c018b8f3d"
            ],
            "version": "==1.18.2"
        },
        "torch": {
            "hashes": [
                "sha256:2d07d9db5cf43d152c17caf13428c10ab8c8fbf9c3bd503cfc46222cbfd1bb1c",
                "sha256:3b3ef18d03d8bc2ffccef1b3d2a156aa6f3235ed76d1c93cf3711c48055c79ce",
                "sha256:7499fbc00ebbb04b6a6cc77ba7055b3b93460da87139dd8aeb357c5446a44cf8",
                "sha256:93e3542d57d413d4bbd75f34ce06b7a2840da3a258e3ce20c751b31a6c24189f",
                "sha256:aec5245b459427bd4acea092bacbd6794bebaf65488caf931833a76cfbf9c5fa",
                "sha256:b33884ff0ca101ea6a3415e946b85f98253ee32401c6d863cc5fc6d5bb02d81c",
                "sha256:d460039d0d6c9e3e70b76bf9594c4ac364a287f125d22e10a6e9e1198887422c",
                "sha256:edf07e00bb7271406cec50630d7e17f89221eeea9bd6abab885f710d31758691"
            ],
            "index": "pypi",
            "version": "==1.3"
        }
    },
    "develop": {}
}
@techalchemy techalchemy added the Type: Question ❔ This is a question or a request for support. label May 20, 2020
@techalchemy
Copy link
Member

Thanks for the report and sorry you ran into this!

Using the master branch of pipenv, I'm able to reproduce the issue, but it doesn't appear to be a problem in pipenv.

torchvision==0.4.2 depends on torch==1.3.1 -- that is, exactly torch==1.3.1, so if you pin torch==1.3, that's the same as saying torch==1.3.0, which will always conflict with torch==1.3.1, a requirement of your other dependency.

The best thing to do here is to completely remove torch from your Pipfile, because the correct version will get resolved and installed just by having torchvision specified already.

Hope that helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Question ❔ This is a question or a request for support.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants