V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
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
mutoudaren
V2EX  ›  Python

Python 跨平台和设备 模块管理有什么好方法吗?

  •  1
     
  •   mutoudaren · Oct 15, 2020 · 3313 views
    This topic created in 2019 days ago, the information mentioned may be changed or developed.

    题主现在家,办公室,vps 三个地点使用 python 工作,操作系统有 win 和 linux,使用 conda,但是每次在一个地点新安装了库,在另外一个地点就要重新安装,有什么一劳永逸的方法吗。

    13 replies    2020-10-19 17:10:45 +08:00
    Suthree
        1
    Suthree  
       Oct 15, 2020
    docker
    wangyzj
        2
    wangyzj  
       Oct 15, 2020
    远程桌面
    哦,我突然想到了:无影
    leishi1313
        3
    leishi1313  
       Oct 15, 2020 via Android
    code-server
    cealiu
        4
    cealiu  
       Oct 15, 2020
    pycharm 可以配置使用远程服务器 python 解释器,有服务器的话配置一下
    mutoudaren
        5
    mutoudaren  
    OP
       Oct 15, 2020
    远程的话,就用不了本地的资源了,docker 试一下。
    zsdostar
        6
    zsdostar  
       Oct 15, 2020
    yucongo
        7
    yucongo  
       Oct 15, 2020   ❤️ 1
    或许可以用 poetry 管理包,平台之间用 usb 或 rsync 或云同步 poetry 里的 pyproject.toml 。

    其实基本思想和用 github 的 repo 一样。不过用 setup.py 增加包时要人工管理包(更新 setup.py 里的 install_requires 或 requiements.txt ),用 poetry 增加包时自动更新 pyproject.toml 。
    wuwukai007
        8
    wuwukai007  
       Oct 15, 2020 via Android
    这跟 docker 没关系吧,开发环境同步的问题,
    linvaux
        9
    linvaux  
       Oct 15, 2020 via iPhone
    写个脚本,同步完代码之后,自动安装依赖
    renmu123
        10
    renmu123  
       Oct 15, 2020 via Android
    推荐用 poetry 管理,再也不用每次安装完包手动 freeze 了,问就是真香
    zachlhb
        11
    zachlhb  
       Oct 15, 2020 via Android
    放 requirements 文件里,一行命令安装的事也没多复杂吧
    mutoudaren
        13
    mutoudaren  
    OP
       Oct 19, 2020
    @no1xsyzy 谢谢
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   938 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 49ms · UTC 22:39 · PVG 06:39 · LAX 15:39 · JFK 18:39
    ♥ Do have faith in what you're doing.