Re: [Tutor] sys.path.append import python3 not working

2014-02-05 Thread ALAN GAULD
>> And after 15 years of using Python I didn't know it existed until now! >> I've always used a local directory and added it to PYTHONPATH... > >Then maybe you're also not aware of the --user option for >pip/easy_install. That's how I discovered the user site-packages >directory.To be honest I've

Re: [Tutor] sys.path.append import python3 not working

2014-02-05 Thread Oscar Benjamin
On 5 February 2014 12:41, Alan Gauld wrote: > > And after 15 years of using Python I didn't know it existed until now! > I've always used a local directory and added it to PYTHONPATH... Then maybe you're also not aware of the --user option for pip/easy_install. That's how I discovered the user si

Re: [Tutor] sys.path.append import python3 not working

2014-02-05 Thread eryksun
On Wed, Feb 5, 2014 at 6:55 AM, Ian D wrote: > The network dictates that it is the only way I can really do it as I cannot > edit any files directly. I have to append the path on the fly If you can modify your profile, then I'd expect you can permanently set PYTHONPATH for the current user. setx.

Re: [Tutor] sys.path.append import python3 not working

2014-02-05 Thread Dave Angel
Ian D Wrote in message: > __ Ok I seem to be having some success with it at the moment after moving > the location of the module. That might be because the letter following the backslash is not currently a valid escape code. You really shouldn't leave half broken code; it tends to break aga

Re: [Tutor] sys.path.append import python3 not working

2014-02-05 Thread Alan Gauld
On 05/02/14 12:02, Tim Golden wrote: On 05/02/2014 11:58, Oscar Benjamin wrote: Another option is to place it in site-packages. If you don't want to use the system site packages you can always use the one in your user directory. In my case on Ubuntu that's in ~/.local/lib/pythonX.Y/site-packages

Re: [Tutor] sys.path.append import python3 not working

2014-02-05 Thread Tim Golden
On 05/02/2014 11:55, Ian D wrote: > The network dictates that it is the only way I can really do it as I > cannot edit any files directly. I have to append the path on the fly Ok; just wanted to make sure you weren't making life more difficult for yourself than needs be. TJG

Re: [Tutor] sys.path.append import python3 not working

2014-02-05 Thread Tim Golden
On 05/02/2014 11:58, Oscar Benjamin wrote: > Another option is to place it in site-packages. If you don't want to > use the system site packages you can always use the one in your user > directory. In my case on Ubuntu that's in > ~/.local/lib/pythonX.Y/site-packages/ Good point: I always forget t

Re: [Tutor] sys.path.append import python3 not working

2014-02-05 Thread Oscar Benjamin
On 5 February 2014 11:51, Tim Golden wrote: > On 05/02/2014 11:46, Ian D wrote: >> Ok even more strangely it is working in the original location. >> >> Am now not 100% sure that I have the folder structure correct. >> >> I will keep a eye on it. > > You might want to consider whether your approach

Re: [Tutor] sys.path.append import python3 not working

2014-02-05 Thread Ian D
The network dictates that it is the only way I can really do it as I cannot edit any files directly. I have to append the path on the fly > Date: Wed, 5 Feb 2014 11:51:18 + > From: m...@timgolden.me.uk > To: tutor@python.org > Subject: Re: [Tutor] sys.path.append import python3

Re: [Tutor] sys.path.append import python3 not working

2014-02-05 Thread Tim Golden
On 05/02/2014 11:46, Ian D wrote: > Ok even more strangely it is working in the original location. > > Am now not 100% sure that I have the folder structure correct. > > I will keep a eye on it. You might want to consider whether your approach is the best. One usually appends to sys.path when

Re: [Tutor] sys.path.append import python3 not working

2014-02-05 Thread Ian D
Ok even more strangely it is working in the original location. Am now not 100% sure that I have the folder structure correct. I will keep a eye on it. Thanks To: tutor@python.org From: da...@davea.name Date: Wed, 5 Feb 2014 06:32:46 -0500 Subject: Re: [Tutor] sys.path.append import python3

Re: [Tutor] sys.path.append import python3 not working

2014-02-05 Thread Ian D
Ok I seem to be having some success with it at the moment after moving the location of the module. From: dux...@hotmail.com To: tutor@python.org Date: Wed, 5 Feb 2014 11:09:35 + Subject: [Tutor] sys.path.append import python3 not working Hi Seem when I run a module I created with

Re: [Tutor] sys.path.append import python3 not working

2014-02-05 Thread Dave Angel
Ian D Wrote in message: > > import sys > sys.path.append("d:\modules")   > I have tried it with append("d:\\modules") append("d:/\modules")   The first form is not reasonable, you'd need to double the backslash. But your second try should have worked. Here's what I would use: "d:/modules"

[Tutor] sys.path.append import python3 not working

2014-02-05 Thread Ian D
Hi Seem when I run a module I created with import sys sys.path.append("d:\modules") import myMod it works great in 2.7 but in 3.3 it doesn't I get an error in 3.3: import myMod ImportError: No module named 'myMod' I have tried it with append("d:\\modules") append("d:/\modules") A

Re: [Tutor] sys.path.append

2008-12-18 Thread Andreas Kostyrka
Am Wed, 17 Dec 2008 11:17:14 -0500 schrieb "Kent Johnson" : > On Wed, Dec 17, 2008 at 10:20 AM, ppaarrkk > wrote: > > > > I can do this : > > > sys.path.append ( 'C:\dump1' ) > > Note you should use raw strings r'C:\dump1' or double backslash > 'C:\\dump1' because the \ is a string escape c

Re: [Tutor] sys.path.append

2008-12-17 Thread Kent Johnson
On Wed, Dec 17, 2008 at 10:20 AM, ppaarrkk wrote: > > I can do this : > sys.path.append ( 'C:\dump1' ) Note you should use raw strings r'C:\dump1' or double backslash 'C:\\dump1' because the \ is a string escape character. > but not : > x = 'C:\dir1' sys.path.append(x) That shoul

[Tutor] sys.path.append

2008-12-17 Thread ppaarrkk
I can do this : >>> sys.path.append ( 'C:\dump1' ) but not : >>> x = 'C:\dir1' >>> sys.path.append(x) or : but not : >>> x = ['C:\dir1'] >>> sys.path.append(x) Can I append variables to the path, rather than explicit strings ? -- View this message in context: http://www.nabble.com/sys.p

Re: [Tutor] sys.path.append issues with cgi

2005-04-18 Thread Gabriel Farrell
A follow-up to this post for future reference: It appears that on my web host the cgi scripts run on a web server that doesn't have access to the same python and python libs that are available when I ssh in to my shell account. So it doesn't matter if I change the sys.path, because the libs are s

Re: [Tutor] sys.path.append issues with cgi

2005-04-14 Thread Gabriel Farrell
Sorry, addendum to that post. The line from ElementTree import Element, SubElement, tostring should read from elementtree.ElementTree import Element, SubElement, tostring but that still doesn't work. gabe ___ Tutor maillist - Tutor@python.org h

[Tutor] sys.path.append issues with cgi

2005-04-14 Thread Gabriel Farrell
Hello all, I'm trying to modify the sys.path in my cgi scripts to import modules that I've installed in my home directory. The top of the script reads as follows: #!/usr/local/bin/python import cgi, sys sys.path.append('/net/u/16/g/gsf/lib/python2.4/site-packages') from ElementTree import Elem