Setup PyStand
Project description
yq-pystand-setup
python 脚本工具
自动创建一个使用 PyStand 的项目
它会在 PyStand 的基础上,自动安装 pip 。
安装
pip install yq-pystand-setup
使用
创建项目
py -m yq-pystand-setup [Project Name]
已有项目初始化
py -m yq-pystand-setup --init /path/to/project
安装包
首先激活环境
Activate in cmd
call runtime\Scripts\activate.cmd
Activate in Powershell
. runtime\Scripts\activate.ps1
激活之后 python pip 都会指向项目使用的,如下所示
$ Get-Command python | Format-List -Property path
Path : D:\path\to\your\project\runtime\python.exe
$ Get-Command pip | Format-List -Property Path
Path : D:\path\to\your\project\pip_wrapper\bin\pip.exe
然后正常使用 pip 安装,例如
pip install flask
PyCharm 配置
手动将项目下的 runtime/Lib/site-packages 标记为 Sources Root ,不然识别不了你安装在这里的包
解析器直接选择 runtime/python.exe
因为我们放了一些 activate 开头的空文件在 runtime , PyCharm 会将它识别为当前项目的 virtualenv
参考
Portable Python Bundles on Windows
实现
- 在当前目录下创建项目文件夹
- 安装 PyStand (PyStand-py38-x64.7z)
- 安装 pip
- 其他设置(放一些空文件,让 PyCharm 认为这是一个 vritualenv)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file yq_pystand_setup-0.1.0.tar.gz.
File metadata
- Download URL: yq_pystand_setup-0.1.0.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1ab7d5dd659ba3d743a308af4bae6be067492ba941800b757b564416ff9ded6
|
|
| MD5 |
6fb478ba95b3a2e6727a0ab40b158ccd
|
|
| BLAKE2b-256 |
b96257486a478757dd07302f048e2ec6fbdfc3e9ad63249142de3031256f216e
|
File details
Details for the file yq_pystand_setup-0.1.0-py3-none-any.whl.
File metadata
- Download URL: yq_pystand_setup-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8eaf5f3ed514df1b1b8c86cfb317a6b3792e0313079a662418e1f343cca38a7f
|
|
| MD5 |
2cdcf4775ea6118b5198993ad5fe1a32
|
|
| BLAKE2b-256 |
8c4580531f062066b7d875cd18524ef9ed9055be061ec8d87fef7ee3e22a181a
|