Discussion:
[Tutor] Regarding installing a python package
Chirag Shahani
2015-09-29 02:28:47 UTC
Permalink
Hi,

Could any one please help me understand the following:

Suppose I install a python package using python setup.py install provided
by the developer of a package. I need to track that changes in my file
system.. meaning what new directories and files got created? Also, what is
the concept of the egg file that gets created? What would be the location
of this egg file and how would it be named ****.egg? Also, the ***.egg-info
directory?

Thanks in advance.

--
Chirag
_______________________________________________
Tutor maillist - ***@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
Laura Creighton
2015-09-29 11:20:16 UTC
Permalink
Post by Chirag Shahani
Hi,
Suppose I install a python package using python setup.py install provided
by the developer of a package. I need to track that changes in my file
system.. meaning what new directories and files got created? Also, what is
the concept of the egg file that gets created? What would be the location
of this egg file and how would it be named ****.egg? Also, the ***.egg-info
directory?
Thanks in advance.
--
Chirag
This is a useful package to install.
https://pypi.python.org/pypi/watchdog
It will happily log all changes to your filesystem, or only in the places
you are interested in watching.

However, the desire to do such a thing often means that your real
problem is that you are using python setup.py to install packages.

This can be ok if that is what you want to do, but it may be that
in your case what you want to do instead is to make a virtual
environment and install your package(s) there. This means you can
keep your system, global-wide environment pure, uncluttered with
packages, and have a separate virtualenv for each combination of
python packages you want to work with together. And you don't have
to worry about which things got installed globally at all -- because
none of them do.

Laura
_______________________________________________
Tutor maillist - ***@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
Oscar Benjamin
2015-09-29 14:28:26 UTC
Permalink
Post by Chirag Shahani
Hi,
Suppose I install a python package using python setup.py install provided
by the developer of a package. I need to track that changes in my file
system.. meaning what new directories and files got created? Also, what is
the concept of the egg file that gets created? What would be the location
of this egg file and how would it be named ****.egg? Also, the ***.egg-info
directory?
It really depends. The setup.py script is really just an arbitrary program
that can do anything and can create files in any location it chooses.
Mostly setup.py files have a standard behaviour which is to install files
in the site-packages folder for your Python installation (unless you
provide command line options indicating an alternative location) and to
install executables so that they will be available on PATH.

So usually if I have a project called project_name then it will create a
folder called project_name in the site-packages folder and then fill that
folder with Python files and maybe some other data files. Really though it
could do anything so if you need to know exactly what it's doing then
you'll need to read the setup.py and understand distutils and setuptools.

For example in my system the site-packages folder is called

/usr/lib/python2.7/dist-packages

For some reason Ubuntu calls it dist-packages but in most Python
installations it is called site-packages. If I install ipython by running
its setup.py then I will have an egg-info file called:

/usr/lib/python2.7/dist-packages/ipython-0.12.1.egg-info

and also a folder called

/usr/lib/python2.7/dist-packages/IPython

which contains all of the Python files for ipython. It also installs an
executable file called ipython which is found at

/usr/bin/ipython

The exact details of what files are installed and where they go can vary
depending on what operating system and Python version you are using.

--
Oscar
_______________________________________________
Tutor maillist - ***@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
Chirag Shahani
2015-09-30 00:28:48 UTC
Permalink
Thanks a lot for the response. I understand better now.
Post by Oscar Benjamin
Post by Chirag Shahani
Hi,
Suppose I install a python package using python setup.py install provided
by the developer of a package. I need to track that changes in my file
system.. meaning what new directories and files got created? Also, what is
the concept of the egg file that gets created? What would be the location
of this egg file and how would it be named ****.egg? Also, the ***.egg-info
directory?
It really depends. The setup.py script is really just an arbitrary program
that can do anything and can create files in any location it chooses.
Mostly setup.py files have a standard behaviour which is to install files
in the site-packages folder for your Python installation (unless you
provide command line options indicating an alternative location) and to
install executables so that they will be available on PATH.
So usually if I have a project called project_name then it will create a
folder called project_name in the site-packages folder and then fill that
folder with Python files and maybe some other data files. Really though it
could do anything so if you need to know exactly what it's doing then
you'll need to read the setup.py and understand distutils and setuptools.
For example in my system the site-packages folder is called
/usr/lib/python2.7/dist-packages
For some reason Ubuntu calls it dist-packages but in most Python
installations it is called site-packages. If I install ipython by running
/usr/lib/python2.7/dist-packages/ipython-0.12.1.egg-info
and also a folder called
/usr/lib/python2.7/dist-packages/IPython
which contains all of the Python files for ipython. It also installs an
executable file called ipython which is found at
/usr/bin/ipython
The exact details of what files are installed and where they go can vary
depending on what operating system and Python version you are using.
--
Oscar
_______________________________________________
Tutor maillist - ***@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Continue reading on narkive:
Loading...