Chapter 1: Runserver Segmenation Fault

1,012 views
Skip to first unread message

Ronnie Raney

unread,
Apr 3, 2017, 3:26:48 PM4/3/17
to Obey the testing goat! Test-Driven Web Development with Python book
Hello all. Here's my issue: 
 
I am getting a 'segmentation fault' error when I try to start the development server. Specifically when I run the command:
$ python3 manage.pyrunserver

A little background:
  • Working in Windows 7
  • Using Git Bash
  • Installed Python 3.6
  • Installed Django 1.10.6
  • Installed Selenium 3.3.1
  • Downloaded Firefox geckodriver - included path in system path variables
  • Created a symlink in the Git Bash binaries folder to python.exe
I created the functional_tests.py file, and Firefox opens. I created a Django project called 'superlists' and that worked okay. When I try to start the server, it simply says 'Segmentation Fault'.

I have searched for solutions for some time today, and nothing is working. I tired reinstalling Python, making sure that the path to Python is in the system variables, and I've made sure that no process is using port 8000. Incidentally, I can start an interactive Python shell.

Hopefully someone knows exactly what may have happened, or things that I might be able to try.

Thanks in advance,
RR

Ronnie Raney

unread,
Apr 3, 2017, 3:38:05 PM4/3/17
to Obey the testing goat! Test-Driven Web Development with Python book
*typo - there there should be a space between 'manage.py' and 'runserver'


Harry Percival

unread,
Apr 3, 2017, 4:11:13 PM4/3/17
to Ronnie Raney, Obey the testing goat! Test-Driven Web Development with Python book
Hi Ronnie,

of the steps you describe, two of them aren't quite in sync with the latest version of the book:

* Installed Django 1.10.6  <-- shld be 1.11rc1
* Created a symlink in the Git Bash binaries folder to python.exe  <-- this is not needed, because we're using a virtualenv.

Have another go at the installation instructions?  http://www.obeythetestinggoat.com/book/pre-requisite-installations.html

And maybe one more go at uninstalling and reinstalling python?  To check you haven't got multiple copies installed somehow, try:

- uninstalling python 3, then
 py -3.6 -c"import sys; print(sys.executable)"
 py -3 -c"import sys; print(sys.executable)"

if either of those still work after you've uninstalled python then there's two copies hanging around somehow, and you may need to do extra clearning up.

PS - one more thing, if you *were* using a virtualenv all the way along, make sure you delete your virtualenv with
 rmvirtualenv superlists

as well.

hope one of those helps!


On Mon, 3 Apr 2017 at 20:38 Ronnie Raney <thero...@gmail.com> wrote:
*typo - there there should be a space between 'manage.py' and 'runserver'


--
You received this message because you are subscribed to the Google Groups "Obey the testing goat! Test-Driven Web Development with Python book" group.
To unsubscribe from this group and stop receiving emails from it, send an email to obey-the-testing-go...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

--
Harry Percival
+44 78877 02511

Ronnie Raney

unread,
Apr 3, 2017, 4:36:10 PM4/3/17
to Harry Percival, Obey the testing goat! Test-Driven Web Development with Python book
Anxious to try these tomorrow morning. Thank you for the quick response!

Ron Raney

> On Apr 3, 2017, at 3:11 PM, Harry Percival <harry.p...@gmail.com> wrote:
>
> installation

Ronnie Raney

unread,
Apr 4, 2017, 9:26:24 AM4/4/17
to Obey the testing goat! Test-Driven Web Development with Python book, thero...@gmail.com
Good morning.

As suggested, I re-installed Python 3.6.1. I used the commands you provided to search for previous versions and nothing was there. Python is installed and I can access it through Git Bash. 

I am now following the installation instructions from your online version of the book (I was using the printed first edition). I successfully installed the newest versions of Firefox and geckodriver. I checked for versions for Python, pip and geckodriver in Git Bash, and success so far.

As the book suggests, I ran this bit of code in Git bash to install virtualenvwrapper:
pip install --user virtualenvwrapper
echo "source virtualenvwrapper.sh" >> ~/.bashrc
source ~/.bashrc
 
Next I ran this bit of code and it says the command is 'not found':
mkvirtualenv --python=`py -3.6 -c"import sys; print(sys.executable)"` superlists
# (a little hack to make sure we get a python 3.6 virtualenv)

I checked the Environment Variables. Both the user and system 'Path' variables show paths to Python36 and Python36/Scripts.

When I re-opened Git Bash, it game me a Warning: Found ~/.bashrc but no ~/.bash_profile, ~/.bash_login or ~/.profile. It then said it would create a ~/.bash_profile that loads ~/.bashrc. 

As it stands, I need to get past this issue before I install Django again, and see if I can get the development server working. Any suggestions much appreciated!

Ronnie Raney

unread,
Apr 4, 2017, 9:35:10 AM4/4/17
to Obey the testing goat! Test-Driven Web Development with Python book
One more piece of information:

My Git bash now says this at the top:
bash: virtualenvwrapper.sh: No such file or directory

Harry Percival

unread,
Apr 4, 2017, 10:33:33 AM4/4/17
to Ronnie Raney, Obey the testing goat! Test-Driven Web Development with Python book

It sounds like the --user directory isn't on your path. Since you're on windows, you could just do a

  pip install virtualenvwrapper

And get it installed system-wide.  My hope is that that will get rid of the "no such file or directory" error if you re-open git bash, and that mkvirtualenv and workon will then start working.


--
You received this message because you are subscribed to the Google Groups "Obey the testing goat! Test-Driven Web Development with Python book" group.
To unsubscribe from this group and stop receiving emails from it, send an email to obey-the-testing-go...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ronnie Raney

unread,
Apr 4, 2017, 12:57:38 PM4/4/17
to Obey the testing goat! Test-Driven Web Development with Python book, thero...@gmail.com
Some emails were left out of this discussion...

Me: 
Thanks very much for your help. I tried this and the "bash: virualenvwrapper.sh: No such file or directory" message is still there. It says that the requirements had already been satisfied. It's located in  the local and roaming folders, under Python36\site-packages. 

Do you happen to know how to reverse the installation commands that are in the book? Should I perhaps re-install GitHub to "blow up" whatever is causing the problem? These are the commands that caused the issue:

As the book suggests, I ran this bit of code in Git bash to install virtualenvwrapper:
pip install --user virtualenvwrapper
echo "source virtualenvwrapper.sh" >> ~/.bashrc
source ~/.bashrc
 
Next I ran this bit of code and it says the command is 'not found':
mkvirtualenv --python=`py -3.6 -c"import sys; print(sys.executable)"` superlists
# (a little hack to make sure we get a python 3.6 virtualenv)

Harry:
Try pip uninstall virtualenvwrapper and then pip install virtualenvwrapper?

Me:
This worked! I created the superlists environment. I am able to activate and deactivate. So far so good.

I installed django and selenium. I ran the functional_tests.py file. I created the superlists Django project.

When running 'python manage.py runserver', I no longer get the segmentation fault, but I also get no response. I will try restarting the PC.

Ronnie Raney

unread,
Apr 4, 2017, 12:59:27 PM4/4/17
to Obey the testing goat! Test-Driven Web Development with Python book, thero...@gmail.com
The command 'python manage.py runserver' is doing nothing. There is no indication that the server is working. Nothing was printed to the bash.

Ronnie Raney

unread,
Apr 5, 2017, 10:09:15 AM4/5/17
to Obey the testing goat! Test-Driven Web Development with Python book, Ronnie Raney
I am uninstalling everything and starting over. Thanks for your help. It seems there is not hope getting this set up in Windows.

Harry Percival

unread,
Apr 5, 2017, 10:12:02 AM4/5/17
to Ronnie Raney, Obey the testing goat! Test-Driven Web Development with Python book
Let me know how you get on the second time around!  I think I will change the instructions to say use "pip install virtualenvwrapper" on windows, but other than that, I'm confident everything does work on windows (or at least it works on my windows boxes)...

--
You received this message because you are subscribed to the Google Groups "Obey the testing goat! Test-Driven Web Development with Python book" group.
To unsubscribe from this group and stop receiving emails from it, send an email to obey-the-testing-go...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages