You are not logged in.

#1 2015-04-02 21:26:19

ghostjoad
Member
Registered: 2015-03-27
Posts: 10

Python reinstallation ?

Hello everyone,

my problem is the following : in my university, I am a tutor for practical sessions on Python for scientific computing. This is done in Python 2. For work, I also use a code that is written in Python 2. But when I write my own scripts and programs, I usually do it with the Python 3 syntax on my laptop running Arch. So I have to switch between the two versions.

So, on my install, I have a bunch of duplicated packages (ipython / ipython2, and so on...), and I wonder if it can raise some conflicts (first question here smile ).

My idea is to switch to virtual environments, where I would install the packages needed for Python 2 (for teaching and for compatibility with the code at work), and keep a "clean" Python 3 on my main system.

Do you think this is the right way to go ? If this is the case, can I safely remove the packages from python2 ? If not, is there a simple solution ?

Thanks a lot for your help on this matter smile I'd appreciate any advice on this, as I am not that familiar with virtual envs yet...

Offline

#2 2015-04-02 21:29:40

nullified
Member
From: Massachusetts, USA
Registered: 2013-12-09
Posts: 468

Re: Python reinstallation ?

I've had no problems with both 2 and 3 on my machine. Having a VM for one or another is not a bad idea but it's probably unnecessary.

Last edited by nullified (2015-04-02 21:30:11)


"We may say most aptly, that the Analytical Engine weaves algebraical patterns just as the Jacquard-loom weaves flowers and leaves." - Ada Lovelace

Offline

#3 2015-04-02 22:01:12

Scimmia
Fellow
Registered: 2012-09-01
Posts: 12,359

Re: Python reinstallation ?

Nothing wrong at all with having both installed. Unless you have something that screws with $PYTHONPATH, you should be fine.

Just remember to use the correct shebangs. http://legacy.python.org/dev/peps/pep-0394/

Last edited by Scimmia (2015-04-02 22:01:53)

Offline

#4 2015-04-03 09:22:33

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,587

Re: Python reinstallation ?

ghostjoad wrote:

My idea is to switch to virtual environments, where I would install the packages needed for Python 2 (for teaching and for compatibility with the code at work), and keep a "clean" Python 3 on my main system.

Do you think this is the right way to go ? If this is the case, can I safely remove the packages from python2 ? If not, is there a simple solution ?

What Scimmia said is correct, but if you would like to prevent your system from cluttering with unnecessary packages, virtualenvs are the way to go. Also, when you are teaching something, I believe you'll be installing new python packages every now and then, so even for that case a virtualenv would be a cleaner solution, in my opinion.

Offline

#5 2015-04-04 19:15:27

ghostjoad
Member
Registered: 2015-03-27
Posts: 10

Re: Python reinstallation ?

x33a wrote:

but if you would like to prevent your system from cluttering with unnecessary packages, virtualenvs are the way to go. Also, when you are teaching something, I believe you'll be installing new python packages every now and then, so even for that case a virtualenv would be a cleaner solution, in my opinion.

Yeah, I think I will follow this lead, to become more familiar with these environments. Though it is reassuring that the two can live together without raising troubles. Thanks for the insight !

Offline

Board footer

Powered by FluxBB