{"id":21026745,"url":"https://github.com/chaokunyang/py_install","last_synced_at":"2026-04-26T17:31:11.051Z","repository":{"id":113393059,"uuid":"142279332","full_name":"chaokunyang/py_install","owner":"chaokunyang","description":"Python Offline Install Tool And Guide","archived":false,"fork":false,"pushed_at":"2019-12-10T03:57:04.000Z","size":16,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-28T04:31:27.467Z","etag":null,"topics":["build","compile","install","offline","pip","python"],"latest_commit_sha":null,"homepage":"http://timeyang.com/articles/20/2018/07/25/Python%20%E7%A6%BB%E7%BA%BF%E5%AE%89%E8%A3%85%E6%8C%87%E5%8D%97","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chaokunyang.png","metadata":{"files":{"readme":"README-zh.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-25T09:38:02.000Z","updated_at":"2022-01-08T02:59:30.000Z","dependencies_parsed_at":"2023-03-13T13:19:47.916Z","dependency_job_id":null,"html_url":"https://github.com/chaokunyang/py_install","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chaokunyang/py_install","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaokunyang%2Fpy_install","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaokunyang%2Fpy_install/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaokunyang%2Fpy_install/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaokunyang%2Fpy_install/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chaokunyang","download_url":"https://codeload.github.com/chaokunyang/py_install/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaokunyang%2Fpy_install/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32307010,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T17:23:19.671Z","status":"ssl_error","status_checked_at":"2026-04-26T17:23:19.195Z","response_time":129,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["build","compile","install","offline","pip","python"],"created_at":"2024-11-19T11:46:04.681Z","updated_at":"2026-04-26T17:31:11.028Z","avatar_url":"https://github.com/chaokunyang.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Python 离线安装指南\n\nPython 是一门容易学习和强大的编程语言。 但是缺失离线自定义安装方式有时会成为问题。本项目提供基于Anaconda和编译Python两种方式解决该问题。\n\n## Anaconda\n\n- 下载 anaconda\n    ```bash\n    wget https://repo.anaconda.com/archive/Anaconda3-5.2.0-Linux-x86_64.sh\n    ```\n- 安装\n    Reference: https://conda.io/docs/user-guide/install/macos.html#install-macos-silent\n    ```bash\n    sh Anaconda3-5.2.0-Linux-x86_64.sh -b -p . -f\n    ```\n## 编译Python\n\n该发布不需要安装，不污染系统目录，比如`/usr/local/lib`. 如果你想要安装它，直接复制档案包到某个目录，解压皆可使用，如果你喜欢，也可以导出bin目录到环境变量。因此你可以在同一台机器上有任意多个`Python`安装，各个`Python`之间没有任何冲突，类似于`virtualenv`。如果需要卸载`Python`，直接删除安装目录即可(如果导出了PATH变量，需要从PATH变量移除该安装的bin路径)。\n\n该发布是通过编译`python`和依赖到同一个目录，然后在启动`python`时导出`LD_LIBRARY_PATH`，从而让`python`能够从相对的lib目录找到其依赖的动态库。本项目同时也展示了一种通过`pip`离线安装python lib及其依赖的方法。\n\n### 下载Python源码\n\npython3.6.6: https://www.python.org/ftp/python/3.6.6/Python-3.6.6.tgz\n\n### 下载Python依赖库源码\n\n* bzip2: http://www.bzip.org/1.0.6/bzip2-1.0.6.tar.gz\n* zlib: https://zlib.net/zlib-1.2.11.tar.gz\n* readline: ftp://ftp.cwru.edu/pub/bash/readline-6.3.tar.gz\n* openssl: https://www.openssl.org/source/openssl-1.0.2o.tar.gz\n* sqlite: https://www.sqlite.org/2018/sqlite-autoconf-3240000.tar.gz\n* ncurses: ftp://ftp.invisible-island.net/ncurses/ncurses-6.1.tar.gz\n* xz utils (lzma): https://excellmedia.dl.sourceforge.net/project/lzmautils/xz-5.2.4.tar.gz\n\n### 下载Python库wheel (可选)\n\n如果你想要离线安装python库及其依赖，参考下面步骤:\n\n* 创建`requirements.txt`文件, 加入类库依赖\n\n    `requirements.txt`示例:\n\n    ```text\n    Flask==0.12\n    requests\u003e=2.7.0\n    scikit-learn==0.19.1\n    numpy==1.14.3\n    pandas==0.22.0\n    ```\n\n* 在一台有网和已经安装Python的相同操作系统和CPU架构机器上，执行下面命令下载Python库机器依赖\n\n    ```bash\n    pip download -r requirements.txt -d wheelhouse\n    ```\n\n* 归档 `requirements.txt` 和 wheelhouse 到 `py_assembly.tar.gz`\n* 或者你可以在下载完python库及其依赖到wheelhouse目录后，使用下面命令安装python库及其依赖\n\n    ```bash\n    pip install -r requirements.txt --no-index --find-links wheelhouse\n    ```\n\n### 打包所有文件\n\n档案包应该有下面这些内容：\n\n* Python-3.6.6.tgz\n* bzip2-1.0.6.tar.gz\n* zlib-1.2.11.tar.gz\n* readline-6.3.tar.gz\n* openssl-1.0.2o.tar.gz\n* gdbm-1.16.tar.gz\n* sqlite-autoconf-3240000.tar.gz\n* ncurses-5.7.tar.gz\n* xz-5.2.4.tar.gz\n* py_assembly.tar.gz (optional)\n\n### 编译和安装本地库、Python、Python库\n\n构建 python\n\n```bash\n./py_install.sh build_python\n```\n\n安装 python 库 (可选)\n\n```bash\n./py_install.sh install_pylib\n```\n\n配置 `PATH` 环境变量\n\n```bash\necho \"\" \u003e\u003e ~/.bashrc\necho \"# Python\" \u003e\u003e ~/.bashrc\necho \"export PATH=`pwd`/python/bin:\\$PATH\" \u003e\u003e ~/.bashrc\nsource ~/.bashrc\n```\n\n或者一步完成所有这些工作\n\n```bash\n./py_install.sh\n```\n\n## Contribute\n\n* Issue Tracker: https://github.com/chaokunyang/py_install/issues\n* 如果这里有更好的方法，欢迎你告诉我\n\n## LICENSE\n\nThis project is licensed under Apache License 2.0.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchaokunyang%2Fpy_install","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchaokunyang%2Fpy_install","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchaokunyang%2Fpy_install/lists"}