Cannot install in docker
See original GitHub issue- 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
Use a docker file to install pdm and bring the project to production.
Docker file :
FROM archlinux
# Init package manager keyring
RUN pacman-key --init
# Update and basic development tools (gcc etc...)
RUN pacman -Syu --noconfirm --quiet
RUN pacman -S --noconfirm --quiet base-devel
# Create a project folder
RUN mkdir /python-nlu
WORKDIR /python-nlu
# Copy all project files (including pyproject.toml)
COPY . /python-nlu
RUN mkdir -p models/nlu
# Install the python dependency and python project
RUN pacman -S --noconfirm --quiet git
RUN pacman -S --noconfirm --quiet python-pip python-setuptools python-wheel
# Can also run pip install setuptools wheel instead
RUN pip install pdm
RUN pdm install # Crashes here (or any other pdm related command with the same error)
CMD ["pdm", "run", "server"]
Actual behavior
Getting a
Traceback (most recent call last):
File "/usr/sbin/pdm", line 5, in <module>
from pdm.core import main
File "/usr/lib/python3.9/site-packages/pdm/__init__.py", line 6, in <module>
from pdm.core import Core
File "/usr/lib/python3.9/site-packages/pdm/core.py", line 16, in <module>
from pdm.cli.actions import migrate_pyproject, print_pep582_command
File "/usr/lib/python3.9/site-packages/pdm/cli/actions.py", line 37, in <module>
from pdm.resolver import resolve
File "/usr/lib/python3.9/site-packages/pdm/resolver/__init__.py", line 1, in <module>
from pdm.resolver.core import resolve # noqa
File "/usr/lib/python3.9/site-packages/pdm/resolver/core.py", line 16, in <module>
_old_merge_into_criterion = Resolution._merge_into_criterion
AttributeError: type object 'Resolution' has no attribute '_merge_into_criterion'
Note that pdm install works locally on my machine (which is also on archlinux).
Expected behavior
Build the image without problems and run pdm in a container
Environment Information
Cannot run pdm info
or other pdm related command as it leads to the same error (shown above)
Note that I need the archlinux image as I’m also installing tools (like java, llvm10), etc… so I cannot use the official pdm image.
I suspect that the pip version was updated and pdm isn’t working with the new one maybe something like https://github.com/pypa/pip/issues/9188
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:5
Top Results From Across the Web
Unable to install docker on windows 10
I am trying to install docker on my window 10 pro but I get the below error. I have 64 bit machine with...
Read more >Docker Desktop requires Windows 10 Pro or Enterprise ...
I had an issue when installing Docker. Docker Desktop requires Windows 10 Pro or Enterprise version 15063 to run. I have tried to...
Read more >Windows Server 2016 Standard - cannot install docker
I ran "install-docker-ce.ps1" from powershell (administrator privilege)to install Docker CE on my server. But the Docker Engine Daemon cannot ...
Read more >How To Install Docker Desktop And Troubleshoot Issues In ...
Type and search Services in the windows search box or open run then type services.msc and click Ok. Then you will see a...
Read more >How to Install docker in Python? - Finxter
If it doesn't work, try "pip3 install docker" or “ python -m pip install docker “. Wait for the installation to terminate successfully....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It is because PDM is patching an internal class of
resolvelib
and is broken by the new release ofresolvelib
. A bugfix release will soon be out. As a workaround, you can pin the resolvelib version by:My bad, I copy-pasted the above comment with resolvlib 1.7.0 (I should’ve double-checked). I replaced it with 1.7.1
I did a fresh install by removing
__pypackages__
andpdm.lock
was it the “fresh” you intended ? I also have them in my .dockerignore so they’re not copied. Also did adocker system prune -a
It works except that I’m stuck in either an infinite dependency resolving loop or get the
AttributeError: 'JoinedStr' object has no attribute 's'
error from above.here is my dependency list if you want to try to reproduce (the only constrain is on torch):
Thanks again for your precious time ! Have a great day