Comments (3)
Yes, I think you are correct. I've updated the newer versions of the book to use Python 3.8 but this is a very likely gotcha for newcomers. Thank you for pointing it out. I like your idea of using the requires
feature; I think I'll use that in the new text!
from djangoforprofessionals.
I ran into an error, which I've fixed, but that could be a trap for new users. It stems from having a system install of python 3.8, and the book (sample at least) relying on python 3.7. Admittedly your prior book does have extensive and useful dev environment set-up instructions, but not this one.
I have python 3.8 installed on my system as the user default. Therefore, the
piplock
file will default to:[requires] python_version = "3.8"When you get to install the psycopg2 package, the error that is thrown is:
❯ docker-compose exec web pipenv install psycopg2-binary==2.8.3 Warning: Python 3.8 was not found on your system… Neither 'pyenv' nor 'asdf' could be found to install Python. You can specify specific versions of Python with: $ pipenv --python path/to/pythonI believe the error arises from how the
Dockerfile
and thepiplock
at this point differ, with theDockerfile
specifying 3.7. If thepiplock
gets changed manually to 3.7 however, then the install runs as expected.A potential guarantee may be adding the
--python 3.7
on pipenv creation.
I'm not sure what you mean by "adding --python 3.7
on pipenv creation" can you please explain?
from djangoforprofessionals.
@lapulgaatomica pipenv is a way of managing environments and dependencies for python.
https://pypi.org/project/pipenv/
In this particular case, and from memory now almost a year back @wsvincent in his (great) books, I think introduces people following through the work on their computers in a way that encourages them to use pipenv to set up their projects. In this case I was making a (soft) recommendation that for future copies of the book he includes the instruction to run pipenv --python 3.7
as this will set the project up in a way that, at the time, fixed a dependcy issue with psychopog2.
If you go the website listed above and look at the usage section on the front page it says:
"Usage Examples:
Create a new project using Python 3.7, specifically:
$ pipenv --python 3.7"
this is what I was referring to.
Hope that helps :)
from djangoforprofessionals.
Related Issues (20)
- Heroku Django media not loading HOT 2
- [Chapter 16 - Security] Issue with DJANGO_DEBUG HOT 3
- Unable to reset database HOT 1
- CH8 - Environment Variables - Import environs could not be resolved
- Chapter 11: Foreign Keys HOT 1
- Chapter 8: Environs import not working HOT 1
- Remove the file db.sqlite3 from the repo HOT 1
- Chapter 16 issues with CSRF tokens HOT 1
- Media Files directory HOT 1
- Chapter 8 aullauth logout redirect issue HOT 3
- Invalid Link HOT 1
- Typo in the book on page 258 HOT 1
- Published link to book cover is 404 HOT 1
- Home and About AssertTemplateUsed Tests Fail Starting In Chapter 16 HOT 1
- [ch 2] docker-compose.yml, permission denied HOT 2
- Chapter 10: Email // Clicking on the unique URL link in the email HOT 1
- Ch17, Page 256: "DJANGO_DEBUG=False" creates bugs HOT 1
- Accounts test fail after following steps for adding Social in Chapter 8 HOT 1
- Chp3 Books: Accounts migration failing HOT 1
- Chapter 2 creating superuser in Linux (root vs current user)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from djangoforprofessionals.