X-Received: by 10.236.3.106 with SMTP id 70mr14024945yhg.20.1424729250147; Mon, 23 Feb 2015 14:07:30 -0800 (PST) X-Received: by 10.182.191.36 with SMTP id gv4mr72759obc.37.1424729249905; Mon, 23 Feb 2015 14:07:29 -0800 (PST) Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!j7no4886528qaq.1!news-out.google.com!db6ni33843igc.0!nntp.google.com!hl2no25946596igb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.python Date: Mon, 23 Feb 2015 14:07:29 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=15.211.201.83; posting-account=LpZxbAkAAADmdg1egflF6w8zbbyJPDNY NNTP-Posting-Host: 15.211.201.83 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <72425a30-d3bb-4e7a-86ea-e49bf7efbac3@googlegroups.com> Subject: Re: new.py and having '.' in PYTHONPATH From: sohcahtoa82@gmail.com Injection-Date: Mon, 23 Feb 2015 22:07:29 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 2574 X-Received-Body-CRC: 2581734574 Xref: csiph.com comp.lang.python:86272 On Monday, February 23, 2015 at 1:01:07 PM UTC-8, Tobiah wrote: > Was working along, and wasted some time on this. >=20 > Wanted to try something on my script, so I copied > it to 'new.py'. It wouldn't run, and neither would > the one I copied from! >=20 > Traceback (most recent call last): > File "a2z.py", line 6, in > from suds.client import Client > File "build/bdist.linux-i686/egg/suds/__init__.py", line 154, in > =20 > File "build/bdist.linux-i686/egg/suds/client.py", line 30, in > File "build/bdist.linux-i686/egg/suds/sudsobject.py", line 25, in > ImportError: cannot import name classobj >=20 >=20 > I finally figured out that the presence of new.py in > my directory was breaking things. '.' is in my > PYTHONPATH, so maybe suds was looking for some > other new.py. >=20 > Anyway, it raises the question as to whether having '.' in the > PYTHONPATH is at all a sane thing to do. >=20 > Thanks, >=20 > Tobiah There shouldn't be a need to have '.' in your PYTHONPATH. If your current = working directory is /home/me, and you have a module in /home/me/myModule.p= y, then opening up the interpreter and typing `import myModule` should work= fine without '.' in your PYTHONPATH. Are you running Python 2.x? There was a module named "new" in 2.x that was= removed in 3. You might be dealing with a conflict when you call your own= module 'new.py'.