How to share a total python env with a remote host without Internet?

╄→尐↘猪︶ㄣ 提交于 2019-12-11 04:41:54

问题


I have a remote Linux host(I'm not superuser) which can only communicate with my local host via ssh shell.

  • my remote host has NO Internet, but has python3.6.5, conda4.5.4 installed.
  • my local host has Internet and can install packages and python through the Internet.

I need to run my python2.7 code on a remote host, but the python2.7 virtual environment and the related dependent packages are lacked.

I want to configure a py2.7 environment(my_py2env) and install all the needed dependencies on my localhost. And package all the needed file into a pack, such as tar.gz package. Send it to my remote host and unpack it. If I can use some conda commands such as conda --clone and this deploys all my environment(my_py2env) on the remote host. That will be perfect. Is that possible? How can I realize it?

Thank you very much!


回答1:


I think there may be you can use ssh command with options -R to map a local port to the remote host, and you can setup a http proxy on your local machine and listen on the mapped port.

Now you can install required package in a virtualenv via the http proxy you mapped.



来源:https://stackoverflow.com/questions/54039738/how-to-share-a-total-python-env-with-a-remote-host-without-internet

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