Spyder Situation:
I started using Spyder because I could install anaconda on a windows
machine at work
without administrator rights.
At home, I am running Ubunto 16.04LTS.
On the machine at home, I installed Spyder (2.3.8+dfsg1-build1) using
apt-get install.
I have been developing a python program ( let's call it MyProgram.py) using
this version of Spyder, and the python
interpreter in /usr/bin/python. No problem.
Then I decided to use virtualenv to setup a virtual environment. In the
virtual
environment, I used pip to install another version of Spyder, and whatever
packages I
needed to run MyProgram.py.
Now, when I run Spyder from the virtualenv, MyProgram.py runs correctly
* inside Spyder the first time I run it.* The second time (and all
subsequent times) I run it, I get a stack
trace that goes 6 layers deep in the requests package.
My first instinct was to think that package differences in my virtualenv
vs. /usr/bin/python were causing
my problems. But, I discovered that
* I can run MyProgram.py from the command line inside my virtualenv without
error. * And, as I said,
*I can run MyProgram.py outside the virtualenv, within Spyder without
getting errors*. I only get the error under these circumstances:
*(1)* Inside virtualenv
*(2)* Running program from Spyder IDE, not from command line
*(3)* Error does not happen the first time I run MyProgram.py, only for the
second and
subsequent run times.
Based on this evidence, I think there is a problem with Spyder.
Any advice? I can provide a stack trace, or other relevant info.
Thanks!
LarryM
===============================================
1:40pm tuesday may 17, 2016
notes:
*from inside virtual environment, sypder is run, then weeklyCron.py is run
first time, WeeklyCron works
second time, WeeklyCron kicks off error message deep in requests
==========================================================================
============================================================
FIRST RUN OF WeeklyCron - SUCCESS
============================================================
Python 2.7.11+ (default, Apr 17 2016, 14:00:29)
[GCC 5.3.1 20160413] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> runfile('/home/Projects/autocharlie/WeeklyCron.py',
wdir='/home/Projects/autocharlie')
--------------------------
myGetSchedule()------------
Sunday
xxxxxxxxxxxxxxxx
MGD.day -> 0
xxxxxxxxxxxxxxx
Monday
xxxxxxxxxxxxxxxx
MGD.day -> 1
xxxxxxxxxxxxxxx
Tuesday
xxxxxxxxxxxxxxxx
MGD.day -> 2
xxxxxxxxxxxxxxx
Wednesday
xxxxxxxxxxxxxxxx
MGD.day -> 3
xxxxxxxxxxxxxxx
Thursday
xxxxxxxxxxxxxxxx
MGD.day -> 4
xxxxxxxxxxxxxxx
Friday
xxxxxxxxxxxxxxxx
MGD.day -> 5
xxxxxxxxxxxxxxx
Saturday
xxxxxxxxxxxxxxxx
MGD.day -> 6
xxxxxxxxxxxxxxx
New Schedule obtained from xxx
schedKey -> ['Monday', 'Tuesday', 'Friday', 'Wednesday', 'Thursday',
'Sunday', 'Saturday']
sched2charlieSched()
Monday
s2cs> deleted: [u'Undercurrents']
s2cs> deleted: [u'Second Cup of Coffee']
s2cs> deleted: [u'MakingContact']
s2cs> deleted: [u'Bioneers']
s2cs> deleted: [u'Alternative Radio']
s2cs> deleted: [u'Democracy Now']
s2cs> deleted: [u'Peace Talks Radioi']
s2cs> deleted: [u'Latin Waves']
Tuesday
s2cs> deleted: [u'Undercurrents']
s2cs> deleted: [u'Second Cup of Coffee']
s2cs> deleted: [u'Sprouts']
s2cs> deleted: [u'From The Vault']
s2cs> deleted: [u'Democracy Now']
s2cs> deleted: [u'Heart Of Wellness']
s2cs> deleted: [u'Building Bridges']
Friday
s2cs> deleted: [u'Undercurrents']
s2cs> deleted: [u'Second Cup Of Coffee']
s2cs> deleted: [u'Shortwave Report']
s2cs> deleted: [u'Food Sleuth']
s2cs> deleted: [u'Democracy at Work']
s2cs> deleted: [u'Democracy Now']
s2cs> deleted: [u'Free Speech Radio News']
s2cs> deleted: [u'Radio Curious']
Wednesday
s2cs> deleted: [u'Undercurrents']
s2cs> deleted: [u'Second Cup of Coffee']
s2cs> deleted: [u'Voices of Our World']
s2cs> deleted: [u'TUC Radio']
s2cs> deleted: [u'New Dimensions']
s2cs> deleted: [u'Democracy Now']
s2cs> deleted: [u'This Way Out']
s2cs> deleted: [u'Between The Lines']
Thursday
s2cs> deleted: [u'Undercurrents']
s2cs> deleted: [u'Second Cup of Coffee']
s2cs> deleted: [u'Sea Change Radio']
s2cs> deleted: [u'Business Matters']
s2cs> deleted: [u'Democracy Now']
s2cs> deleted: [u'WINGS']
Sunday
s2cs> deleted: [u'NewOrleansCalling']
s2cs> deleted: [u'WFMT Sunday Classics']
s2cs> deleted: [u'Undercurrents']
s2cs> deleted: [u'INTERFAITH VOICES']
s2cs> deleted: [u"Writer's Voice"]
s2cs> deleted: [u"LOAFER'S GLORY"]
s2cs> deleted: [u'SPIRIT IN ACTION']
Saturday
s2cs> deleted: [u'The Grateful Dead Hour']
s2cs> deleted: [u'Undercurrents']
s2cs> deleted: [u'\u201cSATURDAY MORNING BREAKFAST CLUB\u201d']
s2cs> deleted: [u'BLUEGRASS REVIEW']
============================
above, success,
below, 2nd time, failure
===========================
============================================================
SECOND RUN OF WeeklyCron - FAILURE
============================================================
>>> runfile('/home/Projects/autocharlie/WeeklyCron.py',
wdir='/home/Projects/autocharlie')
Reloaded modules: bisect, shlex, json.scanner, base64, ctypes.util,
json.encoder, uuid, httplib, email.encoders, SpinPapiLib, logging,
_LWPCookieJar, stringprep, hmac, ctypes._endian, local, ssl, cookielib,
urllib, _MozillaCookieJar, Queue, ctypes, key, json, email.utils, admin,
json.decoder, rfc822, urlparse, textwrap, quopri, mimetypes, cgi, netrc,
email._parseaddr, Cookie, SpinPapiClient, mimetools, contextlib, urllib2,
myClasses
--------------------------
myGetSchedule()------------
Sunday
xxxxxxxxxxxxxxxx
MGD.day -> 0
xxxxxxxxxxxxxxx
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File
"/home/Projects/virtenv/local/lib/python2.7/site-packages/spyderlib/widgets/externalshell/sitecustomize.py",
line 714, in runfile
execfile(filename, namespace)
File
"/home/Projects/virtenv/local/lib/python2.7/site-packages/spyderlib/widgets/externalshell/sitecustomize.py",
line 81, in execfile
builtins.execfile(filename, *where)
File "/home/Projects/autocharlie/WeeklyCron.py", line 157, in <module>
fullSched = SPLib.FreshPapi1()
File "SpinPapiLib.py", line 576, in FreshPapi1
sched, success = myGetSchedule(Days)
File "SpinPapiLib.py", line 188, in myGetSchedule
mySchedule[days[i]], tmpSuccess = myGetDay(i)
File "SpinPapiLib.py", line 164, in myGetDay
r = requests.get(client.query({'method': 'getRegularShowsInfo',
'station': 'wdrt', 'When': str(day)}))
File
"/home/Projects/virtenv/local/lib/python2.7/site-packages/requests/api.py",
line 71, in get
return request('get', url, params=params, **kwargs)
File
"/home/Projects/virtenv/local/lib/python2.7/site-packages/requests/api.py",
line 57, in request
return session.request(method=method, url=url, **kwargs)
File
"/home/Projects/virtenv/local/lib/python2.7/site-packages/requests/sessions.py",
line 475, in request
resp = self.send(prep, **send_kwargs)
File
"/home/Projects/virtenv/local/lib/python2.7/site-packages/requests/sessions.py",
line 617, in send
r.content
File
"/home/Projects/virtenv/local/lib/python2.7/site-packages/requests/models.py",
line 741, in content
self._content = bytes().join(self.iter_content(CONTENT_CHUNK_SIZE)) or
bytes()
File
"/home/Projects/virtenv/local/lib/python2.7/site-packages/requests/models.py",
line 664, in generate
for chunk in self.raw.stream(chunk_size, decode_content=True):
File
"/home/Projects/virtenv/local/lib/python2.7/site-packages/requests/packages/urllib3/response.py",
line 349, in stream
for line in self.read_chunked(amt, decode_content=decode_content):
File
"/home/Projects/virtenv/local/lib/python2.7/site-packages/requests/packages/urllib3/response.py",
line 496, in read_chunked
with self._error_catcher():
File "/usr/lib/python2.7/contextlib.py", line 84, in helper
return GeneratorContextManager(func(*args, **kwds))
TypeError: 'NoneType' object is not callable
>>>
--
You received this message because you are subscribed to the Google Groups
"spyder" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/spyderlib.
For more options, visit https://groups.google.com/d/optout.