10π
I found an alternative solution.
With find / -name django-admin
I found django-admin in myHome/.local/bin/django-admin
.
So instead of django-admin startproject mysite
I use the full path myHome/.local/bin/django-admin startproject mysite
thanks to @Evert, this is why I got the problem.
his comment:
This is likely because you either used the --user option to pip
install, or you set up pip in such a way that it automatically does
that. Hence, everything gets installed in $HOME/.local. You may want
to add $HOME/.local/bin to your $PATH for the future.
12π
I faced a similar issue on Mac OS but I moved in another way. I used Virtual Environments.
First, create the virtual environment
python3 -m venv django-env
Then, use this environment
source django-env/bin/activate
Next, install django
python -m pip install django
Finally test django is working
django-admin startproject mysite
In my opinion, it is better to have environments isolated to avoid O.S. settings
9π
When I had the problem on my mac I just uninstall django and install it again but with root permissions. Now itβs working good)
pip3 uninstall django
sudo pip3 install django
- [Django]-Crontab is running but still not executing command Django
- [Django]-Getting 'TooBig' Memcachier exception on a Django Rest Framework response on Heroku
- [Django]-Errors running geodjango based apps on heroku
- [Django]-.js files not included in page when using Django Form Assets (Media class) with crispy forms
- [Django]-Django AMQP error
1π
I was facing the same problem after updating my Mac OS to Catalina, and shell from bash to zsh.
None of the commands would work, as if all my paths were deleted.
Looking at Brady Huangβs answer, doing something similar worked for me.
I made sure django was installed correctly by reinstalling it
pip3 uninstall django
pip3 install django
I found django installed under:
/Library/Frameworks/Python.framework/Versions/3.8/bin/django-admin
by running:
sudo ln -s /Library/Frameworks/Python.framework/Versions/3.8/bin/django-admin usr/local/bin
I was able to run django-admin again.
- [Django]-Passing context from child to parent template in Django
- [Django]-Click in a dropdown option and show an specific field in Django
- [Django]-How to set headers in DRF's APIClient() delete() request?
- [Django]-How to properly show image stored from a remote file server to a django HTML template?
- [Django]-Django: How to dynamic filter foreignkey choices by Customizing the Django_Admin
0π
My adjango-admin is located in
~/Library/Python/3.7/bin/django-admin
But I donβt have it in my linked PATH which is looks like this
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/mysql/bin
So I create a symlink to one of the bin I have in my PATH
sudo ln -s ~/Library/Python/3.7/bin/django-admin /usr/local/bin
It solves my issue
- [Django]-Django 1.6 + RabbitMQ 3.2.3 + Celery 3.1.9 β why does my celery worker die with: WorkerLostError: Worker exited prematurely: signal 11 (SIGSEGV)
- [Django]-How do i make a functioning Delete confirmation popup in Django using Bootstrap4 Modal
- [Django]-Deploying django app with heroku β gunicorn not installing
0π
You may be having some dependency issues.
So to avoid it happen again you need to create a virtual environment only for the current project you are doing. Like this you can avoid having issues and isolate your application.
You can follow this question to create a virtual environment and add django in it.
Then, as soon as you create the virtual environment and activated you can pip install django and check to see whether it is installed.
- [Django]-Django ignoring translated strings from third party module
- [Django]-Django 1054 β Unknown Column in field list
- [Django]-Django Rest Framework doesn't accept ArrayField POST
- [Django]-Unknown command: 'collectstatic' Django 1.7
- [Django]-Django 2 upgrade lost filter_horizontal functionality
0π
Tried many stuffs but then installing the python version 3.11 and using a virtual env solved the issue. Earlier I was using 3.8.9. Hope this helps someone
0π
what worked for me!
-
I just Added the following in my ~/.zshrc file( you can also add it in the ~/.bashrc file if you are not using zsh terminal)
export PATH=$PATH:$HOME/.local/bin
This solution will work not only for you django-admin command but all other python package commands that would behave in a similar way.
- [Django]-Django group query by day with timezone specification
- [Django]-How to get Django QuerySet 'exclude' to work right?