Editing
Python Project Dependencies
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== setup.py == In addition to `requirements.txt`, `setup.py` is another file used to check for dependencies when installing a package. <ref>[https://caremad.io/posts/2013/07/setup-vs-requirement/ setup.py vs requirements.txt], Donald Stufft</ref> `setup.py` defines ''abstract'' dependencies for redistributable packages. The specific ''source'' for those dependencies should be defined elsewhere, e.g. `requirements.txt`. Given a directiory containing a `setup.py` file, a `requirements.txt` file can be written that will install all dependencies found in `setup.py` from PyPi: <pre> --index-url https://pypi.python.org/simple -e . </pre> If any dependencies should come from another source, `requirements.txt` can be modified similar to this: <pre> --index-url https://pypi.python.org/simple -e https://github.com/foo/bar.git#egg=bar -e . </pre> `pip` will first install the `bar` library from GitHub, then move on to install all the dependencies found in `setup.py`. Since the `bar` library has already been installed at this point, it will be skipped over when installing libraries from PyPi. === Installing packages defined in setup.py === Command to install the project dependencies defined in `setup.py`: <ref>[https://stackoverflow.com/questions/1471994/what-is-setup-py What is setup.py] - Stackoverflow</ref> <ref>[https://docs.python.org/3/installing/index.html#installing-index Installing Python Modules] - Python Software Foundation</ref> <syntaxhighlight lang="bash"> $ python setup.py install </syntaxhighlight>
Summary:
Please note that all contributions to Littledamien Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Littledamien Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information