Tuesday, September 27, 2016

Re: [Help] Advanced tutorial: How to install my Python package with Virtualenv

Hi

It took me a while to figure this  out but once you see it it is really fairly simple. It somewhat depends on what you are using for and IDE (Integrated Development Environment). I use Eclipse with PyDev plugin and like it.

Determine where you want to put your VE (Virtual Envirnment) . With Eclipse everything works out of the directory "workspace". Workspace can be anywhere on your system but, I find it works best in your home directory. If you are not using Eclipse then your working directory can be just about anywhere you choose.

Assuming that you have installed virtualenv or venv and virtualenvwrapper ( if on linux. Not sure about windows) you have a choice of what to do next. If you plan on using one of the standard text editors you will want put your whole project inside of the VE. If using something like Eclipse install the VE in a subdirectory in your workspace. Remember that the main purpose of a VE is to wall off packages such as Python and Django from the rest of your system. Use pip to install these packages into the VE using what ever versions are appropriate for your project.

If you are not using an IDE then you have your whole project inside the VE.Just turn on the VE  and you are set to go. If you are using an IDE then it depends on the IDE but generally you will reference the appropriate files in the VE when you set up your project. You do not have to activate the  VE under these circumstances. The VE is just a repository of the proper versions of the packages that you need for your project.

Hope this helps.

Gary R

On 09/27/2016 10:26 AM, Bill Freeman wrote:
You don't say what OS/platform you are using, and I don't know if what I say below applies to Windows, but should be valid elsewhere.

Note, too, that I presume that you are using a command line (e.g.; xterm/bash).

I also presume that you have managed to install virtualenv on your system.

If  your virtualenv is activated (see virtualenv documentation), and you should activate it when working on your project, then just saying

   pip

should be enough.  Try saying

   which pip

if that works at all, it should report a pip withing the bin directory of your virtualenv.  On the other hand, if it reports the pip in a system directory, then your virtualenv has not been activated, or somethign is broken.

On Tue, Sep 27, 2016 at 7:19 AM, Aline C. R. Souza <linecrsouza@gmail.com> wrote:
Hello Guys,

I need some help to install my Python package with virtualenv. I follow the 'Advanced tutorial: How to write reusable apps' and moved the polls directory out of the project. Now I want to install my package using virtualenv and pip, but I don't know how.

Consider I am inside of my project diretory (where the manage.py is) and I am working on a virtual environment. What would be the right pip command to install my package, considering that the polls directory is out of the project.

Please help!




--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/bb3167a4-61c3-4006-994d-c2b226636401%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAB%2BAj0uCXn04qjasaqYpwfRYRTtmk_jztTH1KXCgmc5%2BmOyLUw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


No comments:

Post a Comment