tag:blogger.com,1999:blog-6580443261471879069.post5277120791010770782..comments2023-06-23T03:22:15.328-07:00Comments on Creature Feature: celery + djcelery problem with virtualenv and virtualenvwrapperUnknownnoreply@blogger.comBlogger8125tag:blogger.com,1999:blog-6580443261471879069.post-59757526909721349642012-11-07T13:27:50.111-08:002012-11-07T13:27:50.111-08:00good luck!good luck!Lelihttps://www.blogger.com/profile/01947131133167792591noreply@blogger.comtag:blogger.com,1999:blog-6580443261471879069.post-55126804114165026732012-11-07T13:16:29.746-08:002012-11-07T13:16:29.746-08:00Well, this points me in the right direction. Much ...Well, this points me in the right direction. Much appreciated.Anonymoushttps://www.blogger.com/profile/10606122227854190400noreply@blogger.comtag:blogger.com,1999:blog-6580443261471879069.post-80113818518597732572012-11-07T13:12:08.486-08:002012-11-07T13:12:08.486-08:00from what it sounds like, the reason it's work...from what it sounds like, the reason it's working when you are in that folder is that it's running your virtual environment's python as it's supposed to, but that for some reason that python is not getting set to $PATH/python in general. thus, when your path (including current directory) includes the correct python everything works, but otherwise it does not.<br /><br />I actually use virtualenvwrapper to manage my virtualenvs, altho I'm pretty sure that shouldn't make a huge difference.<br /><br />from the mysite folder, if you run python, what version is it? can you run "import celery.current_app (or maybe "from celery import current_app")? Is this version + behavior different from the other python interpreter that opens from other folders?<br /><br />I may be good, but I don't know OS X / mac stuff very well at all, so altho I can tell that your problem seems to involve your virtualenv not setting you python binary correctly (esp. based on your answers to the above questions), I'm not sure what to do beyond that.Lelihttps://www.blogger.com/profile/01947131133167792591noreply@blogger.comtag:blogger.com,1999:blog-6580443261471879069.post-55238133300988015182012-11-07T13:06:05.020-08:002012-11-07T13:06:05.020-08:00Oooo -- you're good!
re: 1.) yes, it's ac...Oooo -- you're good!<br /><br />re: 1.) yes, it's active.<br /><br />re: 2) One I left out before. I think I'm handling my virtualenv(s) differently than you. Looking over your code above, it looks like you have a common dir that houses all of your virtualenvs, no? I house individual virtualenvs within individual "mysite" folders, so, yes, there indeed is a python binary living in that folder. Not sure how that might affect things.<br /><br />re: 3.) tried it, I get "No module named current_app" (not sure if i should have substituted a specific app name here).<br /><br />re: 4.) Sort of? My original virtualenv for this project was Python 2.7.2. Since starting the project, I've switched over to HomeBrew and used it to install Python, which defaults to 2.7.3. Sounds like this may be a/the culprit?<br /><br />Anonymoushttps://www.blogger.com/profile/10606122227854190400noreply@blogger.comtag:blogger.com,1999:blog-6580443261471879069.post-53200062015973333302012-11-07T12:50:03.530-08:002012-11-07T12:50:03.530-08:00sure, some thoughts:
1) make sure the virtualenv i...sure, some thoughts:<br />1) make sure the virtualenv is active again (a no brainer, but still...)<br />2) is there a python binary living in the mysite folder?<br />3) try the above trick that I found (start the python interpreter, run: import celery.current_app - is it the same problem as before?<br />4) has your version of python changed?Lelihttps://www.blogger.com/profile/01947131133167792591noreply@blogger.comtag:blogger.com,1999:blog-6580443261471879069.post-76211327754777566122012-11-07T12:47:55.127-08:002012-11-07T12:47:55.127-08:00Well, I spoke too soon. This is strange. Followed ...Well, I spoke too soon. This is strange. Followed the steps above. That allows me to run Python from my virtualenv and import celery/djcelery, but ONLY if I run Python from my MySite Folder (see below). If I try running Python from a sub-folder within my MySite (e.g., "Project" below), I get the same import error. Also, if I try running syncdb from "Project" i get the same error.<br /><br />MySite<br /> myVirtualEnv<br /> Project<br /> |<br /> App1<br /> App2<br /> manage.py<br /> etc.<br /><br />Any thoughts?<br /> Anonymoushttps://www.blogger.com/profile/10606122227854190400noreply@blogger.comtag:blogger.com,1999:blog-6580443261471879069.post-85176996699257586002012-11-07T12:45:20.626-08:002012-11-07T12:45:20.626-08:00hurray! happy to help :)hurray! happy to help :)Lelihttps://www.blogger.com/profile/01947131133167792591noreply@blogger.comtag:blogger.com,1999:blog-6580443261471879069.post-66253467594524773882012-11-07T12:27:04.588-08:002012-11-07T12:27:04.588-08:00I also had this problem, and this fix worked for m...I also had this problem, and this fix worked for me. Really appreciate the tip.<br />Anonymoushttps://www.blogger.com/profile/10606122227854190400noreply@blogger.com