是否必须继续重新安装python模块(Eclipse Che)? [英] Have to keep reinstalling python modules (Eclipse Che)?

查看:62
本文介绍了是否必须继续重新安装python模块(Eclipse Che)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于我的Eclipse Che项目,每次加载工作区(blegh)时,都必须重新安装python模块.有没有一种方法可以将我的团队需要的模块安装到全局文件夹,这样他们甚至不需要在每次加载项目时都安装python模块?谢谢!

For my Eclipse Che project, I have to reinstall my python modules every time I load the workspace (blegh). Is there a way to install the modules my team needs to a global folder so they don't have to even install the python modules every time they want to load the project? Thank you!

推荐答案

或者,您可以基于Dockerfile配方从堆栈中构建工作区:

Alternatively you can build your workspace from a stack based on a Dockerfile recipe:

  1. 首先,记下您在其中执行的所有安装命令定制工作区时的Eclipse Che终端

  1. First, write down all your installation commands that you execute in Eclipse Che terminal when customising your workspace

接下来,根据您当前所在的文件创建一个新的Dockerfile.使用

Next, create a new Dockerfile based on the one you are currently using

2.1.从
查找当前工作空间所基于的Dockerfile食谱(例如,对于默认的Python堆栈,它将为这一个)

2.1. find the Dockerfile your current workspace is based on from
recipes (e.g. for default Python stack it would be this one)

2.2.通过添加以前的安装命令来修改该文件最后一行(EXPOSE 8080)之前的步骤是这样的:
RUN sudo -H pip安装烧瓶&&sudo -H pip安装熊猫等...

2.2. modify that file by adding your installation commands from previous step before the last line (EXPOSE 8080) like this:
RUN sudo -H pip install flask && sudo -H pip install pandas etc...

在Eclipse Che中,基于您的Dockerfile创建一个新的自定义堆栈

In Eclipse Che create a new custom stack based on your Dockerfile

3.1.单击左侧的堆栈(在工作区下方),然后单击添加堆栈"

3.1. Click Stacks on the left (below Workspaces) and click "Add Stack"

3.2.在从配方构建堆栈"对话框中,选择"Dockerfile"选项卡,然后将修改后的Dockerfile的内容粘贴到其中

3.2. In "Build stack from recipe" dialog select Dockerfile tab and paste there the content of your modified Dockerfile

3.3.单击确定=>将打开新页面,您可以在其中进一步自定义堆栈

3.3. Click OK => new page opens where you can further customise your stack

3.4.编辑名称和描述,然后单击新机器"以根据需要设置内存大小,然后单击保存"(右上角)

3.4. Edit the name and description, then click NEW-MACHINE to set the memory size as you like then click SAVE (right upper corner)

3.5.再次单击NEW-MACHINE以添加一些必要的代理:工作区API",终端",执行"和其他语言服务器您需要的(例如"Python语言服务器")

3.5. Click again NEW-MACHINE to add some essential Agents: "Workspace API", "Terminal", "Exec" and other language servers that you need (e.g. "Python language server")

3.6您可以通过添加环境var或服务器等来进一步自定义堆栈...

3.6 You can customise your stack further by adding environment vars or servers etc…

先保存,然后进行测试以测试您的堆栈

Hit SAVE and then TEST to test your stack

在打开的新对话框中,您可以指定要添加的默认项目,而不是单击测试工作区"

On the new dialog that opens you can specify some default project to be added than click "Test Workspace"

如果工作空间将成功构建,您将看到绿色的以下消息您的工作空间已准备就绪,可以使用了",堆栈将被添加到堆栈中.另外,您的新机器和终端将在下面打开

If workspace will build successfully your will see below message in green "Your workspace is ready to be used" and the stack will be added to the Stacks. Also your new-machine and Terminal will be opened below

现在关闭测试堆栈",转到工作区"或仪表板"并创建一个新的工作区

Now close "Testing Stack", go to Workspaces or Dashboard and create a new Workspace

您应该在堆栈下面看到新创建的堆栈,因此您现在可以选择它并基于该堆栈构建工作区

Your newly created stack should be visible there under stacks so you can select it now and build your workspace based on that

这篇关于是否必须继续重新安装python模块(Eclipse Che)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆