0

I guess it's going to be obvious in a few seconds but I am fairly new to web development.

I am learning how to use Django and I encountered an issue with allauth after having installed it through pipenv and tried to migrate. I got a lovely ModuleNotFoundError: No module named 'allauth'. As I said, I installed it through pipenv and I could see allauth in my .venv/Lib/site-packages file. I have my virtual environment set and activated.

A quick research and thanks to this answer, I solved my issue by "reinstalling" it with pip install allauth, and my migration is now working fine.

What I don't understand is, wasn't it already installed when I did pipenv install allauth, do I need to install everything once with pipenv to get the Pipfile & Pipfile.lock updated and then also install it through pip...?

Obviously, I don't fully understand the difference between pipenv & pip, if some charitable soul would be kind enough to explain this to me, I'd greatly appreciate it :)

Edit: I saw this thread already but either way I am stupid or whatever but it still doesn't make much sense to me.

LuciusVH
  • 13
  • 1

1 Answers1

0

so, you said pip install allauth fixed the issue for you. But that might be because it installed the package GLOBALLY, and you definitely don't wanna do that.

Rather, you should try reinstalling using pipenv itself. It has happened to me before and got fixed this way.

In case if that didn't work, try removing and re-setuping the virtual env -
pipenv --rm
pipenv shell
pipenv install

Difference between PIP & PIPENV

In a very layman's language,

pip is a package installing manager itself used to install other packages like panda, pillow, django, virtualenv... etc

pipenv, on the other hand, is a package created to simplifies the burden of using virtualenv and pip seperately. (I'm assuming you know how virtualenv works)

You don't need pipenv if you are using virtualenv with pip. But I would anyday recommend to use pipenv because who wants pain right?

To understand more, I think you should also research (google) VIRTUALENV vs PIPENV. That'll definitely help.

Reference URL
https://pypi.org/project/pipenv/#:~:text=You%20no%20longer%20need%20to%20use%20pip%20and%20virtualenv%20separately.%20They%20work%20together

  • Hi! Thank you for answering :) I used `pip install allauth` with my venv activated so, if I got it right... it can't have installed it globally, can it? Can I verify that? Thanks for your Google search suggestion, I did check pip/pipenv but not virtualenv/pipenv. It has lead me to this [thread](https://stackoverflow.com/questions/41573587/) which was a good source of info :) – LuciusVH Dec 02 '21 at 19:26