pdm-project / pdm-venv

A plugin for pdm that enables virtualenv management
https://pdm-project.github.io/pdm-venv
MIT License
24 stars 4 forks source link

CLI commands from other packages only work with `pdm run` #38

Open hoangthienan95 opened 2 years ago

hoangthienan95 commented 2 years ago

Describe the bug I thought that one of the benefits of pdm-venv was to not type pdm run [comand] every time. However, I could not invoke CLI commands from other packages without running pdm run, even when the environment is activated

(.venv) anhoang@c2b9 /lab/corradin_biobank/FOR_AN/test-project$ which python
/lab/corradin_biobank/FOR_AN/test-project/.venv/bin/python

(.venv) anhoang@c2b9 /lab/corradin_biobank/FOR_AN/test-project$ which pdm
/home/anhoang/.local/bin/pdm

(.venv) anhoang@c2b9 /lab/corradin_biobank/FOR_AN/test-project$ which jupyter
/lab/corradin_data/FOR_AN/anaconda3/envs/jupyterlab/bin/jupyter 
#should be /lab/corradin_biobank/FOR_AN/test-project/.venv/bin/jupyter

To Reproduce Steps to reproduce the behavior:

  1. Install pdm using curl -sSL https://raw.githubusercontent.com/pdm-project/pdm/main/install-pdm.py | python3 - into $HOME/.local/bin. Then pdm plugin add pdm-venv
  2. pdm config venv.in_project True; pdm config install.cache True
  3. Create a new project test-project
  4. pdm use 3.9; pdm venv create; pdm add nbdev, jupyter
  5. eval $(pdm venv activate in-project)
  6. Do either CLI commands from installed package: jupyter or nbdev_new
  7. pdm run jupyter and pdm run nbdev_new works as expected

System (please complete the following information):

frostming commented 2 years ago

Not sure if it does work well with conda. Try changing the backend to conda for venv creation.