Python可移植,Linux&视窗 [英] Python portable, linux & windows

查看:101
本文介绍了Python可移植,Linux&视窗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在家中使用linux,但在学校中我们使用Windows7.我想在我的usb上安装python,以便可以在Windows和linux上使用它(ubuntu 13.04).有没有一种方法可以在USB上安装python,以便win和linux计算机都可以使用它?我对python 2.7更加感兴趣.我在Linux机器上安装了Wine.可能并不理想,但是我可以使用便携式python并在wine下运行它吗?

I am using linux at home but at school we use windows 7. I want to have python installed on my usb to that I can use it for both windows and linux (ubuntu 13.04). Is there a way that I can install python on my usb so that both win and linux computers can use it? I am more interest in python 2.7. I have Wine installed on my linux machine. It might no be ideal but could I use portable python and run it under wine?

推荐答案

您可以安装两个python.从 http://continuum.io/网站下载适用于Linux和Windows的Anaconda.安装它们(在Win和Lin机器上),然后使用conda程序包管理器在USB上创建两个环境:

You can install two python's. Download Anaconda from http://continuum.io/ website for linux and windows. Install them (on win and lin machines) and then create two environments on your USB using the conda package manager:

# Windows
conda create -p E:\pywin python all other packages you want
# Linux
conda create -p /mnt/usb/pylin python all other packages you want

然后在Windows上使用pywin环境,在Linux上使用pylin.

Then use the pywin environment on windows and pylin on linux.

# Windows
D:\pywin\python.exe your_script.py
# Linux
/mnt/usb/pylin/bin/python your_script.py

使用conda,您将能够在两个环境中维护相同的程序包,从而在两个系统上都拥有所需的一切...

With conda you will be able to maintain the same packages in both environments so you'll have everything you need on both systems...

或者您可以将Anaconda直接安装到USB,但这将需要更多空间...

Or you can install the Anaconda directly to the USB, but that will require more space...

这篇关于Python可移植,Linux&视窗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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