Note that there are some explanatory texts on larger screens.

plurals
  1. POXCode not seeing python modules
    text
    copied!<p>Let me start by saying that I'm fairly new to Xcode, OS X, and installing python modules.</p> <p>When I attempt to build my project, XCode tells me that it cannot find a python module:</p> <pre><code> File "/Users/some_user/some_folder/create.py", line 2, in &lt;module&gt; from peak.rules import abstract, when ImportError: No module named peak.rules Command /bin/bash failed with exit code 1 </code></pre> <p>I have installed a python module, which says it installed correctly. I can verify that it exists in my <code>python2.7/site-packages/</code> directory. I also did <code>which python</code>, which gave me <code>/Library/Frameworks/Python.framework/Versions/2.7/bin/python</code> and verified that python is using that path python install for site packages, and it appears to be, they're located at <code>/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/</code>. I've searched my machine and I don't have another install of python that I'm aware of. I've restarted Xcode after installing the module and that did not make a difference. I also set <code>PYTHONPATH</code> to the site-packages directory specified by the same path given by <code>which python</code>.</p> <p>My best guess as to the problem is that I've not defined my <code>PYTHONPATH</code> correctly. Here's my entire <code>.bash_profile</code> file.</p> <pre><code># Setting PATH for Python 2.7 # The orginal version is saved in .bash_profile.pysave PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}" export PATH PYTHONPATH="$ {PYTHONPATH} : /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages" export PYTHONPATH </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload