uv: Can't use django binary that is located in the virtual environment
so I created a virtual environment, sourced it, and installed Django. the version that is installed globally is 4.2.10
but the version I installed in the virtual environment is the latest one 5.0.2
and this is what I want to share with you
(python-tests) ➜ python-tests uv pip install django
⠦ Resolving dependencies... Resolved 4 packages in 10.64s
Installed 4 packages in 812ms
+ asgiref==3.7.2
+ django==5.0.2
+ sqlparse==0.4.4
+ typing-extensions==4.10.0
(python-tests) ➜ python-tests django-admin --version
4.2.10
and when I typed django-admin startproject myproject .
it used django 4.2.10
not 5.0.2
this is uv version
uv --version
uv 0.1.11
What I think might be the problem is the way you are creating the virtual environment. as when I use pip
it uses the global pip not the one in the virtual environment.
What is think about the solution is to provide a way like uv exec some-command
like other tools that will use the binaries in the virtual environment, not the global ones.
And in the end, I am sorry that I can’t help to solve this problem as the only thing I know about rust is how to type Hello world
🙂
About this issue
- Original URL
- State: closed
- Created 4 months ago
- Comments: 17 (8 by maintainers)
I’m going to close this so we can keep the issue tracker actionable, thanks for all your investigation let us know if you find out more.
#1570 has more details on the default prompt value.