Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8435901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T07:02:42+00:00 2026-06-10T07:02:42+00:00

Let me start by saying that I’m fairly new to Xcode, OS X, and

  • 0

Let me start by saying that I’m fairly new to Xcode, OS X, and installing python modules.

When I attempt to build my project, XCode tells me that it cannot find a python module:

  File "/Users/some_user/some_folder/create.py", line 2, in <module> 
    from peak.rules import abstract, when
ImportError: No module named peak.rules
Command /bin/bash failed with exit code 1

I have installed a python module, which says it installed correctly. I can verify that it exists in my python2.7/site-packages/ directory. I also did which python, which gave me /Library/Frameworks/Python.framework/Versions/2.7/bin/python and verified that python is using that path python install for site packages, and it appears to be, they’re located at /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/. 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 PYTHONPATH to the site-packages directory specified by the same path given by which python.

My best guess as to the problem is that I’ve not defined my PYTHONPATH correctly. Here’s my entire .bash_profile file.

# 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
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T07:02:44+00:00Added an answer on June 10, 2026 at 7:02 am

    The value of PYTHONPATH does not indicate which python executable to run. Rather, it is a way to augment in which directories a python executable looks for modules during import operations. Apple ships versions of Python with OS X; the path to those interpreters are in /usr/bin. From the paths in your traceback (/Library/Frameworks), you appear to have installed a newer Python 2.7, possibly downloaded from python.org. By default, that python probably has symlinks to it installed in /usr/local/bin; its canonical bin directory is in the framework, at /Library/Frameworks/Python.framework/Versions/2.7/bin. While your shell path, $PATH, may have been set up to include that bin directory at the front of the search path so that the newer python is found in a shell, that probably doesn’t work for Xcode. In other words, Xcode is using the system Python, not the newer Python you installed. You’ll likely need to change some variables in your Xcode project so that the that path is searched first for that Python (or use an absolute path to the interpreter). You should remove the PYTHONPATH environment variable pointing at the site-library. Each Python will, by default, automatically search its site-library. More information is here.

    UPDATE: You may have a more basic issue here. I have no experience with PEAK or PEAK-rules but note that there are two separate distributions listed in the Python Package Index. If you just want to use PEAK rules, it appears that you need to install just the PEAK-rules distribution and not the PEAK one listed in PyPI. To use with the system Python, try this:

    umask 022
    sudo /usr/bin/easy_install-2.7 -m peak     # "uninstall" peak if installed
    sudo /usr/bin/easy_install-2.7 peak-rules  # install peak-rules
    

    If you want to use the newer non-system Python, just install and use a copy of easy_install (google for PyPI distribute) or pip for it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let me start by saying that I've never coded in Python. I need to
First off, let me start by saying that I am totally new to working
Let me start out by saying that I am new to Java/JSP web development,
Let me start off by saying that I am completely new with WPF (this
Let me start off by saying that I am very new to WPF and
Preface Let me start off by saying that I'm a relatively new programmer and
Let me start by saying I am fairly new to Java so forgive me
Let me start off by saying that I'm pretty new to flex and action
Ok, let me start out by saying that I am brand new to MVC.
Let me start by saying that I am new to all of this but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.