0

Trying to learn python/django but cant even install django when i do virtualenv . or use the pip command, neither of them work on mac. python -V is 2.7.16, python3 -V is 3.8.2.

pip command not found, virtualenv command not found on mac

Nitesh Singh
  • 385
  • 1
  • 3
  • 15
walker1
  • 341
  • 1
  • 5
  • 18
  • please share how do you use virtualenv command – dukkee Feb 07 '21 at 13:37
  • tried virtualenv -p python3 . and virtualenv . Returns command not found for both – walker1 Feb 07 '21 at 13:45
  • Is there any way to install django without using pip as it doesnt work on my mac? – walker1 Feb 07 '21 at 13:55
  • Just put it here https://stackoverflow.com/questions/34573159/how-can-i-install-pythons-pip3-on-my-mac PS1 try `pip3` instead `pip`. PS2 virtualenv is not necessary for Django – rzlvmp Feb 07 '21 at 13:56
  • is there anyway to just uninstall all versions of python and start again having so much bother with this – walker1 Feb 07 '21 at 14:05

2 Answers2

0

I think you haven't install virtual environment:

pip install virtualenv
Nitesh Singh
  • 385
  • 1
  • 3
  • 15
  • i get back Traceback (most recent call last): File "/usr/local/bin/pip", line 11, in load_entry_point('pip==21.0.1', 'console_scripts', 'pip')() File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 489, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 2843, in load_entry_point return ep.load() – walker1 Feb 07 '21 at 13:50
0

You can activate your venv, give a try to apt install of pip3 if not found and then use it to install django.

source ./venv/bin/activate

sudo apt install python3-pip

pip3 install django

If your venv is properly configured you should get that venv path like this (here venv = djongo):

djongo/pyvenv.cfg

djongo/bin:
activate       activate.ps1      chardetect       easy_install      ndg_httpclient  pip-3.7      python     sqlformat  wheel-3.7
activate.csh   activate_this.py  django-admin     easy_install3     pip             pip3.7       python3    wheel
activate.fish  activate.xsh      django-admin.py  easy_install-3.7  pip3            __pycache__  python3.7  wheel3

djongo/lib:
python3.7
Synthase
  • 5,849
  • 2
  • 12
  • 34