You are not logged in.

#1 2010-08-07 15:49:41

whitetimer
Member
Registered: 2010-05-23
Posts: 207

New To Archlinux - Setting up Python 3

Hi All

Well i am new to Archlinux and have installed it as a Guest in VirtualBox so i can have a play around, before i decide to use it on my new Netbook (when it comes)  .... Anyway i have just downloaded Python 3 and i want to set the PythonPath so what is the best way to do so ?

Many Thanks

Last edited by whitetimer (2010-08-07 16:36:43)

Offline

#2 2010-08-07 15:58:26

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: New To Archlinux - Setting up Python 3

I have no idea how to help you, but I'd recommend adding a '3' at the end of the topic's title.

Offline

#3 2010-08-07 16:06:31

cesura
Package Maintainer (PM)
From: Tallinn, Estonia
Registered: 2010-01-23
Posts: 1,867

Re: New To Archlinux - Setting up Python 3

You can find your current path with:

>>> import sys
>>> print sys.path

Then, you can add the following to your .bashrc, .zshrc, etc:

export PYTHONPATH=whatever you want

EDIT: In most cases when you install Python modules on Arch, they will be automatically added to the Python path. Setting your path manually is rarely needed to be done.

Last edited by cesura (2010-08-07 16:08:14)

Offline

#4 2010-08-07 16:09:47

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: New To Archlinux - Setting up Python 3

itsbrad212 wrote:

You can find your current path with:

>>> import sys
>>> print sys.path

Then, you can add the following to your .bashrc, .zshrc, etc:

export PYTHONPATH=whatever you want

EDIT: In most cases when you install Python modules on Arch, they will be automatically added to the Python path. Setting your path manually is rarely needed to be done.

But you have Python 2 and 3 - won't they be stepping on each others' toes?

Offline

#5 2010-08-07 16:21:54

cesura
Package Maintainer (PM)
From: Tallinn, Estonia
Registered: 2010-01-23
Posts: 1,867

Re: New To Archlinux - Setting up Python 3

karol wrote:

But you have Python 2 and 3 - won't they be stepping on each others' toes?

I don't know. I haven't dabbled too much in Python 3. I would assume that the Python development team would be smart enough to come up with a method of differentiating Python 2 and Python 3 locations in the same path.

Offline

#6 2010-08-07 18:08:37

Ogion
Member
From: Germany
Registered: 2007-12-11
Posts: 367

Re: New To Archlinux - Setting up Python 3

@whitetimer:
I suspect with "downloaded" you mean you visited the webpage of python 3, downloaded their tarball or whatever and now want to install that..Am i right?

Python 3 is in the repo

community/python3 3.1.2-3 [installed]
    Next generation of the python high-level scripting language

Just install it with pacman (pacman -S python3)(after you updated the lists, pacman -Sy) and that's that.

Ogion


(my-dotfiles)
"People willing to trade their freedom for temporary security deserve neither and will lose both." - Benjamin Franklin
"Enlightenment is man's leaving his self-caused immaturity." - Immanuel Kant

Offline

#7 2010-08-07 18:27:02

whitetimer
Member
Registered: 2010-05-23
Posts: 207

Re: New To Archlinux - Setting up Python 3

@Ogion

No i have installed via the repo, and everything is hunky dorey, i just wanted to set the PYTHONPATH which is done now .. So thanks to all for the advice

Offline

#8 2010-08-07 21:03:35

Ogion
Member
From: Germany
Registered: 2007-12-11
Posts: 367

Re: New To Archlinux - Setting up Python 3

Ok sorry then.

Ogion


(my-dotfiles)
"People willing to trade their freedom for temporary security deserve neither and will lose both." - Benjamin Franklin
"Enlightenment is man's leaving his self-caused immaturity." - Immanuel Kant

Offline

#9 2010-08-07 23:00:40

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,384
Website

Re: New To Archlinux - Setting up Python 3

Here is some detail on how to handle different PYTHONPATHs for python 2 and 3:
http://bugs.python.org/issue2375

Offline

#10 2023-07-30 10:27:31

ifernando
Member
Registered: 2022-09-20
Posts: 5

Re: New To Archlinux - Setting up Python 3

I found that in addition to installing:

pacman -S tensorflow

I had to install:

pacman -S python-tensorflow

After this tensorflow works in Python as I expected.

Offline

#11 2023-07-30 11:10:18

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,645

Re: New To Archlinux - Setting up Python 3

ifernando, this topic is thirteen years old and the OP has not been back since 2015. Please do not necrobump.

Closing.

Offline

Board footer

Powered by FluxBB