0

I am new to Python, but very excited to learn! However, I am having difficulty installing a Python module using Spyder on a Mac.

First, I go to the directory with the setup.py file.

import os
os.chdir('/Users/UserName')

Then, I attempt to install the module.

ez_setup.py install

I receive the following error.

  File "<stdin>", line 1
    ez_setup.py install
                      ^
SyntaxError: invalid syntax

Any advice on what is going wrong? I have looked around, but I cannot find an explanation of what may be going on in this case. It seems like module installation should be easy.

3
  • Are you trying to run this from within Spyder or in the Terminal app? Commented Dec 9, 2013 at 0:10
  • @CarlosCordoba, from within Spyder. I take it that's not the way to go? Commented Dec 10, 2013 at 2:43
  • 1
    I thought so :) Right now Spyder doesn't offer the possibility to install new modules within it (but we have plans to do it in the future). The answers quoted by @RobBW are the right way to do it. Commented Dec 10, 2013 at 3:16

1 Answer 1

1

Try python ez_setup.py install ?

When using a .py file, you have to give it to python executable :)

Edit: You can have a look on this page - http://pythonhosted.org/an_example_pypi_project/setuptools.html

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for the suggestion, Vincent! I tried the command you mentioned, but it didn't work; I received the same error.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.