简体   繁体   中英

Django project not able to run on mac OS X Sierra

I just purchased the new 2017 macbook pro. I want to do two things. the first is run a django project and then run my specific file that I have clones from github. I want to pip install django and I am getting a message that pip is not a command.

Every forum is saying that 2017 macbook pro has python 2.X and 3.XI want to set python 3.X as the default.

How can i set python 3 as the default?

what is the command to get pip because when i try to get it from python 2.x and 3.x, it says the file does not exist.

Where and how can I install pip?

I tried installing pip but i was getting a message that it does not exist. how can i go about downloading or getting pip on my mac. I have tried a few different ways and nothing is working. Once i get python and pip, I can install Django and run my django application...

Where and how can i install django framework onto my mac?

Does anyone know how to do this on the OS X sierra for mac.

Yes, I use python on sierra Mac, but I suggest you to use brew to install Python3 and then use virtualenv to manage the env of your projects. Don't rely on the default python installed on Sierra.

Install brew is very easy. Just jump here: https://brew.sh/

After that you can install python simply running brew install python3

I prefer virtualenv and virtualenvwrapper , but if you want start immediately you can create your env from python3:

$ pyvenv myenv

And then activate your env

$ source myenv/bin/activate

Now you can install any package with pip, without changing your system. Run deactivate to switch off your env. You can create many envs as you wish and run your app with many different django version.

As I wrote before, I suggest you use virtualenvwrapper and virtualenv

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM