gpt4 book ai didi

python - 我可以在不同的计算机上使用相同的虚拟环境吗

转载 作者:太空狗 更新时间:2023-10-30 00:02:06 25 4
gpt4 key购买 nike

在我办公室的电脑上,我在 Dropbox 文件夹中创建了 virtualenv one-for-rule-them-all。我想在工作和家里都使用这个环境。这可能吗? (目前我没有成功)

最佳答案

考虑使用 virtualenv 的 relocatable 选项。有关完整文档,请参阅 virtualenv documentation on the subject .

一个感兴趣的笔记:

Also, this does not make your packages cross-platform. You can move the directory around, but it can only be used on other similar computers. Some known environmental differences that can cause incompatibilities: a different version of Python, when one platform uses UCS2 for its internal unicode representation and another uses UCS4 (a compile-time option), obvious platform changes like Windows vs. Linux, or Intel vs. ARM, and if you have libraries that bind to C libraries on the system, if those C libraries are located somewhere different (either different versions, or a different filesystem layout).

作为这种方法的替代方法,我将使用 setup.py 要求(install_requiressetup_requires)或 pip requirements.txt 文件简单地管理您的项目/设置依赖项.这更加便携和跨平台。

关于python - 我可以在不同的计算机上使用相同的虚拟环境吗,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35672427/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com