Skip to main content

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

安装包

首先激活环境

打开 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)

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

yq_pystand_setup-0.1.4.tar.gz (1.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

yq_pystand_setup-0.1.4-py3-none-any.whl (1.9 MB view details)

Uploaded Python 3

File details

Details for the file yq_pystand_setup-0.1.4.tar.gz.

File metadata

  • Download URL: yq_pystand_setup-0.1.4.tar.gz
  • Upload date:
  • Size: 1.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for yq_pystand_setup-0.1.4.tar.gz
Algorithm Hash digest
SHA256 4e12168866495b806f17c306dc3bdeaba40aa7fa0be4916d5f42e1797a7e60f0
MD5 48c86837d103a694b8a5abd5284f8521
BLAKE2b-256 0945848dad6606e02386e05bcf66fd3f450fb56c8f8710e91decec6a4d421a6c

See more details on using hashes here.

File details

Details for the file yq_pystand_setup-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for yq_pystand_setup-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 33c55c3be0429d04682da0f00bc89b266b16f06d862403583c1f44535fde5056
MD5 2588f8c4fb821005117fa00f3a1e98bc
BLAKE2b-256 0df55413e7ea25385632d5aae3318efba2e7d6592cc8ad6442aef1a2fdfd8026

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page