简体   繁体   English

在没有sudo特权的情况下在远程计算机上运行python脚本

[英]Run a python script on a remote machine without sudo previlage

I have a python script called ergo.py on my local machine and I want to run it on a remote machine but I have a couple of issues: 我在本地计算机上有一个名为ergo.py的python脚本,我想在远程计算机上运行它,但是我有几个问题:

  1. The remote machine has python 2.x installed on it but my code is written in python 3.x 远程计算机上安装了python 2.x,但是我的代码是用python 3.x编写的

  2. The remote machine doesn't have python modules like numpy or matplotlib. 远端机器没有python模组,例如numpy或matplotlib。

  3. I only have ssh access to remote machine and I don't have sudo privilege or any root access 我只有SSH才能访问远程计算机,没有sudo特权或任何root用户访问权限

  4. I even don't have sudo privilege or any root access on my local machine but I have python 3.6.3 and anaconda packages installed on it which make me able to write my codes with Pycharm IDE. 我什至没有在本地计算机上的sudo特权或任何root访问权限,但是我安装了python 3.6.3和anaconda软件包,这使我能够使用Pycharm IDE编写代码。

The remote machine and my local system both have Linux Red hat 7.x operating systems. 远程机器和我的本地系统都具有Linux Red hat 7.x操作系统。

What is my best way to run my codes on the remote machine. 在远程计算机上运行代码的最佳方法是什么? I tried to freeze my code using pyinstaller, bbfreeze and cx_freeze but I didn't succeed, each time becasue of a specific error so I quitted this option. 我尝试使用pyinstaller,bbfreeze和cx_freeze冻结代码,但由于特定错误,每次都没有成功,所以我退出了此选项。

I found a very good solution on this website https://research.computing.yale.edu/support/hpc/user-guide/local-anaconda-installation 我在此网站上找到了一个很好的解决方案https://research.computing.yale.edu/support/hpc/user-guide/local-anaconda-installation

Just sweep the Anaconda version to the desired version in the instruction 只需将Anaconda版本扫至说明中的所需版本

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM