#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 I actually just saw a weird error happening here. And I honestly don't know why Python's not figuring this out
0:08 but I want to just make a quick change in case you also run into this error. So we added alembic here as a dependency of this thing
0:15 and we of course installed it as you can see. We have alembic installed right there at the top
0:21 but when I run it, we get this weird alembic distribution was not found and is required. It's like the requirement statement of our package
0:31 somehow is telling Python alembic is required and Python thinks it's not there and yet it's there. Anyway because we should be able to say
0:40 import alembic and guess what, it's there. Anyway, let's get around that problem. We've already installed this, so let's just go over here
0:48 and shift away from entirely using the setup file and to over to a requirements file so we'll say pip freeze, which gives us a list
0:56 of all of our things. We can pip freeze into requirements.txt if you look here we have our requirements.txt which looks just like that.
1:09 And now we can pip install -r requirements.txt like that. Of course this is a little bit crazy 'cause the one other thing we want to change is
1:16 it thinks it's trying to reinstall this. There we go. Now we should be able to pip install our requirements
1:25 everything's good and if you did this you need to rerun one more time the setup development.py now if we run it we still get an error
1:34 but the error we're hoping for. Okay, not sure what was up there but I wanted to make sure I put this video in here because I could've mislead you
1:41 or maybe you ran into the same problem, so just take that alembic out of your setup, should be fine but for some reason it wasn't.

Talk Python's Mastodon Michael Kennedy's Mastodon