How to Copy/Clone a Virtual Environment from Server to Local Machine

倾然丶 夕夏残阳落幕 提交于 2019-12-17 15:29:07

问题


I have an existing Python django Project running in Web Server. Now the client needs to make some changes in the existing code. So I need to set it up in my Local Machine. All the packages needed for this project is installed in a Virtual environment. How can I copy or clone this virtual environment to my Local machine to run this Project.


回答1:


  1. Run pip freeze > requirements.txt on the remote machine
  2. Copy that requirements.txt file to your local machine
  3. In your local virtual environment, run pip install -r requirements.txt

And, so long as all of the requirements are well behaved Python packages, you should be good to go.




回答2:


Please using Freeze command and you will get text file with all the versions of packages. Then install them using easy install or pip install



来源:https://stackoverflow.com/questions/9207430/how-to-copy-clone-a-virtual-environment-from-server-to-local-machine

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!