推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
busuzhike
V2EX  ›  Python

Python 安装库,有办法完全自己手搓吗?就是不用 pip 什么的

  •  
  •   busuzhike · Dec 11, 2024 · 5378 views
    This topic created in 541 days ago, the information mentioned may be changed or developed.

    无正文

    16 replies    2024-12-20 08:39:47 +08:00
    dajj
        1
    dajj  
       Dec 11, 2024
    pip 应该也是支持本地文件的
    Shorekeeper
        2
    Shorekeeper  
       Dec 11, 2024
    在不需要考虑依赖关系和 build wheel 的前提下,解压到 site-packages 文件夹。
    ho121
        3
    ho121  
       Dec 11, 2024 via Android   ❤️ 2
    您要找得是不是:PYTHONPATH
    ysc3839
        4
    ysc3839  
       Dec 11, 2024 via Android
    setup.py ?不过这个也是依赖别的库的,不完全算是手搓。
    customsshen
        5
    customsshen  
       Dec 11, 2024
    依赖是一切 install 的绊脚石,除非你能手搓依赖
    lpf0309
        6
    lpf0309  
       Dec 11, 2024
    pip install xxx.whl?
    duanxianze
        7
    duanxianze  
       Dec 11, 2024
    意思是像 c++那样手动下载源码手动引入?可以的吧
    haoyunyinglai
        8
    haoyunyinglai  
       Dec 11, 2024
    下载源码 tar 包,然后 python setup.py install ?
    Hilalum
        9
    Hilalum  
       Dec 11, 2024
    pip install ***.tar.gz
    fredsunme
        10
    fredsunme  
       Dec 11, 2024
    你是不是在找 python venv 环境迁移?
    tomczhen
        11
    tomczhen  
       Dec 11, 2024
    xy 问题
    busuzhike
        12
    busuzhike  
    OP
       Dec 11, 2024
    @ysc3839 这个似乎是正解。

    另外,复各位,不能用 pip ,情况是这样的,本机有高版本的 py 了,但有一个软件内置了低版本的 py 而且没有 pip ,要做的是给低版本 py 安装库。
    houzhiqiang
        13
    houzhiqiang  
       Dec 12, 2024
    python get-pip.py 或者安装一个其他的工具?比如 pdm ?

    https://pip.pypa.io/en/stable/installation/
    iorilu
        14
    iorilu  
       Dec 13, 2024
    python 原生库都是 zip 包, 解包复制到 site-packages 不就行了

    除非是某些需要本地 c 库编译啥的, 那要编译好才复制
    frostming
        15
    frostming  
       Dec 19, 2024
    有啊,这个 README 里列出了关键组件,你看着自己组装一下:

    https://github.com/frostming/unearth#why-this-project
    busuzhike
        16
    busuzhike  
    OP
       Dec 20, 2024
    @frostming @houzhiqiang 感谢,我去了解一下。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1078 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 53ms · UTC 23:21 · PVG 07:21 · LAX 16:21 · JFK 19:21
    ♥ Do have faith in what you're doing.