Have you noticed that recommendation for Managing Application Dependency at python.org has been changed? Apparently our python community should use now Pipenv. But how to? Let's check out!
You can check Readme for pypenv at their github repository to find out what problems it solves :) I encourage you to do that !
Let's get started!
So first things first - What do we need for Pipenv ?
pip- you can find out how to get pip here - but for most of the
*nixusers - you should already have pip packaged with your system.
pip install pipenv
Adding a shell-completion!
Put command below into your
eval "$(pipenv --completion)"
Let's make some day-to-day tasks with pipenv:
Create new project using python3.6
First let's make a project with :
mkdir pipenv_test_project cd pipenv_test_project git init . git commit --allow-empty -m "Init" git remote add origin email@example.com:anselmos/pipenv_test_project.git git push origin HEAD:master
Initialize pipenv at project
And now initialize pipenv at the
pipenv --python 3.6
Activating pipenv at project
REMEMBER - you need to be in the root path of the project.
Install all dependences including dev:
pipenv install --dev
This will create a
Let's install some dependency i.e. selenium
pipenv install selenium
And your Pipfile and Pipfile.lock has been changed.
Installing old version of pelican and upgrading
pipenv install pelican==3.6.0
Upgrading to latest version of pelican
pipenv install pelican
Which will automatically check version and install the latest - 3.7.1 ! Yeah.
pipenv uninstall pelican
The project for this article is available here.
That was an introduction to pipenv - if you need a more advanced stuff - check documentation or
- Pipenv docs
- Pipenv github repo
- Pipenv official for recommended tools #1453 issue on pipenv
- A Better Pip Workflow
- Tool Recommendations
- pip - "Pip installs Python"
That's it :) Comment, share or don't :)
If you have any suggestions what I should blog about in the next articles - please give me a hint :)
See you tomorrow! Cheers!