Missing documentation on how to install in production enviroment
See original GitHub issueI’m wondering there is no documentation on how to use pipenv in production deployment. My current setup for deploying something to production is like the following:
- Pushing a new version of my package (as wheel) to my internal PyPi server (running pypiserver)
- Setting correct variables like
PIP_INDEX_URL
to my internal PyPi server on the target server - Running
pip install -U my-package
on the target server - Restart webserver
Having the list of requirements parsed from a requirements.txt
into install_requires
in my setup.py
. The requirements.txt
file is included by MANIFEST.in
.
Now I’m courios if it is enough to include Pipfile
and Pipfile.lock
into my package and run pipenv install
on the target production server? Does pipenv automatically use the environment variables like PIP_INDEX_URL
? Or is pip install -U my-package
still the preferred way? I know that there is pipenv lock -r
, but I would like to abandon requirements.txt
completely 😃
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Basic production environment - BMC Documentation
The BMC Atrium Orchestrator Development Studio component is installed on a separate Windows desktop computer. In this configuration, the single ...
Read more >Installation Instructions for production environments - SQUAD
Installation using the Python package manager pip¶. Make sure you have the pip Python package manager installed on your Python 3 environment, and...
Read more >sharp-missing-in-production - Next.js
For a production environment using next start , it is strongly ... Install sharp by running one of the following commands in your...
Read more >Managing Production and Sandbox Environments - Business ...
Use the Business Central administration center to manage your tenant environments, both sandbox and production environments.
Read more >Production Environments - Galaxy Documentation
The basic installation instructions are suitable for development by a single user, but when setting up Galaxy for a multi-user production environment, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@floqqi sorry you had a bad experience, myself and lots of others use pipenv in production and need the functionality so while I am sorry, I’m also interested in productive comments 😃 hope you have a nice day
@exhuma the difference between
setup.py
andrequirements.txt
isn’t anything to do with whether one set of dependencies is concrete or not. Requirements.txt are used for two purposes kind of:The purpose of
setup.py
files is for distribution — they are how your application gets installed into other peoples environments, so not your application plus all of the extra stuff you decided to put into your environment, just your application, what’s needed to support it.Now this is important because production is a pretty good use case for pipenv since you are trying to just recreate your development environment, roughly speaking. First you want to convert your
requirements.txt
to Pipenv. Then you can runpipenv graph
and find your top level dependencies — this is basically what you want in your Pipfile. In yourPipfile
you want to then start ‘unpinning’ those packages by changing frompackage = “==x.y”
topackage = “*”
. Only do this for packages you actually don’t mind upgrading when possible. If there are any specific packages fromrequirements.txt
where keeping their version is important you can pin those here too.Next you can just
pipenv install
— this creates the local copy of everything. If you want to include whatever yoursetup.py
says, you canpipenv install -e .
. This creates aPipfile.lock
which has pinned versions of every package in your environment. Every time you runpipenv install
it updates this file.When you are ready to deploy, you’ll want to include your
Pipfile
andPipfile.lock
and copy them with the rest of your project into production. Then, depending on your process, if you use docker and you don’t want a virtualenv to be created you will need topipenv install —system —deploy
but if you don’t use docker or you do want to have virtualenv creation and management, you can justpipenv install —deploy
Note that the
—deploy
flag simply says to fail if the lockfile and the Pipfile are not in sync, rather than attempting to sync them.Pipfiles replace requirements.txt usage. They don’t replace setup.py.