Bedrock: Bedrock local install fails for Django 2.2

Created on 3 Jul 2019  路  8Comments  路  Source: mozilla/bedrock

Description

While I can run bedrock locally using Docker just fine since https://github.com/mozilla/bedrock/pull/7196 merged, I'm having trouble installing bedrock locally using the instructions in the docs. I'm guessing the docs probably just need updating.

I tried creating a fresh virtualenv using Python 3, but couldn't quite get it to work and figured it's probably best just to file an issue here.

Steps to reproduce

Follow the steps to install bedrock locally in the docs.

Expected result

Bedrock should install and run successfully.

Actual result

When running pip install -r requirements/dev.txt I get the following error:

ERROR: Could not find a version that satisfies the requirement Django==2.2.1 (from -r requirements/base.txt (line 1)) (from versions: 1.1.3, 1.1.4, 1.2, 1.2.1, 1.2.2, 1.2.3, 1.2.4, 1.2.5, 1.2.6, 1.2.7, 1.3, 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.3.6, 1.3.7, 1.4, 1.4.1, 1.4.2, 1.4.3, 1.4.4, 1.4.5, 1.4.6, 1.4.7, 1.4.8, 1.4.9, 1.4.10, 1.4.11, 1.4.12, 1.4.13, 1.4.14, 1.4.15, 1.4.16, 1.4.17, 1.4.18, 1.4.19, 1.4.20, 1.4.21, 1.4.22, 1.5, 1.5.1, 1.5.2, 1.5.3, 1.5.4, 1.5.5, 1.5.6, 1.5.7, 1.5.8, 1.5.9, 1.5.10, 1.5.11, 1.5.12, 1.6, 1.6.1, 1.6.2, 1.6.3, 1.6.4, 1.6.5, 1.6.6, 1.6.7, 1.6.8, 1.6.9, 1.6.10, 1.6.11, 1.7, 1.7.1, 1.7.2, 1.7.3, 1.7.4, 1.7.5, 1.7.6, 1.7.7, 1.7.8, 1.7.9, 1.7.10, 1.7.11, 1.8a1, 1.8b1, 1.8b2, 1.8rc1, 1.8, 1.8.1, 1.8.2, 1.8.3, 1.8.4, 1.8.5, 1.8.6, 1.8.7, 1.8.8, 1.8.9, 1.8.10, 1.8.11, 1.8.12, 1.8.13, 1.8.14, 1.8.15, 1.8.16, 1.8.17, 1.8.18, 1.8.19, 1.9a1, 1.9b1, 1.9rc1, 1.9rc2, 1.9, 1.9.1, 1.9.2, 1.9.3, 1.9.4, 1.9.5, 1.9.6, 1.9.7, 1.9.8, 1.9.9, 1.9.10, 1.9.11, 1.9.12, 1.9.13, 1.10a1, 1.10b1, 1.10rc1, 1.10, 1.10.1, 1.10.2, 1.10.3, 1.10.4, 1.10.5, 1.10.6, 1.10.7, 1.10.8, 1.11a1, 1.11b1, 1.11rc1, 1.11, 1.11.1, 1.11.2, 1.11.3, 1.11.4, 1.11.5, 1.11.6, 1.11.7, 1.11.8, 1.11.9, 1.11.10, 1.11.11, 1.11.12, 1.11.13, 1.11.14, 1.11.15, 1.11.16, 1.11.17, 1.11.18, 1.11.20, 1.11.21, 1.11.22)
ERROR: No matching distribution found for Django==2.2.1 (from -r requirements/base.txt (line 1))

Environment

macOS Mojave 10.14.5

Bug

All 8 comments

I just wrestled with this yesterday for another project.

Django 2.x requires Python 3, so none of those versions are shown when you run pip install with Python 2.7. If you use Python 3, it should go better:

$ virtualenv -p python3 venv                 # create a virtual env in the folder `venv`

However, macOS doesn't include Python 3, and there is no best way to install it. I use Homebrew to install python3, and also pyenv, which can be used to install and switch between multiple Python versions. I'm increasingly using pyenv. It mostly works, but I do have to add some additional steps for some binary packages like database libraries.

Explicitly listing the steps to install Python 3, on multiple platforms, is going to make the local install instructions a lot longer and harder to maintain.

Yeah, on macOS after running virtualenv -p python3 venv I get the following error:

The path python3 (from --python=python3) does not exist

Installing bedrock locally is still required for at least some parts of development, such as running front-end unit tests or cross-browser integratiion tests. It would be good to come to some sort of recommendation in terms of steps, at least for macOS.

Installing bedrock locally is still required for at least some parts of development, such as running front-end unit tests or cross-browser integratiion tests. It would be good to come to some sort of recommendation in terms of steps, at least for macOS.

Is it possible to solve those problems instead? What is preventing us from using the docker environment for those use cases?

To be clear I also sometimes run locally and use pyenv and homebrew installed python3, but it'd be a lot easier for us to support only docker in the docs, and a lot more useful and consistent for everyone. I am personally moving to more docker and less virtualenv as well.

Is it possible to solve those problems instead? What is preventing us from using the docker environment for those use cases?

If we can solve those problems then I'd be more than happy to use Docker exclusively. I believe it's just something that's not been done yet.

I successfully installed bedrock locally using virtualenv -p python3 venv as mentioned by @jwhitlock on Ubuntu 18.04.

One small suggestion instruction for only docker installation may be easier to support but not the best solution, all though I understand it involves more work :sweat_smile:

I actually do think Docker is the best solution. It's what we use in prod, so you can be sure that you have as close to production python environment as possible. There are just too many variables to control for locally. I'm sure it'll remain possible to install it locally if you'd like, but it will be suboptimal in my view.

Fixed in #7379

Was this page helpful?
0 / 5 - 0 ratings