PMXBOT Log file Viewer

Help | Karma | Search:

#pypa logs for Monday the 26th of October, 2015

(Back to #pypa overview) (Back to channel listing) (Animate logs)
[07:50:46] <zoli> hi. Im trying to use gspread and oauth2client, that I have installed through pip3, but I got an error message: NameError: name 'run' is not defined when trying to: from oauth2client.tools import run
[07:51:01] <zoli> how can i resolve this?
[07:52:46] <mgedmin> can you pastebin the full traceback?
[07:56:47] <zoli> yes a sec
[07:57:46] <zoli> well it is just 4 lines
[07:57:51] <zoli> Traceback (most recent call last):
[07:57:51] <zoli> File "./googleio", line 47, in <module>
[07:57:51] <zoli> credentials = run(flow, storage)
[07:57:51] <zoli> NameError: name 'run' is not defined
[08:02:16] <mgedmin> ok, can you pastebin the source of the 'googleio' module?
[08:02:30] <mgedmin> I should rather say script, not module
[08:05:47] <zoli> http://pastebin.com/cJzkH32E
[08:09:40] <mgedmin> how come it says line 47 in the traceback?
[08:09:44] <mgedmin> but in this paste it's line 34?
[08:09:52] <mgedmin> are you running the right copy of the module?
[08:10:35] <mgedmin> (should you be pastebin'ing things that contain accessToken and refreshToken values?)
[08:10:48] <mgedmin> (at least clientId/clientSecret have been censored)
[08:11:02] <zoli> sry i have deleted some commented lines. Line 47 is the credentials = run(flow, storage)
[08:11:23] <mgedmin> I also don't understand how you can be getting a NameError after a successful import
[08:13:13] <zoli> if i will do reatuh then this refreshtoken wont be usable again right?
[08:13:26] <zoli> how you mean right copy of the module?
[08:15:07] <mgedmin> I meant that the code you pasted didn't match the line numbers in the traceback
[08:15:10] <mgedmin> but you've explained why
[08:15:23] <mgedmin> so unless those comments you removed were somehow causing the imports to be skipped, I don't know
[08:15:51] <mgedmin> (best not put any credentials directly in source code; use json.loads() or ConfigParser to read them from a separate file)
[08:16:00] <mgedmin> (you never know when you need to pastebin your actual code to debug problems)
[08:16:19] <mgedmin> (also, no idea how those tokens work and when they get invalidated)
[08:19:23] <zoli> the lines i deleted were all commented. I think the problem here is that run module has been removed from oauth2client but dont know how to store then the credentials
[08:19:44] <zoli> how can i delete my pastebin?
[08:23:41] <mgedmin> you'd get an ImportError
[08:24:17] <mgedmin> also, run can't be a module, or you wouldn't be able to call it -- run() would give a TypeError
[08:24:24] <mgedmin> it looks like a function in the tools module
[08:24:38] <mgedmin> re: deleting pastebins -- assume credentials compromised, revoke the tokens
[08:24:50] <mgedmin> I hear there are bots that crawl pastebins for accidentally leaked secrets
[08:31:08] <zoli> mgedmin: tx for the good advices
[08:31:23] <zoli> it was easy to revoke the credentials
[08:31:32] <zoli> i mean the tokens
[08:32:01] <zoli> :)
[08:32:52] <mgedmin> (focus follows mouse has some disadvantages)
[09:08:50] <lumidee> hi i want to distribute my django project. i created setup.py and MANIFEST files for my app: http://sprunge.us/hFUM http://sprunge.us/TDRg http://sprunge.us/RXcS then i run python setup.py register and finally python setup.py sdist upload, but after installing with: pip install bacula_monitor3 --allow-unverified bacula_monitor3 i noticed that my actual app is not installed but only egg metadata in site-packages.
[09:10:08] <lumidee> (egg metadata: http://sprunge.us/KCdB)
[09:23:31] <mgedmin> lumidee, note: you don't want to create MANIFEST; you want to create a MANIFEST.in
[09:30:59] <lumidee> mgedmin, i created actually a MANIFEST.in, just in my question i didn't write the extension name
[09:32:46] <lumidee> /usr/lib/python3.4/site-packages/bacula_monitor3-1.0-py3.4.egg-info/SOURCES.txt lists my included files: http://sprunge.us/aCcd
[09:33:37] <mgedmin> django is special; I'm not sure what the conventions are
[09:33:51] <mgedmin> if you want your stuff in site-packages, you must package them as Python packages
[09:34:03] <mgedmin> I don't see a __init__ py in bacula_monitor/
[09:34:07] <mgedmin> so it's not a python package
[09:34:54] <mgedmin> can you run 'python -c 'import setuptools; print(setuptools.find_packages())' and see if it finds anything?
[09:35:20] <mgedmin> BTW: it's not a good idea to include pyc files in your sources!
[09:35:27] <mgedmin> your MANIFEST.in globs too much
[09:35:35] <mgedmin> but this is unrelated to your actual problem
[09:37:14] <lumidee> 'python -c 'import setuptools; print(setuptools.find_packages())' finds nothing from where i put my setup.py. yes i dont have __init__.py in my django project, only within django's apps itself i have __init__.py.
[09:37:57] <mgedmin> I assume you don't want a global package named 'monitor' in your site-packages
[09:38:03] <lumidee> so i guess i should try #django to see how others distribute django projects because iam not sure if it's correct to add __init__.py within myproject/__init__.py
[09:38:31] <mgedmin> I would probably add it
[09:38:48] <mgedmin> oh hey, I'm actually working on a django project that has this
[09:39:49] <lumidee> i give it a short try with __init__.py in the top directory
[09:45:05] <lumidee> mgedmin, indeed with __init__.py in my django project top directory installing to site-packages works fine. thank you
[09:45:38] <mgedmin> also, now you can trim down your MANIFEST.in
[09:45:52] <mgedmin> all package files get picked automatically, so you shouldn't need to manually list them all
[09:45:57] <mgedmin> you will need to list non-py files
[09:46:37] <mgedmin> I recommend 'recursive-include bacula_monitor *.html *.css *.conf *.md' rather than a generic *
[09:46:55] <mgedmin> I also recommend 'pip install check-manifest' and 'check-manifest .' to verify if MANIFEST.in looks correct
[09:51:26] <lumidee> i'll give this a try (added also exclude=('archiv')): http://sprunge.us/cfDH http://sprunge.us/UHjX
[09:56:15] <lumidee> worked fine. i also add now global-exclude *pyc or maybe also exclude=('__pycache__') in setuptools
[09:58:49] <koniiiik> Are there any special steps required to make pip run with openssl-0.9.8? Is it supported at all?
[10:00:56] <ionelmc> lumidee: that exclude should be unnecessary ?
[10:01:25] <ionelmc> plus that exclude is ['_', '_', 'e', 'x' .....]
[10:03:08] <lumidee> yep the exclude didn't work, yet .pyc file are distributed by find_packages() i think.
[10:03:16] <koniiiik> Or maybe my problem lies somewhere else – how can I debug SSL connection problems? I'm getting a SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590), which sounds quite generic to me, can I somehow find out what is the exact error pip is encountering here?
[10:08:35] <lumidee> ( i tried also: recursive-exclude bacula_monitor *.pyc ) ionelmc not sure how i would exclude pyc files with ['_', '_', 'e', 'x' .....]
[10:08:59] <ionelmc> lumidee: ('__pycache__') is same as '__pycache__'
[10:09:42] <ionelmc> ('__pycache__',) is correct
[10:09:45] <ionelmc> note the comma
[10:15:43] <lumidee> i tried: packages=find_packages( exclude=[ 'archiv', '__pycache__'] ), packages=find_packages( exclude=( 'archiv', '__pycache__',) ), recursive-exclude bacula_monitor *.pyc recursive-exclude bacula_monitor __pycache__
[10:24:32] <lumidee> "no previously-included files matching '__pycache__/*' found anywhere in distribution "
[10:32:27] <ionelmc> lumidee: can you reiterate what issue you have? i'm missed the previous discussion
[10:34:26] <koniiiik> Oh, never mind. It appears it is that issue where openssl falls apart when supplied a CA bundle with 149 certificates... An option to use the system CApath in pip would really be nice.
[10:37:01] <lumidee> ionelmc, i want to distribute my django package and forgot __init__.py in the packages directory. now everything installs fine, just that i don't want *.pyc file included.
[10:37:25] <ionelmc> lumidee: what do you have in manifest now?
[10:37:42] <lumidee> only recursive-include bacula_monitor *.html *.css *.conf *.md
[10:38:01] <lumidee> in setup.py i tried: packages=find_packages( exclude=[ 'archiv', '*.pyc' ] ),
[10:38:07] <ionelmc> lumidee: ok
[10:38:12] <ionelmc> clean your build dir
[10:38:15] <ionelmc> remove egginfo
[10:38:17] <ionelmc> clean stuff
[10:39:07] <ionelmc> there's build caching going on and that every so often screws stuff up when you change manifest or setup.py
[10:39:54] <ionelmc> and i'm not a fan of recursive-include, it's repetitive and error-prone
[10:40:06] <ionelmc> i usually use graft + "global-exclude *.py[cod] __pycache__ *.so *.dylib" at the end
[10:42:17] <ionelmc> lumidee: this is good to have around: https://pypi.python.org/pypi/setupext-janitor
[19:46:59] <transit> I'm trying to install a package with pip from a svn repo via https. It goes fine if svn credentials are already cached but specifying user : pass in the pip url results in an error: http://dpaste.com/0JKJ0YS
[19:47:30] <transit> ...It goes fine if credentials are already cached & not specified in the pip url.
[19:48:46] <transit> pip==7.1.2
[19:48:54] <transit> Python==2.7.6
[20:01:20] <waynr> anyone know what this means: "pkg_resources.DistributionNotFound: stevedore"
[20:06:25] <waynr> nevermind, i see my problem