Skip to main content

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

安装包

首先激活环境

打开 powershell ,进入项目目录,执行

. runtime\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\runtime\pip.exe

然后正常使用 pip 安装,例如

pip install flask

PyCharm 配置

手动将项目下的 runtime/Lib/site-packages 标记为 Sources Root ,不然识别不了你安装在这里的包

解析器直接选择 runtime/python.exe

因为我们放了一些 activate 开头的空文件在 runtime , PyCharm 会将它识别为当前项目的 virtualenv

参考

PyStand

Portable Python Bundles on Windows

Activate.ps1

IDEA isVritualEnv

实现

  1. 在当前目录下创建项目文件夹
  2. 安装 PyStand (PyStand-py38-x64)
  3. 安装 pip
  4. 其他设置(放一些空文件,让 PyCharm 认为这是一个 vritualenv)

Metadata

Release files for yq-pystand-setup 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for yq-pystand-setup 0.1.5
File Size Uploaded Provenance
yq_pystand_setup-0.1.5.tar.gz 1.9 MB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for yq-pystand-setup 0.1.5
File Interpreter ABI Platform
yq_pystand_setup-0.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 3.7 MB

Release files / yq_pystand_setup-0.1.5.tar.gz

Download URL yq_pystand_setup-0.1.5.tar.gz
Size 1.9 MB
Tags Source
SHA-256 checksum
How to use checksums
a5e7828cdd42d9096346df0493a0fd0e0dedbc728f4e4f44761fa6e1d7de5b60
BLAKE2b-256 checksum
How to use checksums
82bbd05b78fce03315e1205b6f4b0234f35b5e56a8b8d261234279d50f920009
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / yq_pystand_setup-0.1.5-py3-none-any.whl

Download URL yq_pystand_setup-0.1.5-py3-none-any.whl
Size 1.9 MB
Tags Python 3
SHA-256 checksum
How to use checksums
7a4d00e61738eb9e187215415642e6d0813caf82264aedd1f8656bcbef9c221e
BLAKE2b-256 checksum
How to use checksums
ceb554f8522d5abd926202af748fd34939ded770ee89041e95e3c7c3a6b1662e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Security for yq-pystand-setup 0.1.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page