英文:
how can I duplicate venv environment without requirements.txt?
问题
我想复制我的环境。由于个人原因,我不能使用conda或其他工具。我也不想使用requirements.txt,因为它太花时间。
我该如何解决这个问题?
我只是复制并粘贴了原始环境文件夹:myvenv1 到 myvenv2
但如果我激活myvenv2,它会显示myvenv1的名称,就像这样。
root: > source ./myvenv2/bin/activate
(myvenv1) root: >
英文:
I want to duplicate my environment. I cannot use conda or other tools in personal reason. I also don't want to use requirements.txt because it takes too long time.
How can I solve this problem?
I just copied and pasted original environment folder: myvenv1 to myvenv2
But if I activate myvenv2, it shows myvenv1's name, like this.
root: > source ./myvenv2/bin/activate
(myvenv1) root: >
答案1
得分: 0
使用requirements.txt
可能是最快且最安全的解决方案。
否则,我不100%确定,但是...如果你复制了一个虚拟环境,我认为你需要编辑一些文件的内容。例如,activate
脚本将负责设置提示符。但请注意,虚拟环境不是设计用于复制、重命名或移动的。如果不小心操作,会导致问题。
英文:
Using requirements.txt
is probably the fastest and safest solution.
Otherwise, I am not 100% sure but... if you copy a virtual environment, then I think that you need to edit the content of some files. For example the activate
script which will be in charge of setting the prompt. But note that virtual environments are not designed to be copied, renamed or moved around. Things will break if you are not careful.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论