msvclib


Namemsvclib JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttps://github.com/qy527145/msvclib
SummaryLightweight Microsoft Visual C++ build tools for Python
upload_time2025-08-15 14:32:59
maintainerNone
docs_urlNone
authorwmymz
requires_python>=3.6
licenseMIT
keywords msvc visual-studio build-tools compiler windows python
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # MSVCLib

[![PyPI version](https://badge.fury.io/py/msvclib.svg)](https://badge.fury.io/py/msvclib)
[![Python Support](https://img.shields.io/pypi/pyversions/msvclib.svg)](https://pypi.org/project/msvclib/)
[![License](https://img.shields.io/pypi/l/msvclib.svg)](https://github.com/yourusername/msvclib/blob/main/LICENSE)

[English](#english) | [中文](#中文)

---

## 中文

### 背景

在安装某些 Python 第三方包时,如果仓库中只有源码包且包含 C 语言代码,可能会遇到以下错误:

```
error: microsoft visual c++ 14.0 or greater is required. get it with "microsoft c++ build tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
```

按照提示安装完整的 Visual Studio 会占用至少 6GB 的磁盘空间,这对于仅需要编译工具的用户来说过于臃肿。

### 解决方案

MSVCLib 基于 [PortableBuildTools](https://github.com/Data-Oriented-House/PortableBuildTools) 项目,提供了一个轻量级的解决方案。它将必要的 Microsoft Visual C++ 构建工具打包成 Python wheel,可通过 pip 轻松安装。

### 安装

#### 使用 pip 安装

```bash
pip install msvclib
```

#### 推荐:全局安装或使用 uv

```bash
uv tool install msvclib
```

### 使用方法

当遇到 Microsoft Visual C++ 14.0 相关错误时,只需运行初始化命令:

```bash
msvcinit
```

初始化完成后,即可正常编译需要 C++ 构建工具的 Python 包。

### 优势

- **轻量级**:相比完整的 Visual Studio 安装,占用空间极小
- **便携性**:无需管理员权限,可在任何环境中使用
- **简单易用**:一条命令即可解决编译问题

---

## English

### Background

When installing certain Python third-party packages that contain only source code with C language components, you might encounter this error:

```
error: microsoft visual c++ 14.0 or greater is required. get it with "microsoft c++ build tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
```

Installing the full Visual Studio as suggested would consume at least 6GB of disk space, which is excessive for users who only need the build tools.

### Solution

MSVCLib is based on the [PortableBuildTools](https://github.com/Data-Oriented-House/PortableBuildTools) project and provides a lightweight solution. It packages the necessary Microsoft Visual C++ build tools into a Python wheel that can be easily installed via pip.

### Installation

#### Install with pip

```bash
pip install msvclib
```

#### Recommended: Global installation or using uv

```bash
uv tool install msvclib
```

### Usage

When encountering Microsoft Visual C++ 14.0 related errors, simply run the initialization command:

```bash
msvcinit
```

After initialization, you can compile Python packages that require C++ build tools without issues.

### Advantages

- **Lightweight**: Minimal disk space usage compared to full Visual Studio installation
- **Portable**: No administrator privileges required, works in any environment
- **Easy to use**: One command solves compilation issues

### Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

### License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

### Acknowledgments

- Based on [PortableBuildTools](https://github.com/Data-Oriented-House/PortableBuildTools)
- Thanks to all contributors who made this project possible

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/qy527145/msvclib",
    "name": "msvclib",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "wmymz <wmymz@icloud.com>",
    "keywords": "msvc, visual-studio, build-tools, compiler, windows, python",
    "author": "wmymz",
    "author_email": "wmymz <wmymz@icloud.com>",
    "download_url": "https://files.pythonhosted.org/packages/39/3f/e1b927b84065674c568413d9a44d94f7eff682664a9f682014be284bce08/msvclib-0.1.0.tar.gz",
    "platform": null,
    "description": "# MSVCLib\r\n\r\n[![PyPI version](https://badge.fury.io/py/msvclib.svg)](https://badge.fury.io/py/msvclib)\r\n[![Python Support](https://img.shields.io/pypi/pyversions/msvclib.svg)](https://pypi.org/project/msvclib/)\r\n[![License](https://img.shields.io/pypi/l/msvclib.svg)](https://github.com/yourusername/msvclib/blob/main/LICENSE)\r\n\r\n[English](#english) | [\u4e2d\u6587](#\u4e2d\u6587)\r\n\r\n---\r\n\r\n## \u4e2d\u6587\r\n\r\n### \u80cc\u666f\r\n\r\n\u5728\u5b89\u88c5\u67d0\u4e9b Python \u7b2c\u4e09\u65b9\u5305\u65f6\uff0c\u5982\u679c\u4ed3\u5e93\u4e2d\u53ea\u6709\u6e90\u7801\u5305\u4e14\u5305\u542b C \u8bed\u8a00\u4ee3\u7801\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u4ee5\u4e0b\u9519\u8bef\uff1a\r\n\r\n```\r\nerror: microsoft visual c++ 14.0 or greater is required. get it with \"microsoft c++ build tools\": https://visualstudio.microsoft.com/visual-cpp-build-tools/\r\n```\r\n\r\n\u6309\u7167\u63d0\u793a\u5b89\u88c5\u5b8c\u6574\u7684 Visual Studio \u4f1a\u5360\u7528\u81f3\u5c11 6GB \u7684\u78c1\u76d8\u7a7a\u95f4\uff0c\u8fd9\u5bf9\u4e8e\u4ec5\u9700\u8981\u7f16\u8bd1\u5de5\u5177\u7684\u7528\u6237\u6765\u8bf4\u8fc7\u4e8e\u81c3\u80bf\u3002\r\n\r\n### \u89e3\u51b3\u65b9\u6848\r\n\r\nMSVCLib \u57fa\u4e8e [PortableBuildTools](https://github.com/Data-Oriented-House/PortableBuildTools) \u9879\u76ee\uff0c\u63d0\u4f9b\u4e86\u4e00\u4e2a\u8f7b\u91cf\u7ea7\u7684\u89e3\u51b3\u65b9\u6848\u3002\u5b83\u5c06\u5fc5\u8981\u7684 Microsoft Visual C++ \u6784\u5efa\u5de5\u5177\u6253\u5305\u6210 Python wheel\uff0c\u53ef\u901a\u8fc7 pip \u8f7b\u677e\u5b89\u88c5\u3002\r\n\r\n### \u5b89\u88c5\r\n\r\n#### \u4f7f\u7528 pip \u5b89\u88c5\r\n\r\n```bash\r\npip install msvclib\r\n```\r\n\r\n#### \u63a8\u8350\uff1a\u5168\u5c40\u5b89\u88c5\u6216\u4f7f\u7528 uv\r\n\r\n```bash\r\nuv tool install msvclib\r\n```\r\n\r\n### \u4f7f\u7528\u65b9\u6cd5\r\n\r\n\u5f53\u9047\u5230 Microsoft Visual C++ 14.0 \u76f8\u5173\u9519\u8bef\u65f6\uff0c\u53ea\u9700\u8fd0\u884c\u521d\u59cb\u5316\u547d\u4ee4\uff1a\r\n\r\n```bash\r\nmsvcinit\r\n```\r\n\r\n\u521d\u59cb\u5316\u5b8c\u6210\u540e\uff0c\u5373\u53ef\u6b63\u5e38\u7f16\u8bd1\u9700\u8981 C++ \u6784\u5efa\u5de5\u5177\u7684 Python \u5305\u3002\r\n\r\n### \u4f18\u52bf\r\n\r\n- **\u8f7b\u91cf\u7ea7**\uff1a\u76f8\u6bd4\u5b8c\u6574\u7684 Visual Studio \u5b89\u88c5\uff0c\u5360\u7528\u7a7a\u95f4\u6781\u5c0f\r\n- **\u4fbf\u643a\u6027**\uff1a\u65e0\u9700\u7ba1\u7406\u5458\u6743\u9650\uff0c\u53ef\u5728\u4efb\u4f55\u73af\u5883\u4e2d\u4f7f\u7528\r\n- **\u7b80\u5355\u6613\u7528**\uff1a\u4e00\u6761\u547d\u4ee4\u5373\u53ef\u89e3\u51b3\u7f16\u8bd1\u95ee\u9898\r\n\r\n---\r\n\r\n## English\r\n\r\n### Background\r\n\r\nWhen installing certain Python third-party packages that contain only source code with C language components, you might encounter this error:\r\n\r\n```\r\nerror: microsoft visual c++ 14.0 or greater is required. get it with \"microsoft c++ build tools\": https://visualstudio.microsoft.com/visual-cpp-build-tools/\r\n```\r\n\r\nInstalling the full Visual Studio as suggested would consume at least 6GB of disk space, which is excessive for users who only need the build tools.\r\n\r\n### Solution\r\n\r\nMSVCLib is based on the [PortableBuildTools](https://github.com/Data-Oriented-House/PortableBuildTools) project and provides a lightweight solution. It packages the necessary Microsoft Visual C++ build tools into a Python wheel that can be easily installed via pip.\r\n\r\n### Installation\r\n\r\n#### Install with pip\r\n\r\n```bash\r\npip install msvclib\r\n```\r\n\r\n#### Recommended: Global installation or using uv\r\n\r\n```bash\r\nuv tool install msvclib\r\n```\r\n\r\n### Usage\r\n\r\nWhen encountering Microsoft Visual C++ 14.0 related errors, simply run the initialization command:\r\n\r\n```bash\r\nmsvcinit\r\n```\r\n\r\nAfter initialization, you can compile Python packages that require C++ build tools without issues.\r\n\r\n### Advantages\r\n\r\n- **Lightweight**: Minimal disk space usage compared to full Visual Studio installation\r\n- **Portable**: No administrator privileges required, works in any environment\r\n- **Easy to use**: One command solves compilation issues\r\n\r\n### Contributing\r\n\r\nContributions are welcome! Please feel free to submit a Pull Request.\r\n\r\n### License\r\n\r\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\r\n\r\n### Acknowledgments\r\n\r\n- Based on [PortableBuildTools](https://github.com/Data-Oriented-House/PortableBuildTools)\r\n- Thanks to all contributors who made this project possible\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Lightweight Microsoft Visual C++ build tools for Python",
    "version": "0.1.0",
    "project_urls": {
        "Documentation": "https://github.com/qy527145/msvclib#readme",
        "Homepage": "https://github.com/qy527145/msvclib",
        "Issues": "https://github.com/qy527145/msvclib/issues",
        "Repository": "https://github.com/qy527145/msvclib"
    },
    "split_keywords": [
        "msvc",
        " visual-studio",
        " build-tools",
        " compiler",
        " windows",
        " python"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "c1ce3d0d62998446da00b1351c8c72bf927c6faeeba419c2c48a1a65f4fc7ad4",
                "md5": "15f8bbdb8852553da253040e0d80f047",
                "sha256": "911fd903ee8958de205d903749a46740e3f399defd04fc357d991198aa46f613"
            },
            "downloads": -1,
            "filename": "msvclib-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "15f8bbdb8852553da253040e0d80f047",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 5407,
            "upload_time": "2025-08-15T14:32:57",
            "upload_time_iso_8601": "2025-08-15T14:32:57.788066Z",
            "url": "https://files.pythonhosted.org/packages/c1/ce/3d0d62998446da00b1351c8c72bf927c6faeeba419c2c48a1a65f4fc7ad4/msvclib-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "393fe1b927b84065674c568413d9a44d94f7eff682664a9f682014be284bce08",
                "md5": "57d2fdffaebd2fd0f4521b8b4642781b",
                "sha256": "36794806d88d9c5cedbb4150975a8f8f9fabd241c21dafc26dd8250517fe8847"
            },
            "downloads": -1,
            "filename": "msvclib-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "57d2fdffaebd2fd0f4521b8b4642781b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 5949,
            "upload_time": "2025-08-15T14:32:59",
            "upload_time_iso_8601": "2025-08-15T14:32:59.467373Z",
            "url": "https://files.pythonhosted.org/packages/39/3f/e1b927b84065674c568413d9a44d94f7eff682664a9f682014be284bce08/msvclib-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-15 14:32:59",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "qy527145",
    "github_project": "msvclib",
    "github_not_found": true,
    "lcname": "msvclib"
}
        
Elapsed time: 1.05516s