losee
losee

Reputation: 2238

What's the correct way to install Django on mac

My mac has 2.7 python. I downloaded the latest version which is 3.5. Next I installed pip. I then tried to install Django, but when I do I am thrown the following error

 Traceback (most recent call last):
      File "/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg/pip/basecommand.py", line 211, in main
        status = self.run(options, args)
      File "/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg/pip/commands/install.py", line 311, in run
        root=options.root_path,
      File "/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg/pip/req/req_set.py", line 646, in install
        **kwargs
      File "/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg/pip/req/req_install.py", line 803, in install
        self.move_wheel_files(self.source_dir, root=root)
      File "/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg/pip/req/req_install.py", line 998, in move_wheel_files
        isolated=self.isolated,
      File "/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg/pip/wheel.py", line 339, in move_wheel_files
        clobber(source, lib_dir, True)
      File "/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg/pip/wheel.py", line 310, in clobber
        ensure_dir(destdir)
      File "/Library/Python/2.7/site-packages/pip-7.1.2-py2.7.egg/pip/utils/__init__.py", line 71, in ensure_dir
        os.makedirs(path)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 157, in makedirs
        mkdir(name, mode)
    OSError

It looks like its' still pointing to the 2.7 version of python how Can I fix that?

Upvotes: 0

Views: 3936

Answers (3)

breddy
breddy

Reputation: 1

try using pip3 instead of pip.

Upvotes: 0

Vahid Msm
Vahid Msm

Reputation: 1082

You can follow instruction in this tutorial and make a virtualenv with python3 then point your django python interpreter to it.

Upvotes: 0

fiacre
fiacre

Reputation: 1180

use virtualenv No need to mess the system python or use sudo to run pip.

Upvotes: 1

Related Questions