venv windows: Missing `venv/bin` folder, should symlink `venv/bin` -> `venv/Scripts`
还没有人认领这个 Issue。
- 主要语言
- Python
- 星标
- 77.2k
- 派生
- 36k
- PR 合并指标
- PR 指标待抓取
描述
Bug report
Entering into a venv environment on Windows doesn't work well.
The command to enter into a virtual environment on Linux and MacOS looks like this:
source venv/bin/activate.sh
On Windows however, there is no venv/bin but instead venv/Scripts, which appears to be a similar / same folder to venv/bin. Therefore on windows (git-bash) source venv/bin/activate.sh does not work
As a workaround in my projects, I simply create a symlink using the windows junction point feature (mkdir /j) so that symlink venv/bin points to venv/Scripts and then everything seems to work right.
Windows gained non-admin symlinking in 2019
The fix for this problem only became available in 2019 since mkdir /j was added or enabled for windows directory symlinks. Prior to this, a windows host needed to have admin privilege's or a registry hack in order to symlink a folder.
Your environment
- Windows 10, in
git-bash - python 3.10.7
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先定位负责创建 Windows 环境的 Python venv 实现,然后将其 Scripts 布局与 Linux 和 macOS 上使用的 bin 布局进行比较。从 Windows 上的 Git Bash 验证提议的行为,并确认通过 venv/bin 激活能够正常工作,且不会破坏现有的 Windows 用法。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- tooling
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100