Open qsuscs opened 1 year ago
Here, same issue:
% nix-shell -p nix-info --run "nix-info -m"
Python 3.11.1
- system: `"x86_64-linux"`
- host os: `Linux 5.15.93, NixOS, 23.05 (Stoat), 23.05.20230211.e5530ab`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.13.2`
- channels(root): `"home-manager, nixos"`
- nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
I also had this problem when I went back to venv
from PEP582.
It seems to be related to #66366.
The virtualenv
is included in the propagatedBuildInputs
but not in the site-packages
of the Python environment.
A possible workaround is to use venv.backend = venv
in the configuration of pdm, or give it an argument like pdm venv create -w venv
.
https://pdm.fming.dev/latest/reference/configuration/#available-configurations
It would be easier for the package to patch the configuration to default to venv
until the above issue is resolved.
cc @cpcloud @mweinelt @betaboon
Describe the bug
When running
pdm install
in a PDM-managed Python project, withpython.use_venv
on (which is its default), it fails to create a virtualenv. This is because it calls/nix/store/…-python3-…/bin/python3.… -m virtualenv
, which does not have the required paths insys.path
and hence fails to findvirtualenv
.Steps To Reproduce
Steps to reproduce the behavior:
git clone https://github.com/pdm-project/pdm-example-monorepo
cd pdm-example-monorepo
git checkout a6b3f47027730829105fae6524e4096d1ac180e4
pdm install
Expected behavior
PDM should be able to create a virtualenv.
~Screenshots~ Terminal log
Additional context
This is with pdm from nixpkgs-unstable (the version in 22.11 is too old for my project’s metadata format version), but I don’t think this is the cause for this bug. I wanted to make this clear by using the correct
nix-shell
command above for reproducing it, but failed at the correct incantation.Notify maintainers
@cpcloud
Metadata