DjangoGirls / tutorial

This is a tutorial we are using for Django Girls workshops
http://tutorial.djangogirls.org/
Other
1.53k stars 1.86k forks source link

Env setup instructions not sufficient for Ubuntu 14.04 #58

Closed eddie-dunn closed 10 years ago

eddie-dunn commented 10 years ago

Following the tutorial instructions will not work cleanly on Ubuntu 14.04; I encountered issues with both the virtual environment and the PostgreSQL setup instructions:

Virtualenv:

$ python3 -m venv venv
Error: Command '['/home/eddie/Slask/tmp/venv/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1

PostgreSQL:

$ psql
psql: FATAL:  role "eddie" does not exist

I managed to solve the problems with some googling, but since this is supposed to be a very n00b-friendly guide, that should not be required.

The virtualenv-issue can be solved by installing python-virtualenv and then using the virtualenv-command instead of the command supplied in the tutorial. A fix for the problem is submitted upstream but I have no idea when it will trickle down to Trusty Tahr.

From what I can determine, the psql issue is due to the fact that, by default, only the user postgres has access to the PostgreSQL server by default. I solved it by adding myself as a PostgreSQL superuser, and editing some config files.

I can update the documentation to include the solutions to these issues. Would you like a pull request?

oinopion commented 10 years ago

Hi Eddie,

Thanks for your report.

We're working actively on tutorial in this very moment. We've actually decided to get rid of PostgreSQL from initial tutorial and save it as a task for more advanced people.

As for problem with venv... We can't use python-virtualenv, because this will work only on ubuntu and not on Mac and Windows. Could you tell me what Python version are you using by running python3 --version?

eddie-dunn commented 10 years ago

$ python3 --version

Python 3.4.0

However, the problem is not with the Python version I'm running, but rather with the way Debian/Ubuntu packages it. As I understand it, the tl;dr of the bug report I referenced above is that the Debian packaging rules don't support the bundling of pip with the Python3 package. So in other words, the module ensurepip is not available by default. As I said, there is a fix for this committed upstream, but nobody knows when it will come to Ubuntu 14.04. I think using virtualenv should be proposed as a temporary fix until then, as it's the easiest way to get around the problem that I found.

I've been thinking about introducing our two summer interns to the Django Girls tutorial next week, so it would be nice if it worked with the current LTS version of Ubuntu by then :)

BTW, I'm also at EuroPython, currently sitting next to the 'acab-streetlife' wall if you would rather discuss it in person (I'm not sure where you guys are sitting).

oinopion commented 10 years ago

I could not find you. We're sitting in main sprints area, just by the window. Come and say "Hi" :-)

oinopion commented 10 years ago

We'll add the python-virtualenv workaround to the tutorial. Would be really if we got pull request with this :sunglasses:

eddie-dunn commented 10 years ago

All right, cool. I'll send one soonish.

eddie-dunn commented 10 years ago

Sent pull request #66