Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am trying to perform a QSTK related task on python2.7.3 but ending up with syntax error

[Python 2.7.3 (default, Sep 26 2012, 21:51:14) 
[GCC 4.7.2] on linux2
Type "copyright", "credits" or "license()" for more information.
>>> python tutorial1.py
SyntaxError: invalid syntax
>>> ],

I went through a whole tutorial to setup python & other prerequisite softwares, everything got installed perfectly except for the following

@ubuntu:~$ sudo apt-get build-dep python-cvxopt
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: You must put some 'source' URIs in your sources.list

Is this installation incomplete?
Is the problem on Python related to this incomplete installation?

How can i sort out this installation & syntax error problem?

share|improve this question

1 Answer 1

Well, your original problem which mainfests in a SyntaxError exception is a funny one: you started a python interpreter and then trying to run a shell command from there. This won't work. You need to exit the Python interpreter (with Ctrl-D) and execute your file from the shell prompt. The actual command will be the same:

python tutorial1.py

(provided that your current directory contains tutorial1.py file)

If you need cvxopt module installed in Python, you can do that with

sudo apt-get install python-cvxopt

You don't need to use build-dep command. Also, I'd suggest to try running a simple "Hello, World" script first which doesn't depend on complex third-party stuff and only then proceed to trying to use cvxopt.

share|improve this answer
    
Well it may have appeared funny to you but i am having real headache, iam just a layman, who is using python first time & was able to go through whole tutorial1 stuff on terminal as per Video lecture but couldn't execute the command on python cell, which was performed perfectly by Professor in lecture Video. Anyway thanx for your response, will strive a bit harder. –  Raju Dec 3 '12 at 21:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.