Files
2012-02-21 01:15:00 -05:00

1 line
10 KiB
JSON

[{"user_id": 18281, "stars": [], "topic_id": 41485, "date_created": 1310151965.3504109, "message": "ive followed this guide to getting my virtualenv working on a new mac.\nhttp://paintincode.blogspot.com/2010/08/install-pip-virtualenv.html\n i didnt use the hidden dir previously, but followed it to the letter this time. are there any advantages to developing in a hidden directory that i havent thought about, or should i just have developed to a non-hidden dir which is what im used to?", "group_id": 81, "id": 1595330}, {"user_id": 18281, "stars": [], "topic_id": 41485, "date_created": 1310153918.086726, "message": "cheers for the responses. I'm actually talking about the folder that contains the envs. the guide uses .virtualenvs which i took to be a hidden folder and wondered why it was hidden", "group_id": 81, "id": 1595540}, {"user_id": 33633, "stars": [], "topic_id": 41485, "date_created": 1310154151.155926, "message": "Yeah forget that. Don't do hidden. And don't forget to add the environment to your .gitignore or .hgignore. What? Your still using CVS ;-))", "group_id": 81, "id": 1595550}, {"user_id": 33633, "stars": [], "topic_id": 41485, "date_created": 1310153454.8815441, "message": "Here is what I do. Most of my Python projects are all over the place with Python binary compatibility so I must use multiple versions. My global Python binary is also a different version than those of my projects! Can you say fragmented? What I like to do in every python project I start is to create brand new dedicated virtualenv. I run `virtualenv --distribute --no-site-packages env`, then activate `. env/bin/activate`, and then finally `pip install <package>`. This way the version I stick to is local to that project and doesn't screw with the rest of my system nor other projects which use Python. Having said that I wouldn't mess with the 'system' python other than installing a Python mac binary via http://www.python.org/download/mac/ or brew. If you use Eclipse you may even use the newly installed virtualenv Python binary!", "group_id": 81, "id": 1595506}, {"user_id": 1930, "stars": [], "topic_id": 41485, "date_created": 1310153789.1445229, "message": "@JasonGiedymin Yep; same here... used virtualenvwrapper.sh for a while, but found that either wanted different support (i.e. pythons), or different branches (e.g. compare a pip install with a bleeding-edge trunk \"python setup.py develop\" kind of install). I like having that all visible, and at the top of the project. I also name my env's starting with \"E*\", so they all show up in a clump on ls (ymmv).", "group_id": 81, "id": 1595532}, {"user_id": 33633, "stars": [], "topic_id": 41485, "date_created": 1310155618.0536661, "message": "If it's an open source project just do it! Use Github or bitbucket! Ropey code is the best, because someone will (maybe) try to refactor it or correct it and bam you have a great discussion on technique in which you may (or may not) learn something. I am the king of messy code :-D", "group_id": 81, "id": 1595687}, {"user_id": 18281, "stars": [{"date_created": 1310223436.032331, "user_id": 19460}], "topic_id": 41485, "date_created": 1310154954.0714059, "message": "i might not be using any code storage application just yet this week, sorry.", "group_id": 81, "id": 1595636}, {"user_id": 18281, "stars": [], "topic_id": 41485, "date_created": 1310155004.7274339, "message": "i know, i know, im a disgrace. in my defence, i dont think anyone wants to see my ropey code. though i've found codebase this week, which looks like a proper tool for backing up my packages to a repository. which i know i need to do.", "group_id": 81, "id": 1595644}, {"user_id": 18281, "stars": [], "topic_id": 41485, "date_created": 1310156020.452213, "message": "yeah, its a shop that ive been working on over a year, back when there was only one in django. will try and fire it up cos i've tried to keep it quite lightweight. and i do need to learn from the gurus...", "group_id": 81, "id": 1595722}, {"user_id": 32856, "stars": [], "topic_id": 41485, "date_created": 1310160282.069411, "message": "You can tell virtualenvwrapper to use a different directory from .virtualenvs by setting the WORKON_HOME environment variable.", "group_id": 81, "id": 1596170}, {"user_id": 18281, "stars": [], "topic_id": 41485, "date_created": 1310161791.9409161, "message": "pip uninstall virtualenvwrapper\npip uninstall virtualenv\nremove the two lines from ~/.profile", "group_id": 81, "id": 1596293}, {"user_id": 18281, "stars": [], "topic_id": 41485, "date_created": 1310160473.5362861, "message": "@mattmcc having reverted to the none hidden method, I've tried to edit my .profile file, followed source ~/.profile to reset it, but it still insists on creating the envs in the .virtualenvs folder. help. im sick of messing with this now. 5 hours...", "group_id": 81, "id": 1596196}, {"user_id": 6415, "stars": [], "topic_id": 41485, "date_created": 1310162228.282865, "message": "Your code should be in its own directory and all modules it uses be installed in an env with pip. You may want to ave the list of packages used with: pip freeze > requirements.txt", "group_id": 81, "id": 1596365}, {"user_id": 6415, "stars": [], "topic_id": 41485, "date_created": 1310162296.578306, "message": "That way, you can repopulate a new env with: pip install -r requirements.txt", "group_id": 81, "id": 1596369}, {"user_id": 6415, "stars": [], "topic_id": 41485, "date_created": 1310162050.6451139, "message": "@bytejunkie You should not add your own code in the env itself, that's the reason why all envs are located in an hidden folder.", "group_id": 81, "id": 1596345}, {"user_id": 18281, "stars": [], "topic_id": 41485, "date_created": 1310161758.4161661, "message": "ok for reference (if anyone screws virtualenv up as much as i have) i've sorted it.", "group_id": 81, "id": 1596290}, {"user_id": 18281, "stars": [], "topic_id": 41485, "date_created": 1310161801.50226, "message": "and as much as i hate to admit it, reboot", "group_id": 81, "id": 1596295}, {"user_id": 18281, "stars": [], "topic_id": 41485, "date_created": 1310161815.9876139, "message": "install virtualenv, then wrapper, then add two lines to .profile", "group_id": 81, "id": 1596297}, {"user_id": 18281, "stars": [], "topic_id": 41485, "date_created": 1310161819.0142269, "message": "bingo bango.", "group_id": 81, "id": 1596298}, {"user_id": 18281, "stars": [], "topic_id": 41485, "date_created": 1310161823.7795091, "message": "thanks for the help guys.", "group_id": 81, "id": 1596299}, {"user_id": 6415, "stars": [], "topic_id": 41485, "date_created": 1310162116.0749929, "message": "You should only interact with your envs with mkvirtualenv, rmvirtualenv and workon.", "group_id": 81, "id": 1596353}, {"user_id": 6415, "stars": [], "topic_id": 41485, "date_created": 1310162429.6404459, "message": "That way it is easy to try differents environments (version of python and/or libraries) by switching to a new virtual env with the workon command.", "group_id": 81, "id": 1596374}, {"user_id": 6415, "stars": [], "topic_id": 41485, "date_created": 1310162451.776917, "message": "And everything is nice and decoupled :)", "group_id": 81, "id": 1596378}, {"user_id": 6415, "stars": [], "topic_id": 41485, "date_created": 1310162335.515265, "message": "It's a good idea to commit requirements.txt in your project repository though.", "group_id": 81, "id": 1596370}, {"user_id": 18281, "stars": [], "topic_id": 41485, "date_created": 1310240605.9126239, "message": "ok, i understand what your saying but not why you'd work that way. for instance, im working on a django website. i make a virtualenv with python and django in.", "group_id": 81, "id": 1600394}, {"user_id": 18281, "stars": [], "topic_id": 41485, "date_created": 1310240619.5842061, "message": "where then to put my apps?", "group_id": 81, "id": 1600396}, {"user_id": 18281, "stars": [], "topic_id": 41485, "date_created": 1310240678.3172441, "message": "i put them inside a project in the virtualenv, so that my virtualenv then has my version of that site in it. all together in one logical place.", "group_id": 81, "id": 1600399}, {"user_id": 6618, "stars": [], "topic_id": 41485, "date_created": 1310289509.1646049, "message": "Understanding why you make it a hidden directory, why you freeze an environment to make it portable, and understanding your architecture are key here. Play with it, learn from it.", "group_id": 81, "id": 1603657}, {"user_id": 6618, "stars": [], "topic_id": 41485, "date_created": 1310289860.9807999, "message": "Everyone does it differently, understanding what works for you is your choice.", "group_id": 81, "id": 1603664}, {"user_id": 2588, "stars": [{"date_created": 1311253836.846971, "user_id": 27106}], "topic_id": 41485, "date_created": 1310408642.7535689, "message": "Heck, I even have the occasional virtualenv that is symlink'ed into my WORKON_HOME directory - still works fine with virtualenvwrapper.", "group_id": 81, "id": 1614119}, {"user_id": 2588, "stars": [], "topic_id": 41485, "date_created": 1310408335.3475111, "message": "@bytejunkie Sometimes the flexibility Python provides w.r.t. arranging code leads to a bit of analysis paralysis.", "group_id": 81, "id": 1614077}, {"user_id": 2588, "stars": [], "topic_id": 41485, "date_created": 1310408399.183836, "message": "The right way to do things is to place your code where you feel comfortable and make sure Python's path resolution is configured per your needs.", "group_id": 81, "id": 1614084}, {"user_id": 2588, "stars": [], "topic_id": 41485, "date_created": 1310408570.9521911, "message": "I've used both methods like the one @davidpaccoud describes as well as my current convention of installing my projects into the virtualenv (via pip -e).", "group_id": 81, "id": 1614110}, {"user_id": 2588, "stars": [], "topic_id": 41485, "date_created": 1310408926.6586421, "message": "The takeaway is that once your virtualenv is activated, the important thing is that the Python path is correct. The virtualenvwrapper postactivate hook is a great place to explicitly specify any path overrides for that environment.", "group_id": 81, "id": 1614150}, {"user_id": 6415, "stars": [], "topic_id": 41485, "date_created": 1310417418.1128941, "message": "You can put your apps in your project or you can also link to them with a .pth file in your virtualenv site-packages directory.", "group_id": 81, "id": 1615355}]