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.3.tar.gz (9.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.3-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: yq_pystand_setup-0.1.3.tar.gz
  • Upload date:
  • Size: 9.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.3.tar.gz
Algorithm Hash digest
SHA256 e74bcb800353aec00da704a9d9def95fed47f56b1b31352c016ddb0eb5d06b23
MD5 97229fb88cef0c216c0b2ca07fa9f4a6
BLAKE2b-256 2296083e2d0a6410efad7b3a30f848772bb11b8e640f4497aaef82060138691a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yq_pystand_setup-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 cc2be33e77f62d1f181afff0bc5f789779bdc0c2647b602e49f5d3c107f7faea
MD5 ece21c0fd0f2110106248841ec1831bb
BLAKE2b-256 4fc42c16c51116ec76885375f5530cc0b5b7c1c71237bb33c8732ee64f5e6f0d

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