Django ORM - RESETTING THE DATABASE - pipenv install error

Hello_world! This is my first post - ever - on the internet so give me some credit haha…Im basically a noob programmer who had this crazy idea of giving a shot at Django so I can (hopefully) create a humble plataform website with login, CRUD etc, even though i still have a long way to learn all the frontend + react…

So, i got really (really) stuck on [Part 1 of the Django class → Django ORM → 3-Resetting the Database] - and i have no idea how to fix and i don’t know no programmer in the real world to help me smh

On this class, Mosh wants to make sure that we are on the same page, so he tells us to drag and drop into VSCode a specific folder that he makes it available at the beginning of the course.

I followed all the steps but, as soon as i tried to run “pipenv install” on my terminal, i get the following (BIG) error message…here it goes:

Installing dependencies from Pipfile.lock (f41128)...
An error occurred while installing asgiref==3.3.4; python_version >= '3.6' --hash=sha256:d1216dfbdfb63826470995d31caed36225dcaf34f182e0fa257a4dd9e86f1b78 --hash=sha256:92906c611ce6c967347bbfea733f13d6313901d54dcca88195eaeb52b2a8e8ee! Will try again.
An error occurred while installing django==3.2.4 --hash=sha256:66c9d8db8cc6fe938a28b7887c1596e42d522e27618562517cc8929eb7e7f296 --hash=sha256:ea735cbbbb3b2fba6d4da4784a0043d84c67c92f1fdf15ad6db69900e792c10f! Will try again.
An error occurred while installing django-debug-toolbar==3.2.1 --hash=sha256:e759e63e3fe2d3110e0e519639c166816368701eab4a47fed75d7de7018467b9 --hash=sha256:a5ff2a54f24bf88286f9872836081078f4baa843dc3735ee88524e89f8821e33! Will try again.
An error occurred while installing mysqlclient==2.0.3 --hash=sha256:71c4b330cf2313bbda0307fc858cc9055e64493ba9bf28454d25cf8b3ee8d7f5 --hash=sha256:f6ebea7c008f155baeefe16c56cd3ee6239f7a5a9ae42396c2f1860f08a7c432 --hash=sha256:fc575093cf81b6605bed84653e48b277318b880dc9becf42dd47fa11ffd3e2b6 --hash=sha256:3381ca1a4f37ff1155fcfde20836b46416d66531add8843f6aa6d968982731c3 --hash=sha256:0ac0dd759c4ca02c35a9fedc24bc982cf75171651e8187c2495ec957a87dfff7! Will try again.
An error occurred while installing pytz==2021.1 --hash=sha256:eb10ce3e7736052ed3623d49975ce333bcd712c7bb19a58b9e2089d4057d0798 --hash=sha256:83a4a90894bf38e243cf052c8b58f381bfe9a7a483f6a9cab140bc7f702ac4da! Will try again.
An error occurred while installing sqlparse==0.4.1; python_version >= '3.5' --hash=sha256:0f91fd2e829c44362cbcfab3e9ae12e22badaa8a29ad5ff599f9ec109f0454e8 --hash=sha256:017cde379adbd6a1f15a61873f43e8274179378e95ef3fede90b5aa64d304ed0! Will try again.
  🐍   ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 6/6 — 00:00:03
Installing initially failed dependencies...
[pipenv.exceptions.InstallError]: Collecting asgiref==3.3.4
[pipenv.exceptions.InstallError]:   Using cached asgiref-3.3.4-py3-none-any.whl (22 kB)
[pipenv.exceptions.InstallError]: Installing collected packages: asgiref
[pipenv.exceptions.InstallError]: ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: '/Users/joaoarthurbandeira/.local/share/virtualenvs/storefront-i8ah_EvC/lib/python3.9/site-packages/asgiref'
[pipenv.exceptions.InstallError]: Check the permissions.
ERROR: Couldn't install package: asgiref
 Package installation failed...
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py:1052: ResourceWarning: subprocess 56425 is still running
  _warn("subprocess %s is still running" % self.pid,
ResourceWarning: Enable tracemalloc to get the object allocation traceback
sys:1: ResourceWarning: unclosed file <_io.FileIO name=14 mode='rb' closefd=True>
ResourceWarning: Enable tracemalloc to get the object allocation traceback
sys:1: ResourceWarning: unclosed file <_io.FileIO name=17 mode='rb' closefd=True>
ResourceWarning: Enable tracemalloc to get the object allocation traceback
  ☤  ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 5/6 — 00:00:04
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py:1052: ResourceWarning: subprocess 56421 is still running
  _warn("subprocess %s is still running" % self.pid,
ResourceWarning: Enable tracemalloc to get the object allocation traceback
sys:1: ResourceWarning: unclosed file <_io.TextIOWrapper name=5 encoding='utf-8'>
ResourceWarning: Enable tracemalloc to get the object allocation traceback
sys:1: ResourceWarning: unclosed file <_io.TextIOWrapper name=8 encoding='utf-8'>
ResourceWarning: Enable tracemalloc to get the object allocation traceback
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py:1052: ResourceWarning: subprocess 56422 is still running
  _warn("subprocess %s is still running" % self.pid,
ResourceWarning: Enable tracemalloc to get the object allocation traceback
sys:1: ResourceWarning: unclosed file <_io.TextIOWrapper name=7 encoding='utf-8'>
ResourceWarning: Enable tracemalloc to get the object allocation traceback
sys:1: ResourceWarning: unclosed file <_io.TextIOWrapper name=10 encoding='utf-8'>
ResourceWarning: Enable tracemalloc to get the object allocation traceback
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py:1052: ResourceWarning: subprocess 56423 is still running
  _warn("subprocess %s is still running" % self.pid,
ResourceWarning: Enable tracemalloc to get the object allocation traceback
sys:1: ResourceWarning: unclosed file <_io.TextIOWrapper name=9 encoding='utf-8'>
ResourceWarning: Enable tracemalloc to get the object allocation traceback
sys:1: ResourceWarning: unclosed file <_io.TextIOWrapper name=13 encoding='utf-8'>
ResourceWarning: Enable tracemalloc to get the object allocation traceback
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py:1052: ResourceWarning: subprocess 56424 is still running
  _warn("subprocess %s is still running" % self.pid,
ResourceWarning: Enable tracemalloc to get the object allocation traceback
sys:1: ResourceWarning: unclosed file <_io.TextIOWrapper name=11 encoding='utf-8'>
ResourceWarning: Enable tracemalloc to get the object allocation traceback
sys:1: ResourceWarning: unclosed file <_io.TextIOWrapper name=15 encoding='utf-8'>
ResourceWarning: Enable tracemalloc to get the object allocation traceback

So, what could it be and how can i fix it?

I tried to google it - with no success.
I had python 3.10 and tried to download the same version as Mosh (3.9.5), also with no success…
I honestly don’t know what to do anymore.

Any help would be really great!
Cheers!

1 Like

Did you find a solution to the error?

Not really…still stuck in this part.

Anyone knows the solution to this?

hi,
i think this might help.
on your cmd after opening your project type this:
py -m venv env
this will install the virtual environment .

Remove the existing virtual environment with the following command:

pipenv --rm

and then start over

Hi I’m having the same issue. But when I remove the virtual environment it still doesn’t work.

Any solutions to this issue. I can’t reset the database with pipenv install

Hi did you find a solution to this? I’m stuck at the same section of the course.

Any help appreciated. How did you solve this issue?

I think you are stuck when installing the dependencies using pipenv install. I also got stuck at this part but what I did was to remove the mysqlclient from pipfile and install it again using pipenv install mysqlclient

I had to change a lot of things to make this work.
I had to remove asgiref, django, django-debug-toolbar from the pipfile.lock
New file looks like this:

{
    "_meta": {
        "hash": {
            "sha256": "d4baaad3f8626019fccf6063124f0e345e6c23c0a713f10cc387b42e4cf41128"
        },
        "pipfile-spec": 6,
        "requires": {
            "python_version": "3.9"
        },
        "sources": [
            {
                "name": "pypi",
                "url": "https://pypi.org/simple",
                "verify_ssl": true
            }
        ]
    },
    "default": {
        "pytz": {
            "hashes": [
                "sha256:83a4a90894bf38e243cf052c8b58f381bfe9a7a483f6a9cab140bc7f702ac4da",
                "sha256:eb10ce3e7736052ed3623d49975ce333bcd712c7bb19a58b9e2089d4057d0798"
            ],
            "version": "==2021.1"
        },
        "sqlparse": {
            "hashes": [
                "sha256:017cde379adbd6a1f15a61873f43e8274179378e95ef3fede90b5aa64d304ed0",
                "sha256:0f91fd2e829c44362cbcfab3e9ae12e22badaa8a29ad5ff599f9ec109f0454e8"
            ],
            "markers": "python_version >= '3.5'",
            "version": "==0.4.1"
        }
    },
    "develop": {}
}

Then I had to pipenv install
Then pull up command pallet > select interpreter > select the new pipenv.
Then:
pipenv install asgiref
pipenv install django
pipenv install django-debug-toolbar
pipenv install mysqlclient

Hope this helps