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

Installing package from github (git+ syntax) fails due to inconsistent internal identification #901

Closed
1 task done
classner opened this issue Feb 11, 2022 · 1 comment · Fixed by #902
Closed
1 task done
Labels
🐛 bug Something isn't working

Comments

@classner
Copy link

  • I have searched the issue tracker and believe that this is not a duplicate.

Make sure you run commands with -v flag before pasting the output.

Steps to reproduce

pdm add git+https://github.com/VLL-HD/FrEIA.git

Actual behavior

Adding the package fails:

# pdm add git+https://github.com/VLL-HD/FrEIA.git -v
Adding packages to default dependencies: :empty:Gcyksp9NCbw
======== Start resolving requirements ========
  click>=8.0.3
  coloredlogs>=15.0.1
  torch==1.10.1+cu113
  torchaudio==0.10.1+cu113
  hydra-core>=1.1.1
  pytorch-lightning>=1.5.7
  hydra-colorlog>=1.1.0
  kornia>=0.6.2
  pdbpp>=0.10.3
  ray[tune]>=1.9.2
  opencv-python>=4.5.5.62
  opencv-contrib-python>=4.5.5.62
  natsort>=8.0.2
  reportlab>=3.6.6
  imageio>=2.14.1
  git+https://github.com/VLL-HD/FrEIA.git
  python>=3.9
  Adding requirement click>=8.0.3
        Found matching candidates:
          <Candidate click 8.0.3 from https://pypi.org/simple/click/>
  Adding requirement coloredlogs>=15.0.1
        Found matching candidates:
          <Candidate coloredlogs 15.0.1 from https://pypi.org/simple/coloredlogs/>
  Adding requirement torch==1.10.1+cu113
        Found matching candidates:
          <Candidate torch 1.10.1+cu113 from https://download.pytorch.org/whl/cu113/torch_stable.html>
  Adding requirement torchaudio==0.10.1+cu113
        Found matching candidates:
          <Candidate torchaudio 0.10.1+cu113 from https://download.pytorch.org/whl/cu113/torch_stable.html>
  Adding requirement hydra-core>=1.1.1
        Found matching candidates:
          <Candidate hydra-core 1.1.1 from https://pypi.org/simple/hydra-core/>
  Adding requirement pytorch-lightning>=1.5.7
        Found matching candidates:
          <Candidate pytorch-lightning 1.5.10 from https://pypi.org/simple/pytorch-lightning/>
          <Candidate pytorch-lightning 1.5.9 from https://pypi.org/simple/pytorch-lightning/>
          <Candidate pytorch-lightning 1.5.8 from https://pypi.org/simple/pytorch-lightning/>
          <Candidate pytorch-lightning 1.5.7 from https://pypi.org/simple/pytorch-lightning/>
  Adding requirement hydra-colorlog>=1.1.0
        Found matching candidates:
          <Candidate hydra-colorlog 1.1.0 from https://pypi.org/simple/hydra-colorlog/>
  Adding requirement kornia>=0.6.2
        Found matching candidates:
          <Candidate kornia 0.6.3 from https://pypi.org/simple/kornia/>
          <Candidate kornia 0.6.2 from https://pypi.org/simple/kornia/>
  Adding requirement pdbpp>=0.10.3
        Found matching candidates:
          <Candidate pdbpp 0.10.3 from https://pypi.org/simple/pdbpp/>
  Adding requirement ray[tune]>=1.9.2
        Found matching candidates:
          <Candidate ray 1.10.0 from https://pypi.org/simple/ray/>
          <Candidate ray 1.9.2 from https://pypi.org/simple/ray/>
  Adding requirement opencv-python>=4.5.5.62
        Found matching candidates:
          <Candidate opencv-python 4.5.5.62 from https://pypi.org/simple/opencv-python/>
  Adding requirement opencv-contrib-python>=4.5.5.62
        Found matching candidates:
          <Candidate opencv-contrib-python 4.5.5.62 from https://pypi.org/simple/opencv-contrib-python/>
  Adding requirement natsort>=8.0.2
        Found matching candidates:
          <Candidate natsort 8.1.0 from https://pypi.org/simple/natsort/>
          <Candidate natsort 8.0.2 from https://pypi.org/simple/natsort/>
  Adding requirement reportlab>=3.6.6
        Found matching candidates:
          <Candidate reportlab 3.6.6 from https://pypi.org/simple/reportlab/>
  Adding requirement imageio>=2.14.1
        Found matching candidates:
          <Candidate imageio 2.15.0 from https://pypi.org/simple/imageio/>
          <Candidate imageio 2.14.1 from https://pypi.org/simple/imageio/>
  Adding requirement git+https://github.com/VLL-HD/FrEIA.git
Preparing isolated env for PEP 517 build...
Looking in links: https://download.pytorch.org/whl/cu113/torch_stable.html
Collecting wheel
  Using cached wheel-0.37.1-py2.py3-none-any.whl (35 kB)
Collecting setuptools>=40.8.0
  Using cached setuptools-60.8.2-py3-none-any.whl (1.1 MB)
Installing collected packages: wheel, setuptools
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
pdm 1.12.8 requires blinker, which is not installed.
pdm 1.12.8 requires click>=7, which is not installed.
pdm 1.12.8 requires installer~=0.3.0, which is not installed.
pdm 1.12.8 requires packaging, which is not installed.
pdm 1.12.8 requires pdm-pep517<0.11,>=0.9, which is not installed.
pdm 1.12.8 requires pep517>=0.11.0, which is not installed.
pdm 1.12.8 requires platformdirs, which is not installed.
pdm 1.12.8 requires python-dotenv>=0.15, which is not installed.
pdm 1.12.8 requires pythonfinder, which is not installed.
pdm 1.12.8 requires resolvelib<0.9,>=0.8, which is not installed.
pdm 1.12.8 requires shellingham>=1.3.2, which is not installed.
pdm 1.12.8 requires tomlkit<1,>=0.8.0, which is not installed.
Successfully installed setuptools-60.8.2 wheel-0.37.1
WARNING: You are using pip version 21.3.1; however, version 22.0.3 is available.
You should consider upgrading via the 'C:\Users\anonymous\.pyenv\pyenv-win\versions\3.9.0\python3.exe -m pip install --upgrade pip' command.
running egg_info
writing FrEIA.egg-info\PKG-INFO
writing dependency_links to FrEIA.egg-info\dependency_links.txt
writing requirements to FrEIA.egg-info\requires.txt
writing top-level names to FrEIA.egg-info\top_level.txt
reading manifest file 'FrEIA.egg-info\SOURCES.txt'
adding license file 'LICENSE'
running dist_info
writing C:\Users\anonymous\AppData\Local\Temp\pdm-meta-5izd02ah\FrEIA.egg-info\PKG-INFO
writing dependency_links to C:\Users\anonymous\AppData\Local\Temp\pdm-meta-5izd02ah\FrEIA.egg-info\dependency_links.txt
writing requirements to C:\Users\anonymous\AppData\Local\Temp\pdm-meta-5izd02ah\FrEIA.egg-info\requires.txt
writing top-level names to C:\Users\anonymous\AppData\Local\Temp\pdm-meta-5izd02ah\FrEIA.egg-info\top_level.txt
reading manifest file 'C:\Users\anonymous\AppData\Local\Temp\pdm-meta-5izd02ah\FrEIA.egg-info\SOURCES.txt'
adding license file 'LICENSE'
creating 'C:\Users\anonymous\AppData\Local\Temp\pdm-meta-5izd02ah\FrEIA.dist-info'
adding license file "LICENSE" (matched pattern "LICEN[CS]E*")
  Adding requirement python>=3.9
======== Starting round 0 ========
Resolving: new pin python >=3.9
======== Ending round 0 ========
======== Starting round 1 ========
  Adding requirement numpy>=1.15.0(from FrEIA 0.2)
        Found matching candidates:
          <Candidate numpy 1.22.2 from https://pypi.org/simple/numpy/>
          <Candidate numpy 1.22.1 from https://pypi.org/simple/numpy/>
          <Candidate numpy 1.22.0 from https://pypi.org/simple/numpy/>
          <Candidate numpy 1.21.1 from https://pypi.org/simple/numpy/>
          <Candidate numpy 1.21.0 from https://pypi.org/simple/numpy/>
          <Candidate numpy 1.20.3 from https://pypi.org/simple/numpy/>
          <Candidate numpy 1.20.2 from https://pypi.org/simple/numpy/>
          <Candidate numpy 1.20.1 from https://pypi.org/simple/numpy/>
          <Candidate numpy 1.20.0 from https://pypi.org/simple/numpy/>
          <Candidate numpy 1.19.5 from https://pypi.org/simple/numpy/>
          ... [923 more candidate(s)]
  Adding requirement scipy>=1.5(from FrEIA 0.2)
        Found matching candidates:
          <Candidate scipy 1.6.1 from https://pypi.org/simple/scipy/>
          <Candidate scipy 1.6.0 from https://pypi.org/simple/scipy/>
          <Candidate scipy 1.5.4 from https://pypi.org/simple/scipy/>
          <Candidate scipy 1.5.3 from https://pypi.org/simple/scipy/>
          <Candidate scipy 1.5.2 from https://pypi.org/simple/scipy/>
          <Candidate scipy 1.5.1 from https://pypi.org/simple/scipy/>
          <Candidate scipy 1.5.0 from https://pypi.org/simple/scipy/>
  Adding requirement torch>=1.0.0(from FrEIA 0.2)
        Found matching candidates:
          <Candidate torch 1.10.1+cu113 from https://download.pytorch.org/whl/cu113/torch_stable.html>
Resolving: new pin FrEIA 0.2
======== Ending round 1 ========
======== Starting round 2 ========
Traceback (most recent call last):
  File "C:\Users\anonymous\.pyenv\pyenv-win\versions\3.9.0\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\anonymous\.pyenv\pyenv-win\versions\3.9.0\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\anonymous\.pyenv\pyenv-win\versions\3.9.0\Scripts\pdm.exe\__main__.py", line 7, in <module>
  File "C:\Users\anonymous\.pyenv\pyenv-win\versions\3.9.0\lib\site-packages\pdm\core.py", line 226, in main
    return Core().main(args)
  File "C:\Users\anonymous\.pyenv\pyenv-win\versions\3.9.0\lib\site-packages\pdm\core.py", line 161, in main
    raise cast(Exception, err).with_traceback(traceback)
  File "C:\Users\anonymous\.pyenv\pyenv-win\versions\3.9.0\lib\site-packages\pdm\core.py", line 156, in main
    f(options.project, options)
  File "C:\Users\anonymous\.pyenv\pyenv-win\versions\3.9.0\lib\site-packages\pdm\cli\commands\add.py", line 53, in handle
    actions.do_add(
  File "C:\Users\anonymous\.pyenv\pyenv-win\versions\3.9.0\lib\site-packages\pdm\cli\actions.py", line 236, in do_add
    resolved = do_lock(project, strategy, tracked_names, reqs, dry_run=dry_run)
  File "C:\Users\anonymous\.pyenv\pyenv-win\versions\3.9.0\lib\site-packages\pdm\cli\actions.py", line 77, in do_lock
    mapping, dependencies = resolve(
  File "C:\Users\anonymous\.pyenv\pyenv-win\versions\3.9.0\lib\site-packages\pdm\resolver\core.py", line 31, in resolve
    result = resolver.resolve(requirements, max_rounds)
  File "C:\Users\anonymous\AppData\Roaming\Python\Python39\site-packages\resolvelib\resolvers.py", line 481, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
  File "C:\Users\anonymous\AppData\Roaming\Python\Python39\site-packages\resolvelib\resolvers.py", line 372, in resolve
    name = min(unsatisfied_names, key=self._get_preference)
  File "C:\Users\anonymous\AppData\Roaming\Python\Python39\site-packages\resolvelib\resolvers.py", line 177, in _get_preference
    return self._p.get_preference(
  File "C:\Users\anonymous\.pyenv\pyenv-win\versions\3.9.0\lib\site-packages\pdm\resolver\providers.py", line 83, in get_preference
    dep_depth = min(parent_depths) + 1
  File "C:\Users\anonymous\.pyenv\pyenv-win\versions\3.9.0\lib\site-packages\pdm\resolver\providers.py", line 80, in <genexpr>
    self._known_depth[parent.identify()] if parent is not None else 0
KeyError: 'freia'

Expected behavior

Adding the package succeeds.

Environment Information

# Paste the output of `pdm info && pdm info --env` below:
PDM version:        1.12.8
Python Interpreter: C:/Users/anonymous/.pyenv/pyenv-win/versions/3.9.0/python3.exe (3.9)
Project Root:       C:/Users/path/to/project
Project Packages:   C:\Users\anonymous\path\to\project\__pypackages__\3.9
{
  "implementation_name": "cpython",
  "implementation_version": "3.9.0",
  "os_name": "nt",
  "platform_machine": "AMD64",
  "platform_release": "10",
  "platform_system": "Windows",
  "platform_version": "10.0.19041",
  "python_full_version": "3.9.0",
  "platform_python_implementation": "CPython",
  "python_version": "3.9",
  "sys_platform": "win32"
}

Debugging

I started debugging this and found that pdm first identifies the package as :empty:... (as defined in requirements.py:136), but later somehow identifies the package actually as freia. Because of this inconsistency the depth is not correctly registered and the dictionary key lookup fails.

@classner classner added the 🐛 bug Something isn't working label Feb 11, 2022
@frostming
Copy link
Collaborator

Give the name to it in command: pdm add git+https://github.com/VLL-HD/FrEIA.git#egg=FrEIA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants