Can't get Django to work on my Mac
<p>I'm having difficulty getting Django to work on my Mac. I pip installed it, as well as downloading it on PyCharm. I have a feeling it will work on PyCharm if I knew what I'm doing. I dont. haha. It's my first time. I am trying to work off the tutorial that they provide on their site. Here is where I run into trouble.</p>

<p>In terminal I type:</p>

<pre><code>python -m django --version
</code></pre>

<p>and I get:</p>

<pre><code>/usr/bin/python: No module named django
</code></pre>

<p>but when I type:</p>

<pre><code>pip install Django
</code></pre>

<p>I get:</p>

<pre><code>Requirement already satisfied (use --upgrade to upgrade): Django in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
</code></pre>

<p>The tutorial wants me to type:</p>

<pre><code>django-admin startproject mysite
</code></pre>

<p>and I get this:</p>

<pre><code>-bash: django-admin: command not found
</code></pre>

<p>So to my question. What is going on here? I'm thinking my path to it is different than what is expected, though I'm not fully sure. If you know the startproject mysite could you give it to me? Meaning, if you know the folders and content I think I could get it running on PyCharm. My PyCharm says it's been downloaded, so I think this would be a great way to go into it. </p>

<p>Many thanks.</p>

<p>Seems to me that pip is not configured with the python that you are using. From the output you posted, pip is installing Django for the python executable residing in here:</p>

<pre><code>/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
</code></pre>

<p>what is the output of <code>ls -l $(which python)</code> ?</p>

<p>This will tell you where the python you are using is. If it's different than the path above, pip is installing packages on another python executable.</p>

<p>You have 2 quick options.</p>

<ol>
<li><p>Put a softlink to the python residing in  <code>/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages</code> inside your <code>/usr/bin/</code> or wherever is imported before the path that <code>which python</code> shows.</p>

<p>ln -s {target-filename} {symbolic-filename}   </p></li>
</ol>

<p>which is probably</p>

<pre><code>ln -s /Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 /usr/bin/python
</code></pre>

<ol start="2">
<li><p>Use a <a href="http://docs.python-guide.org/en/latest/dev/virtualenvs/" rel="nofollow">Virtual Environment</a>.</p>

<p>pyenv ./env<br>
source ./env/bin/activate</p></li>
</ol>

<p>Now you are working on a virtual environment, which has its own pip and python so you should be fine to do anything you'd want !</p>

<p>Hope it helps</p>

python django osx terminal