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

安装包

首先激活环境

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

参考

PyStand

Portable Python Bundles on Windows

实现

  1. 在当前目录下创建项目文件夹
  2. 安装 PyStand (PyStand-py38-x64.7z)
  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.1.tar.gz (5.4 kB 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.1-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: yq_pystand_setup-0.1.1.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

Hashes for yq_pystand_setup-0.1.1.tar.gz
Algorithm Hash digest
SHA256 2479fb862074754cacd9ad39775be504a8141620e899b74623ff68de845a1bdb
MD5 bdfbb8456da135b6360539fc8fa1600d
BLAKE2b-256 606844d286d4c2c9d36332297ba73a5c362d11b6b7e3da261f1064b704b64382

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yq_pystand_setup-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dd3a41d4d15c7cf271e4821bb6288dbb7aacf9f0aac4c61020cd77e4f44cf009
MD5 2e8d4188fc0742b1e903387947bdd26a
BLAKE2b-256 6ccea41b80142429dc2f8d3c3602397207e7067cad53a3585dea2bf08a6bfd4b

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