Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I would like to just give a difference advice regarding creating virtualenvs and installing dependencies:

When you create the virtualenv, the current package you're working on doesn't get added to site-packages, so you're forced to be at the repository root to import the package.

The best approach is to have a proper setup.py file so you can do `python setup.py develop`, which will link the package you're working on into the virtualenv site-packages. This way it acts as it's installed and you can import anyway you like.

If you define your requirements on the setup.py (I think you should), you can even skip the `pip install -r requirements.txt` step.

I've cooked up a package template that can help getting this working:

https://github.com/hcarvalhoalves/python-package-template



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: