#100DaysOfWeb in Python Transcripts
Chapter: Days 61-64: Database migrations
Lecture: Fix an error: Alembic distribution not found

Login or purchase this course to watch this video and the rest of the course contents.
0:00 Before we move on
0:01 I actually just saw a weird error happening here.
0:04 And I honestly don't know why Python's not figuring this out
0:07 but I want to just make a quick change
0:09 in case you also run into this error.
0:10 So we added alembic here as a dependency of this thing
0:14 and we of course installed it as you can see.
0:18 We have alembic installed right there at the top
0:20 but when I run it, we get this weird alembic distribution
0:24 was not found and is required.
0:26 It's like the requirement statement of our package
0:30 somehow is telling Python alembic is required
0:33 and Python thinks it's not there and yet it's there.
0:36 Anyway because we should be able to say
0:39 import alembic and guess what, it's there.
0:42 Anyway, let's get around that problem.
0:44 We've already installed this, so let's just go over here
0:47 and shift away from entirely using the setup file
0:51 and to over to a requirements file
0:52 so we'll say pip freeze, which gives us a list
0:55 of all of our things.
0:56 We can pip freeze into requirements.txt
1:01 if you look here we have our requirements.txt
1:06 which looks just like that.
1:08 And now we can pip install -r requirements.txt like that.
1:11 Of course this is a little bit crazy
1:13 'cause the one other thing we want to change is
1:15 it thinks it's trying to reinstall this.
1:20 There we go.
1:21 Now we should be able to pip install our requirements
1:24 everything's good and if you did this you need to
1:27 rerun one more time the setup development.py
1:31 now if we run it we still get an error
1:33 but the error we're hoping for.
1:35 Okay, not sure what was up there
1:36 but I wanted to make sure I put this video in here
1:38 because I could've mislead you
1:40 or maybe you ran into the same problem, so just
1:42 take that alembic out of your setup, should be fine
1:45 but for some reason it wasn't.