Pipenv: How to install prerelease version using pipenv?

Created on 24 Oct 2017  路  8Comments  路  Source: pypa/pipenv

I tried installing Django prelease using pipenv, here are the steps I followed

  • pipenv lock --pre

  • pipenv install --pre Django

And when I check the pip freeze it shows me correct version of the Django

(fiobot-dPUFI04r) simon@ENGINE:~/Nightybuild/fiobot$ pip freeze
Django==2.0b1
gunicorn==19.7.1
pytz==2017.2

However when I looked into Pipfile.lock it shows this "version": "==1.11.6"

I deployed to Heroku my code doesn't run because my code needs pre release version of Django how to solve this ?

My environment
  1. OS Type: Ubuntu 16.04 LTS
  2. Python version: Python 3.6.3
  3. Pipenv version: pipenv, version 8.2.7
Type

Most helpful comment

It looks like the allow_prerelease environment marker isn't respected when you do pipenv lock. You have to do pipenv lock --pre or pipenv install --pre django for now. pipenv install relocks the file by default so it uses the --pre flag. For now you'll have to use either of those two methods until we get the bug fixed!

All 8 comments

A couple of things:

  1. Please provide your pipfile
  2. You shouldn鈥檛 run pipenv from inside it鈥檚 own shell. It won鈥檛 work.
  3. You can鈥檛 lock things before you install them, the workflow is the other way around
  4. Installing things implicitly locks them so you shouldn鈥檛 need to run lock right after an install

So you will need to exit the subshell, and start over. If you want a specific pinned release of Django you should install that explicitly as well, but if you want to allow prereleases all you need to do is run: pipenv install 鈥攑re

Oh here is my Pipfile. And I can't mention the exact version of Django in package because that's not working.

[[source]]

url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"


[dev-packages]



[packages]

django = "*"
gunicorn = "*"


[requires]

python_version = "3.6"


[pipenv]

allow_prereleases = true

So I just installed Django with the --pre flag, It works as expected. In my Pipfile.lock I have the following entry for Django.

"django": {
    "hashes": [
        "sha256:5e7f0d33a1908070d81ffea029c7c69f7b8aa9c95fa2415885ea3c970c2cf8e0"
    ],
    "version": "==2.0b1"
}

It looks like the beta version of Django 2 is installed. If your code isn't working is it possible it relies on an alpha that isn't in pypi?

I'm just checking around the Django 2.0. I can't believe it's worked for you. I think it happens because of my machine even though I clear cache and everything still not works. Is it possible to use that hashes value in my project to install the pre release of Django ?

can you lock your Pipfile and post it?

You mean my Pipfile.lock or Pipfile ?

This is my Pipfile

[[source]]

url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"


[dev-packages]



[packages]

gunicorn = "*"
django = "*"


[requires]

python_version = "3.6"


[pipenv]

allow_prereleases = true

Pipfile.lock

{
    "_meta": {
        "hash": {
            "sha256": "0f9748b3cc9cd1a17d1640c919a06ab04bae217b3cca2199271ba34d3948d763"
        },
        "host-environment-markers": {
            "implementation_name": "cpython",
            "implementation_version": "3.6.1",
            "os_name": "posix",
            "platform_machine": "x86_64",
            "platform_python_implementation": "CPython",
            "platform_release": "17.0.0",
            "platform_system": "Darwin",
            "platform_version": "Darwin Kernel Version 17.0.0: Thu Aug 24 21:48:19 PDT 2017; root:xnu-4570.1.46~2/RELEASE_X86_64",
            "python_full_version": "3.6.1",
            "python_version": "3.6",
            "sys_platform": "darwin"
        },
        "pipfile-spec": 6,
        "requires": {
            "python_version": "3.6"
        },
        "sources": [
            {
                "name": "pypi",
                "url": "https://pypi.python.org/simple",
                "verify_ssl": true
            }
        ]
    },
    "default": {
        "django": {
            "hashes": [
                "sha256:7ab6a9c798a5f9f359ee6da3677211f883fb02ef32cebe9b29751eb7a871febf",
                "sha256:c3b42ca1efa1c0a129a9e863134cc3fe705c651dea3a04a7998019e522af0c60"
            ],
            "version": "==1.11.6"
        },
        "gunicorn": {
            "hashes": [
                "sha256:75af03c99389535f218cc596c7de74df4763803f7b63eb09d77e92b3956b36c6",
                "sha256:eee1169f0ca667be05db3351a0960765620dad53f53434262ff8901b68a1b622"
            ],
            "version": "==19.7.1"
        },
        "pytz": {
            "hashes": [
                "sha256:c883c2d6670042c7bc1688645cac73dd2b03193d1f7a6847b6154e96890be06d",
                "sha256:03c9962afe00e503e2d96abab4e8998a0f84d4230fa57afe1e0528473698cdd9",
                "sha256:487e7d50710661116325747a9cd1744d3323f8e49748e287bc9e659060ec6bf9",
                "sha256:43f52d4c6a0be301d53ebd867de05e2926c35728b3260157d274635a0a947f1c",
                "sha256:d1d6729c85acea5423671382868627129432fba9a89ecbb248d8d1c7a9f01c67",
                "sha256:54a935085f7bf101f86b2aff75bd9672b435f51c3339db2ff616e66845f2b8f9",
                "sha256:39504670abb5dae77f56f8eb63823937ce727d7cdd0088e6909e6dcac0f89043",
                "sha256:ddc93b6d41cfb81266a27d23a79e13805d4a5521032b512643af8729041a81b4",
                "sha256:f5c056e8f62d45ba8215e5cb8f50dfccb198b4b9fbea8500674f3443e4689589"
            ],
            "version": "==2017.2"
        }
    },
    "develop": {}
}

It looks like the allow_prerelease environment marker isn't respected when you do pipenv lock. You have to do pipenv lock --pre or pipenv install --pre django for now. pipenv install relocks the file by default so it uses the --pre flag. For now you'll have to use either of those two methods until we get the bug fixed!

@rajasimon This is fixed in master now!

Was this page helpful?
0 / 5 - 0 ratings