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.5.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.5-py3-none-any.whl (1.9 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: yq_pystand_setup-0.1.5.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.5.tar.gz
Algorithm Hash digest
SHA256 a5e7828cdd42d9096346df0493a0fd0e0dedbc728f4e4f44761fa6e1d7de5b60
MD5 7189e8c871fb7d9aba76d9a920de1f50
BLAKE2b-256 82bbd05b78fce03315e1205b6f4b0234f35b5e56a8b8d261234279d50f920009

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yq_pystand_setup-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 7a4d00e61738eb9e187215415642e6d0813caf82264aedd1f8656bcbef9c221e
MD5 6da9dac0a82c9f31be63a2ea5582adae
BLAKE2b-256 ceb554f8522d5abd926202af748fd34939ded770ee89041e95e3c7c3a6b1662e

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