![]() ![]() ![]() Some credit for the steps described goes to Luke Plant, however I tried to simplify it a bit. To test it you could uninstall one of your dependencies from your system and install it only into that virtual environment. This worked for me with Eclipse Helios SR2 and PyDev 1.6.5. Alternatively you can manage the environment individually for each run configuration in the 'Run -> Run configurations -> Interpreter' tab open eclipse application, click preferences click PyDev Click Interpreter Click Python Interpreter (below Figure 1) Click Choose from List button (below Figure 2) Select what ever Python version you want to use Click Apply Click OK Exit Eclipse ReOpen it and all fixed.In the project properties change the interpreter to use the newly created one (Project -> Properties -> PyDev Python Interpreter).The libraries should be selected automatically - leave them as they are. Select the python wrapper from the virtual environment ($WORKON_HOME/YOUR_PROJECT/bin/python). Go to Window -> Preferences -> Interpreter Python and create a new interpreter. In your virtual environment there's a python wrapper that we want to use in Eclipse.If you use the great Eclipse plugin PyDev as your IDE, here’s some simple steps to configure your project to use the virtual environment - assuming you’ve set it up already: ability to quickly switch between different versions of dependencies.dependencies can be defined within the project in a requirements file.no bad surprises if your os package manager decides to update a dependency.projects with different dependencies are completely isolated from each other, no bad surprises if you install a new dependency for some other project.Out of the many good reasons to use virtualenv rather than installing the dependencies system-wide, I found those are the most important: ![]() The transition is pretty straight forward and there’s a couple of good how-tos like this one. On my current Django project we just moved away from using system-wide installed dependencies to using virtualenv. ![]()
0 Comments
Leave a Reply. |