Title
stringlengths 15
150
| A_Id
int64 2.98k
72.4M
| Users Score
int64 -17
470
| Q_Score
int64 0
5.69k
| ViewCount
int64 18
4.06M
| Database and SQL
int64 0
1
| Tags
stringlengths 6
105
| Answer
stringlengths 11
6.38k
| GUI and Desktop Applications
int64 0
1
| System Administration and DevOps
int64 1
1
| Networking and APIs
int64 0
1
| Other
int64 0
1
| CreationDate
stringlengths 23
23
| AnswerCount
int64 1
64
| Score
float64 -1
1.2
| is_accepted
bool 2
classes | Q_Id
int64 1.85k
44.1M
| Python Basics and Environment
int64 0
1
| Data Science and Machine Learning
int64 0
1
| Web Development
int64 0
1
| Available Count
int64 1
17
| Question
stringlengths 41
29k
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
IO within the Program Files Directory
| 5,838,105
| 2
| 3
| 1,184
| 0
|
python,windows-7,io,uac
|
I suggest saving the folder in %appdata%\my subdirectory. You won't need administrator privilege for that.
| 0
| 1
| 0
| 0
|
2011-04-29T22:28:00.000
| 4
| 0.099668
| false
| 5,838,025
| 0
| 0
| 0
| 3
|
I made a program that both gathers data from a .txt file by reading it, and writes data to a different .txt file. However, there is a problem. When I run the program in a normal directory It runs perfectly fine. A problem arises when I place it in the C:\Program Files directory. When I run it I get IOERROR: [Errno 13] Permission denied: 'my subdirectory'. I believe this is probably due to this directory having some extra protocols when it comes to editing files within it.
This is in Windows 7, if it wasn't already apparent.
Also if it makes a difference the program was written in Python then converted to an .exe with py2exe.
|
Open file in Python
| 5,838,777
| 0
| 4
| 16,048
| 0
|
python,django
|
Use relative paths? ../../../../file
| 0
| 1
| 0
| 0
|
2011-04-30T00:54:00.000
| 4
| 1.2
| true
| 5,838,735
| 0
| 0
| 0
| 1
|
My cwd is ~/Desktop/Development/Python/djcode/mysite, and I want to open a file on my Desktop. What is the syntax to open files in a different directory? (for example, if the file was in the cwd I would use open('file'). Thank you.
|
Comprehensive beginner's virtualenv tutorial?
| 13,261,064
| 35
| 358
| 149,425
| 0
|
python,virtualenv
|
Virtualenv is a tool to create isolated Python environments.
Let's say you're working in 2 different projects, A and B.
Project A is a web project and the team is using the following packages:
Python 2.8.x
Django 1.6.x
The project B is also a web project but your team is using:
Python 2.7.x
Django 1.4.x
The machine that you're working doesn't have any version of django, what should you do? Install django 1.4? django 1.6? If you install django 1.4 globally would be easy to point to django 1.6 to work in project A?
Virtualenv is your solution! You can create 2 different virtualenv's, one for project A and another for project B. Now, when you need to work in project A, just activate the virtualenv for project A, and vice-versa.
A better tip when using virtualenv is to install virtualenvwrapper to manage all the virtualenv's that you have, easily. It's a wrapper for creating, working, removing virtualenv's.
| 0
| 1
| 0
| 0
|
2011-04-30T21:56:00.000
| 4
| 1
| false
| 5,844,869
| 1
| 0
| 0
| 1
|
I've been hearing the buzz about virtualenv lately, and I'm interested. But all I've heard is a smattering of praise, and don't have a clear understanding of what it is or how to use it.
I'm looking for (ideally) a follow-along tutorial that can take me from Windows or Linux with no Python on it, and explain every step of (in no particular order):
what I should do to be able to start using virtualenv
specific reasons why using virtualenv is a good idea
situations where I can/can't use virtualenv
situations where I should/shouldn't use virtualenv
And step through (comprehensively) a couple sample situations of the should+can variety.
So what are some good tutorials to cover this stuff? Or if you have the time and interest, perhaps you can answer a few of those questions here. Either in your answer, or as a link to tutorials that answer it, these are the things I'd like to know.
|
What should a Window Manager do with a ConfigureRequestEvent?
| 5,851,984
| 1
| 2
| 848
| 0
|
python,x11,window-managers,xcb
|
The short answer is configure the window (size, stacking, etc.) by calling ConfigureWindow. The long answer is here you impose policy and honor specs such as XSizeHints. Best to have a look at some existing WMs' source and get a sense of what they do. Exactly what you do depends on your desired UI.
The simplest thing to get it working is to just ConfigureWindow exactly as the request asks with no policy or hint overrides. But you'll probably see lots of usability problems quickly and have to add some more smarts.
| 1
| 1
| 0
| 0
|
2011-05-01T01:17:00.000
| 1
| 0.197375
| false
| 5,845,717
| 0
| 0
| 0
| 1
|
For my sins (and for fun the learning experience) I am writing a window manager (I know, I know).
I'm using python and XCB (python-xpyb).
So far I have figured out that I need to use a SubStructureRedirect mask on the root window(s), and I am successfully being passed events related to applications' top-level windows. I'm testing this by launching xterm.
I get a ConfigureRequestEvent, followed by a pause, followed by another ConfigureRequestEvent, and then a MapRequestEvent.
When I get the MapRequestEvent I call connection.core.MapWindowChecked(e.window), which works, but maps a window that is only a pixel or two wide/tall.
My question, then, is what should I do with the ConfigureRequestEvent to make the window the correct size (assuming thats what I'm missing)?
More accurately, what exactly do i call? MapWindowChecked was an obvious choice, but I can't seem to find how to actually configure the width/height. I'm guessing it is ConfigureWindow, but the arguments that accepts seem obscure to me. Last time I called it I used xcb.xproto.CW.EventMask, but none of the flags in CW seem to be related to width/height.
PS The documentation on all of this seems quite elusive to me. I've looked at a couple of python window managers that supposedly use xcb, and they seem to use their own custom versions with extra functionality. Also, Examining/debugging a running window manager (which is also responsible for mapping your debugger's window) is a PITA, hence my asking here. probably would be better to use two machines or a VM or something.
Thanks.
|
how to recover python 2.6.1 that was pre-installed in my macbook pro?
| 5,846,054
| 0
| 0
| 1,053
| 0
|
python
|
Reinstalling would work. In the future, don't delete Frameworks you didn't install.
| 0
| 1
| 0
| 0
|
2011-05-01T02:33:00.000
| 2
| 0
| false
| 5,846,022
| 0
| 0
| 0
| 1
|
I download python 3.2 and my first thought was that I need to uninstall the python 2.6.1 pre-installed in my computer. But later I found in python.org "You should never modify or delete these, as they are Apple-controlled and are used by Apple- or third-party software". I used "sudo rm -rf /Library/Frameworks/Python.Framework" to delete python 2.6.1. Now I truly want to undo this command(I want python 2.6.1 back!). What should I do?
(or the question can be expressed as follows: how can I re-install the pre-installed python 2.6.1 in my mac?)
|
How to change default Python version?
| 50,347,328
| 2
| 173
| 661,274
| 0
|
python,macos
|
Navigate to:
My Computer -> Properties -> Advanced -> Environment Variables -> System Variables
Suppose you had already having python 2.7 added in path variable and you want to change default path to python 3.x
then add path of python3.5.x folder before python2.7 path.
open cmd: type "python --version"
python version will be changed to python 3.5.x
| 0
| 1
| 0
| 0
|
2011-05-01T03:10:00.000
| 19
| 0.02105
| false
| 5,846,167
| 1
| 0
| 0
| 6
|
I have installed Python 3.2 in my Mac. After I run /Applications/Python 3.2/Update Shell Profile.command, it's confusing that when I type Python -V in Terminal it says that Python 2.6.1.
How can I change the default Python version?
|
How to change default Python version?
| 28,787,350
| 2
| 173
| 661,274
| 0
|
python,macos
|
I am using OS X 10.7.5 and Python 3.4.2. If you type python3 and what you want to run it will run it using python 3. For example
pyhton3 test001.py. That ran a test program I made called test001. I hope this helps.
| 0
| 1
| 0
| 0
|
2011-05-01T03:10:00.000
| 19
| 0.02105
| false
| 5,846,167
| 1
| 0
| 0
| 6
|
I have installed Python 3.2 in my Mac. After I run /Applications/Python 3.2/Update Shell Profile.command, it's confusing that when I type Python -V in Terminal it says that Python 2.6.1.
How can I change the default Python version?
|
How to change default Python version?
| 71,028,281
| 0
| 173
| 661,274
| 0
|
python,macos
|
Starting with macOS Catalina the default shell is zsh. Therefore, all those ~/.bash_profile changes are not going to change the default when you open a new terminal since the new terminal is a zsh shell and not a bash shell.
You can confirm your terminal is a zsh shell by typing echo $SHELL and you should see a response of: zsh.
What should you do? You should use a solution that works for zsh shell and bash shell. Therefore, do the following:
enter: vi ~/.bash_profile
enter: alias python='python3'
close and save your bash_profile. Enter: :wq
Now open/create your zsh profile. Enter: vi ~/.zshrc
source your bash inside your zshrc. Enter: source ~/.bash_profile
Now python will be aliased to python3 in your zsh shells (and in bash if you switch the default) automatically.
Test:
python --version
Python 3.8.9
| 0
| 1
| 0
| 0
|
2011-05-01T03:10:00.000
| 19
| 0
| false
| 5,846,167
| 1
| 0
| 0
| 6
|
I have installed Python 3.2 in my Mac. After I run /Applications/Python 3.2/Update Shell Profile.command, it's confusing that when I type Python -V in Terminal it says that Python 2.6.1.
How can I change the default Python version?
|
How to change default Python version?
| 69,782,553
| 0
| 173
| 661,274
| 0
|
python,macos
|
It should be noted that recent versions of Homebrew/MacOS will require a different entry for the PATH as the location where Homebrew installs Python has changed. Add this like to your .zshrc:
export PATH="/opt/homebrew/opt/python/libexec/bin:$PATH"
This will ensure that the appropriate unversioned python link installed by Homebrew appears before that of version 2.x and will protect you from being impacted by any version updates to python as brew will update the unversioned links whenever it updates the version.
| 0
| 1
| 0
| 0
|
2011-05-01T03:10:00.000
| 19
| 0
| false
| 5,846,167
| 1
| 0
| 0
| 6
|
I have installed Python 3.2 in my Mac. After I run /Applications/Python 3.2/Update Shell Profile.command, it's confusing that when I type Python -V in Terminal it says that Python 2.6.1.
How can I change the default Python version?
|
How to change default Python version?
| 67,921,871
| -3
| 173
| 661,274
| 0
|
python,macos
|
After installing the newer version of python to your computer...
When you want to run a python program (e.g. 'program.py') from the terminal (using the latest version of python on your system); instead of running 'python program.py' run 'python3 program.py'
Similarly, if you want to use python in the terminal (using the latest version of python on your system) run 'python3' instead of 'python'
As a test try to run 'python3 --v' in the terminal...
| 0
| 1
| 0
| 0
|
2011-05-01T03:10:00.000
| 19
| -0.031568
| false
| 5,846,167
| 1
| 0
| 0
| 6
|
I have installed Python 3.2 in my Mac. After I run /Applications/Python 3.2/Update Shell Profile.command, it's confusing that when I type Python -V in Terminal it says that Python 2.6.1.
How can I change the default Python version?
|
How to change default Python version?
| 60,886,499
| 1
| 173
| 661,274
| 0
|
python,macos
|
In short: change the path in Environment Variables!
For Windows:
Advanced System Settings > Advance (tab). On bottom you'll find 'Environment Variables'
Double-click on the Path. You'll see path to one of the python installations, change that to path of your desired version.
| 0
| 1
| 0
| 0
|
2011-05-01T03:10:00.000
| 19
| 0.010526
| false
| 5,846,167
| 1
| 0
| 0
| 6
|
I have installed Python 3.2 in my Mac. After I run /Applications/Python 3.2/Update Shell Profile.command, it's confusing that when I type Python -V in Terminal it says that Python 2.6.1.
How can I change the default Python version?
|
If I open and read the file which is periodically written, can I/O deadlock occur?
| 12,211,059
| 0
| 1
| 773
| 1
|
python,linux,performance,io,deadlock
|
Quick advice, make sure (like, super sure) that you do close your file.
So ALWAYS use a try-except-final block for this
Remember that the contens of a final block will ALWAYS be executed, that will prevent you a lot of head pain :)
| 0
| 1
| 0
| 0
|
2011-05-01T11:55:00.000
| 2
| 0
| false
| 5,848,184
| 0
| 0
| 1
| 1
|
In my server process, it looks like this:
Main backend processes:
Processes Huge list of files and , record them inside MySQL.
On every 500 files done, it writes "Progress Report" to a separate file /var/run/progress.log like this "200/5000 files done"
It is multi-processed with 4 children, each made sure to run on a separate file.
Web server process:
Read the output of /var/run/progress.log every 10 seconds via Ajax and report to progress bar.
When processing a very large list of files (e.g. over 3 GB archive), the processes lock up after about 2 hours of processing.
I can't find what is going on. Does that mean that /var/run/progress.log caused an I/O deadlock?
|
Difference between __file__ and sys.argv[0]
| 5,851,615
| 7
| 30
| 5,521
| 0
|
python
|
It's only the same if you are in the "main" script of your python programm. If you import other files, __file__ will contain the path to that file, but sys.argv will still hold the same values.
| 0
| 1
| 0
| 0
|
2011-05-01T21:39:00.000
| 4
| 1
| false
| 5,851,588
| 1
| 0
| 0
| 2
|
Is there any difference between:
__file__
and
sys.argv[0]
Because both seem to be doing the same thing: they hold the name of the script.
If there is no difference, then why is it that __file__ is used in almost all someplaces whereas I have never seen sys.argv[0] being used.
|
Difference between __file__ and sys.argv[0]
| 5,851,608
| 26
| 30
| 5,521
| 0
|
python
|
__file__ is the name of the current file, which may be different from the main script if you are inside a module or if you start a script using execfile() rather than by invoking python scriptname.py. __file__ is generally your safer bet.
| 0
| 1
| 0
| 0
|
2011-05-01T21:39:00.000
| 4
| 1.2
| true
| 5,851,588
| 1
| 0
| 0
| 2
|
Is there any difference between:
__file__
and
sys.argv[0]
Because both seem to be doing the same thing: they hold the name of the script.
If there is no difference, then why is it that __file__ is used in almost all someplaces whereas I have never seen sys.argv[0] being used.
|
Best practice to install dependencies?
| 5,855,669
| 4
| 5
| 3,223
| 0
|
python,installation,dependencies
|
The most important thing to help you decide is to consider your audience.
Are they technically-inclined and likely to be comfortable following instructions specifying how to build the dependencies themselves? If so, go with (3). If not, writing a python or shell script, or a makefile to automate the task may be the way to go. Pick whichever you feel most comfortable writing.
| 0
| 1
| 0
| 0
|
2011-05-02T09:33:00.000
| 2
| 1.2
| true
| 5,855,543
| 1
| 0
| 0
| 1
|
I am thinking of a good way to ship my application which is a python package. Installing my package is easy making use of pythons distutils package.
The trouble comes with the dependencies my package relies on. If the dependencies are python packages I can deal with them easily again using distutils, but non python packages? Some of them even need a lot of care while building and installing them since very special compiler flags need to be set and so forth...
If I want to automate the installation procedure for the user what is the best way to go about it?
Writing a make file that downloads and installs the dependencies
Write a script that installs the dependencies
No automation is best. simply write a manual that tells the user how to install the
dependencies
???
Thx in advance for any answer or suggestion
|
Is there an advantage to using Bash over Perl or Python?
| 5,858,924
| 3
| 31
| 26,872
| 0
|
python,linux,perl,bash,scripting
|
If you want to execute programs installed on the machine, nothing beats bash. You can always make a system call from Perl or Python, but I find it to be a hassle to read return values, etc.
And since you know it will work pretty much anywhere throughout all of of time...
| 0
| 1
| 0
| 1
|
2011-05-02T15:12:00.000
| 8
| 0.07486
| false
| 5,858,877
| 0
| 0
| 0
| 5
|
Hey I've been using Linux for a while and thought it was time to finally dive into shell scripting.
The problem is I've failed to find any significant advantage of using Bash over something like Perl or Python. Are there any performance or power differences between the two? I'd figure Python/Perl would be more well suited as far as power and efficiency goes.
|
Is there an advantage to using Bash over Perl or Python?
| 5,858,956
| 2
| 31
| 26,872
| 0
|
python,linux,perl,bash,scripting
|
The advantage of shell scripting is that it's globally present on *ix boxes, and has a relatively stable core set of features you can rely on to run everywhere. With Perl and Python you have to worry about whether they're available and if so what version, as there have been significant syntactical incompatibilities throughout their lifespans. (Especially if you include Python 3 and Perl 6.)
The disadvantage of shell scripting is everything else. Shell scripting languages are typically lacking in expressiveness, functionality and performance. And hacking command lines together from strings in a language without strong string processing features and libraries, to ensure the escaping is correct, invites security problems. Unless there's a compelling compatibility reason you need to go with shell, I would personally plump for a scripting language every time.
| 0
| 1
| 0
| 1
|
2011-05-02T15:12:00.000
| 8
| 0.049958
| false
| 5,858,877
| 0
| 0
| 0
| 5
|
Hey I've been using Linux for a while and thought it was time to finally dive into shell scripting.
The problem is I've failed to find any significant advantage of using Bash over something like Perl or Python. Are there any performance or power differences between the two? I'd figure Python/Perl would be more well suited as far as power and efficiency goes.
|
Is there an advantage to using Bash over Perl or Python?
| 5,860,436
| 4
| 31
| 26,872
| 0
|
python,linux,perl,bash,scripting
|
For big projects use a language like Perl.
There are a few things you can only do in bash (for example, alter the calling environment (when a script is sourced rather than run). Also, shell scripting is commonplace. It is worthwhile to learn the basics and learn your way around the available docs.
Plus there are times when knowing a shell well can save your bacon (on a fork-bombed system where you can't start any new processes, or if /usr/bin and or /usr/local/bin fail to mount).
| 0
| 1
| 0
| 1
|
2011-05-02T15:12:00.000
| 8
| 0.099668
| false
| 5,858,877
| 0
| 0
| 0
| 5
|
Hey I've been using Linux for a while and thought it was time to finally dive into shell scripting.
The problem is I've failed to find any significant advantage of using Bash over something like Perl or Python. Are there any performance or power differences between the two? I'd figure Python/Perl would be more well suited as far as power and efficiency goes.
|
Is there an advantage to using Bash over Perl or Python?
| 5,860,163
| 10
| 31
| 26,872
| 0
|
python,linux,perl,bash,scripting
|
bash isn't a language so much as a command interpreter that's been hacked to death to allow for things that make it look like a scripting language. It's great for the simplest 1-5 line one-off tasks, but things that are dead simple in Perl or Python like array manipulation are horribly ugly in bash. I also find that bash tends not to pass two critical rules of thumb:
The 6-month rule, which says you should be able to easily discern the purpose and basic mechanics of a script you wrote but haven't looked at in 6 months.
The 'WTF per minute' rule. Everyone has their limit, and mine is pretty small. Once I get to 3 WTFs/min, I'm looking elsewhere.
As for 'shelling out' in scripting languages like Perl and Python, I find that I almost never need to do this, fwiw (disclaimer: I code almost 100% in Python). The Python os and shutil modules have most of what I need most of the time, and there are built-in modules for handling tarfiles, gzip files, zip files, etc. There's a glob module, an fnmatch module... there's a lot of stuff there. If you come across something you need to parallelize, then indent your code a level, put it in a 'run()' method, put that in a class that extends either threading.Thread or multiprocessing.Process, instantiate as many of those as you want, calling 'start()' on each one. Less than 5 minutes to get parallel execution generally.
Best of luck. Hope this helps.
| 0
| 1
| 0
| 1
|
2011-05-02T15:12:00.000
| 8
| 1
| false
| 5,858,877
| 0
| 0
| 0
| 5
|
Hey I've been using Linux for a while and thought it was time to finally dive into shell scripting.
The problem is I've failed to find any significant advantage of using Bash over something like Perl or Python. Are there any performance or power differences between the two? I'd figure Python/Perl would be more well suited as far as power and efficiency goes.
|
Is there an advantage to using Bash over Perl or Python?
| 5,858,911
| 4
| 31
| 26,872
| 0
|
python,linux,perl,bash,scripting
|
The most important advantage of POSIX shell scripts over Python or Perl scripts is that a POSIX shell is available on virtually every Unix machine. (There are also a few tasks shell scripts happen to be slightly more convenient for, but that's not a major issue.) If the portability is not an issue for you, I don't see much need to learn shell scripting.
| 0
| 1
| 0
| 1
|
2011-05-02T15:12:00.000
| 8
| 0.099668
| false
| 5,858,877
| 0
| 0
| 0
| 5
|
Hey I've been using Linux for a while and thought it was time to finally dive into shell scripting.
The problem is I've failed to find any significant advantage of using Bash over something like Perl or Python. Are there any performance or power differences between the two? I'd figure Python/Perl would be more well suited as far as power and efficiency goes.
|
How can I send a user registration confirmation email using Tornado and MongoDB?
| 7,483,440
| 6
| 5
| 3,734
| 1
|
python,email,tornado
|
I wonder why you would handle registration like that. The usual way to handle registration is:
Write the user info to the database, but with an 'inactive' label attached to the user.
Send an email to the user.
If the user confirms the registration, then switch the user to 'active'.
If you don't want to write to the database, you can write to a cache (like memcache, redis), then when the user confirms the registration, you can get the user info from the cache and write it to the database.
| 0
| 1
| 0
| 0
|
2011-05-02T20:41:00.000
| 2
| 1
| false
| 5,862,238
| 0
| 0
| 1
| 1
|
I'm working with Tornado and MongoDB and I would like to send a confirmation email to the user when he creates an account in my application.
For the moment, I use a simple XHTML page with a form and I send information to my MongoDB database using Tornado. I would like to have an intermediate step which sends an email to the user before inserting the data into the database.
I would like to know how could I send this email and insert the user account only after the user receives the email and confirms his registration.
|
Deploying an app to users' appspot
| 5,872,643
| 0
| 0
| 193
| 0
|
python,google-app-engine
|
No. Writing an application that deploys other applications is in violation of the terms of service.
Note we don't have any 'hard' limits - those limits that aren't billing enabled can be increased on application to us if you provide a reasonable use-case.
| 0
| 1
| 0
| 0
|
2011-05-03T05:19:00.000
| 5
| 0
| false
| 5,865,349
| 0
| 0
| 1
| 3
|
I am working on a Python App, which runs on App Engine. Is there a way I can publish the app on each customers' appSpot account, so that the App uses the users' cloud storage? Instead of running the App on my AppSpot account and all the users storing the data on my Cloud space?
|
Deploying an app to users' appspot
| 5,870,645
| 1
| 0
| 193
| 0
|
python,google-app-engine
|
Yes, absolutely.
You just need to have each client create an App Engine account with an application to which you have administrator access. You can adjust the settings on the application to forbid downloads of your code by the other administrators if that's appropriate for your agreement with the client. This also allows the clients to be billed directly for their instances' usage, and makes it completely impossible for data to leak between different clients' instances.
Using multiple applications for multiple clients who are licensing your application almost certainly does not violate part 4.4 of the TOS, although don't take this as legal advice.
| 0
| 1
| 0
| 0
|
2011-05-03T05:19:00.000
| 5
| 1.2
| true
| 5,865,349
| 0
| 0
| 1
| 3
|
I am working on a Python App, which runs on App Engine. Is there a way I can publish the app on each customers' appSpot account, so that the App uses the users' cloud storage? Instead of running the App on my AppSpot account and all the users storing the data on my Cloud space?
|
Deploying an app to users' appspot
| 5,865,451
| 1
| 0
| 193
| 0
|
python,google-app-engine
|
No, you cannot do that. The app is hosted and run in the administrator's account which would be you. What you can do is, release the source code and point your users do install it in their appspot account, just like creating a new application.
| 0
| 1
| 0
| 0
|
2011-05-03T05:19:00.000
| 5
| 0.039979
| false
| 5,865,349
| 0
| 0
| 1
| 3
|
I am working on a Python App, which runs on App Engine. Is there a way I can publish the app on each customers' appSpot account, so that the App uses the users' cloud storage? Instead of running the App on my AppSpot account and all the users storing the data on my Cloud space?
|
Python changes are not reflected
| 5,867,954
| 2
| 0
| 900
| 0
|
python
|
I have a example.py file. loaded on a linux server.
Many linux servers including Apache and Nginx load the files they need to serve when they start for performance sake. So, you may need to restart the server to pickup the latest python file.
| 0
| 1
| 0
| 0
|
2011-05-03T09:47:00.000
| 1
| 0.379949
| false
| 5,867,762
| 0
| 0
| 0
| 1
|
I have a example.py file. loaded on a linux server. I put some prints in this file and saved it.
When I call this .py file I am not getting these changes.
Do I need to do something (Like for C we need to compile the .c file and put the .so to LD_LIBRARY_PATH) for python also.
Thanks,
|
Running python from the mac terminal
| 5,875,841
| 0
| 1
| 9,446
| 0
|
python,command-line,terminal
|
Have a look at the Python package under Applications. There is a shell script there called Update Shell Profile.command
Run this and it should set your path up properly.
Unless you mark you script as executable with chmod +x, you'll need to run python over it first. e.g. `python myscript.py'
| 0
| 1
| 0
| 0
|
2011-05-03T21:15:00.000
| 5
| 0
| false
| 5,875,798
| 0
| 0
| 0
| 4
|
I have installed the new python release and would like to run .py files from the terminal.
How is this done from the terminal? I dont want to include the path in each command to run a .py file.
|
Running python from the mac terminal
| 5,876,379
| 0
| 1
| 9,446
| 0
|
python,command-line,terminal
|
I installed all of my python through macports, which has pros and cons. One of the benefits is that you don't have to worry about stuff like this, it just works. You can install python 2.6 and python 2.7 (and others), and then use the python_select utility to set up which python is run when you call "python blah.py"
| 0
| 1
| 0
| 0
|
2011-05-03T21:15:00.000
| 5
| 0
| false
| 5,875,798
| 0
| 0
| 0
| 4
|
I have installed the new python release and would like to run .py files from the terminal.
How is this done from the terminal? I dont want to include the path in each command to run a .py file.
|
Running python from the mac terminal
| 36,117,645
| 0
| 1
| 9,446
| 0
|
python,command-line,terminal
|
if you add a shebang at the start of the python file then you can run a python file by just its name from terminal
add #!/usr/bin/python
for mac(others add your respective path for python)
at the top of your python program and from your terminal you can run it just by filename(if it has executable permissions).
| 0
| 1
| 0
| 0
|
2011-05-03T21:15:00.000
| 5
| 0
| false
| 5,875,798
| 0
| 0
| 0
| 4
|
I have installed the new python release and would like to run .py files from the terminal.
How is this done from the terminal? I dont want to include the path in each command to run a .py file.
|
Running python from the mac terminal
| 36,117,693
| 0
| 1
| 9,446
| 0
|
python,command-line,terminal
|
Since you have installed a working python, the easiest way to run python files from the terminal is to cd your terminal to the directory where the file is located and then just type python my_code.py in the terminal.
| 0
| 1
| 0
| 0
|
2011-05-03T21:15:00.000
| 5
| 0
| false
| 5,875,798
| 0
| 0
| 0
| 4
|
I have installed the new python release and would like to run .py files from the terminal.
How is this done from the terminal? I dont want to include the path in each command to run a .py file.
|
Execute a python script stored on a server/network location on a user's local machine using PHP
| 5,877,854
| 0
| 0
| 937
| 0
|
php,python,iis
|
Is there a way that PHP can execute a python script (stored on Machine A) that is then ran locally (on Machine B)
Never. The browsers forbid this kind of security hole.
| 0
| 1
| 0
| 1
|
2011-05-04T01:50:00.000
| 2
| 0
| false
| 5,877,621
| 0
| 0
| 0
| 2
|
I have a webserver running IIS (Machine A) that is running PHP for me. When a user points their browser to a web page that is hosted on the webserver with a PHP script on it, they need to populate a few forms, and then hit a button that will then run the PHP script, which will fire off a python script I've already built. I am using the exec() command in PHP to call my Python script which is stored locally on the webserver (still Machine A). The idea here is that any user on any machine (with python installed on it) can run the script when they navigate to the webpage.
Unfortunately, one of the forms that is needed for the python script to work is a path to an external drive plugged into the user's machine (Machine B).
My question then is: Is there a way that PHP can execute a python script (stored on Machine A) that is then ran locally (on Machine B) so that when the user has entered in the location of the drive (Win: F:\, Linux: \dev\sda2\, etc ), the python script will know to be looking at the user's local machine (Machine B) rather than the server the script is stored on (Machine A)?
EDIT: Hopefully I have clarified the question above.
|
Execute a python script stored on a server/network location on a user's local machine using PHP
| 5,877,648
| 1
| 0
| 937
| 0
|
php,python,iis
|
The question is not exactly clear, but from my understanding, you're trying to execute code on the local user's machine and you can't do that via Python.
Your best bet is to write JavaScript that will do the job for you (a few browsers only as you're working with local storage due to HTML5), or you can have your user upload the files.
| 0
| 1
| 0
| 1
|
2011-05-04T01:50:00.000
| 2
| 0.099668
| false
| 5,877,621
| 0
| 0
| 0
| 2
|
I have a webserver running IIS (Machine A) that is running PHP for me. When a user points their browser to a web page that is hosted on the webserver with a PHP script on it, they need to populate a few forms, and then hit a button that will then run the PHP script, which will fire off a python script I've already built. I am using the exec() command in PHP to call my Python script which is stored locally on the webserver (still Machine A). The idea here is that any user on any machine (with python installed on it) can run the script when they navigate to the webpage.
Unfortunately, one of the forms that is needed for the python script to work is a path to an external drive plugged into the user's machine (Machine B).
My question then is: Is there a way that PHP can execute a python script (stored on Machine A) that is then ran locally (on Machine B) so that when the user has entered in the location of the drive (Win: F:\, Linux: \dev\sda2\, etc ), the python script will know to be looking at the user's local machine (Machine B) rather than the server the script is stored on (Machine A)?
EDIT: Hopefully I have clarified the question above.
|
Django non blocking email? Downsides to threading.thread or subprocess?
| 5,877,718
| 9
| 5
| 1,266
| 0
|
python,django,multithreading
|
Offloading the work to some other external process is really the right thing to do, and once you've done it, it's not likely to be the last time you do it. Celery/RabbitMQ is a decent solution, and the nice thing is they're already there. Recent RabbitMQ releases have a decent web-based management app and a decent management API that'll make babysitting pretty easy, and celery works pretty well in Django apps.
You can do this with subprocess or threading, but to be honest, I think that's a bad habit to get into. Unfortunately, they're the most straightforward ways to do what you want to do if you don't want to offload things.
If you wanted to go completely 'ghetto async email' you could have your app just dump emails to files in a directory and have a cron job check the directory for files in that directory every minute, and send them off as emails, but really that's a lot more work than rabbit/celery.
I say just go with rabbit/celery. It's not as much work as it seems, and it's worth it going forward.
| 0
| 1
| 0
| 0
|
2011-05-04T01:56:00.000
| 2
| 1.2
| true
| 5,877,658
| 0
| 0
| 1
| 1
|
I have a django site. Certain actions by the end user send email to the rest of users in a group.
When the number of users gets to be > 20 it can add 1-3 seconds to the request cycle, which I don't like. I'd like to be able to send the email from a non-blocking function.
I know RabbitMQ and Celery in conjunction can solve this, but with 200 users that seems like over-engineering and it adds two more applications I have to install, understand, and babysit.
I've done some research, and it appears that both threading.Thread and subprocess would be ways to wrap a non-blocking call. Am I missing an obvious way to do this? Are there downsides to using either the threading.thread or subprocess approach?
Thanks,
Ted
|
Run python script without the "python" keyword
| 5,879,906
| 5
| 12
| 8,958
| 0
|
python,macos,terminal
|
Try ./script.py instead of script.py ... or ensure your current directory is in your path and script.py should work....
| 0
| 1
| 0
| 1
|
2011-05-04T07:17:00.000
| 3
| 0.321513
| false
| 5,879,869
| 0
| 0
| 0
| 1
|
How can I run a python script in Terminal on Mac without using the "python" keyword, without having to edit my existing python files?
Right now I have to do this:
python script.py
What I like to do is this:
script.py
|
python create celery task job
| 5,882,479
| 1
| 0
| 485
| 0
|
python,parallel-processing,celery
|
Giving an example is difficult as messaging is a bit complex, but what you can do basically is:
rewrite your program to be a task or write a task that calls your program using subprocess
configure celery to have 10 workers
execute as many tasks as you need to get your job done, Celery will add them to its queue
Celery will do the rest for you, once a task finished, another one is started till the queue is empty
Alternatively, if your want to start a task manually after one finished, you can configure Celery to send a message after its finished (I didn't try it yet, but have a look at CELERY_RESULT_BACKEND) You can then consume these messages and start your task.
| 0
| 1
| 0
| 0
|
2011-05-04T08:49:00.000
| 1
| 1.2
| true
| 5,880,867
| 0
| 0
| 0
| 1
|
lets say i have a python programm whitch i want to run always max 10 times in parallel using celery / rabbigmq and if some of the process finish i want to know about it so i can start a new process. how can i do so? some examples would be nice
|
Python: could a script compiled with py2exe freeze the operating system?
| 5,884,122
| 0
| 1
| 263
| 0
|
python,windows,py2exe
|
A Python program - regardless of whether iterpreted by the Python executable or in py2exe form - can do the same as any other program. That means that it should not be able to freeze a modern operating system unless it is run with superuser rights. However, programs (especially malicious and badly written ones) can significantly degrade user experience, for example by going fullscreen and refusing to show the desktop or starting lots of threads and processes.
| 0
| 1
| 0
| 0
|
2011-05-04T13:17:00.000
| 2
| 0
| false
| 5,884,037
| 1
| 0
| 0
| 2
|
I am using py2exe to compiling python scripts in executable files on Windows Xp/7/2000.
I am wondering if such executable scripts could freeze the operating system, and I have to reboot Windows.
I suppose such problems could occur if I try to manage driver library.
What do you think about?
|
Python: could a script compiled with py2exe freeze the operating system?
| 5,884,075
| 3
| 1
| 263
| 0
|
python,windows,py2exe
|
Theoretically, yes. Windows is not the most stable OS out there, and programs sometime "freeze" it even without mucking with drivers and kernel-mode code. Python programs aren't any different in this respect, whether packed with py2exe or not, since Python programs on Windows easily have access to the same Windows APIs any other program can access.
However, I have a feeling you're not "just asking" if you have a specific application freezing the system, it's something that should be addressed for the specific case in hand. Unless the application does something really crazy, it's probably a bug in it that can be solved.
| 0
| 1
| 0
| 0
|
2011-05-04T13:17:00.000
| 2
| 1.2
| true
| 5,884,037
| 1
| 0
| 0
| 2
|
I am using py2exe to compiling python scripts in executable files on Windows Xp/7/2000.
I am wondering if such executable scripts could freeze the operating system, and I have to reboot Windows.
I suppose such problems could occur if I try to manage driver library.
What do you think about?
|
Delete duplicates from GoogleAppEngine Model?
| 5,890,205
| 3
| 4
| 453
| 0
|
python,google-app-engine,google-cloud-datastore,duplicates
|
Quick? Probably not.
If you did want to delete dupes, my approach would be to write a remote_api script. Query the model for all entities, sort by title, and fetch batches of 100. Keep a local Python dictionary of titles. If you encounter a new title, add it to the dictionary. If you encounter a known title, add the entity to a delete batch, and flush the deletes before moving on to the next query batch.
Probably an excessive amount of work when you can just wipe out your datastore and re-import instead.
| 0
| 1
| 0
| 0
|
2011-05-04T21:21:00.000
| 1
| 1.2
| true
| 5,890,023
| 0
| 0
| 1
| 1
|
I have two Google App Engine Models. I ran my cron's a few times and now there are duplicate entries in my datastore. If it was easy to just delete my entire datastore and upload my data again I would. BUT it took 4 hours to upload last time so I am wondering is there a quick way of deleting entries with duplicate names in the "title" field within the model?
|
Can I have subprocess.call write the output of the call to a string?
| 5,902,554
| 2
| 22
| 24,472
| 0
|
python,subprocess
|
subprocess.call() takes the same arguments as subprocess.Popen(), which includes the stdout and stderr arguments. See the docs for details.
| 0
| 1
| 0
| 0
|
2011-05-05T18:30:00.000
| 5
| 0.07983
| false
| 5,902,485
| 1
| 0
| 0
| 1
|
I want to do subprocess.call, and get the output of the call into a string. Can I do this directly, or do I need to pipe it to a file, and then read from it?
In other words, can I somehow redirect stdout and stderr into a string?
|
How to get the environment variables of a subprocess after it finishes running?
| 5,905,589
| 1
| 4
| 5,121
| 0
|
python,environment-variables,subprocess
|
Can you print them out in the first subprocess and deal with that string in python?
| 0
| 1
| 0
| 0
|
2011-05-06T00:25:00.000
| 5
| 1.2
| true
| 5,905,574
| 1
| 0
| 0
| 1
|
I'm looking for a way to do this, so that I can pass it to the environment of another subprocess.
|
Listing all USB drives in Linux
| 70,601,544
| 0
| 9
| 5,051
| 0
|
python,linux,usb,removable-storage
|
This is what I use from bash:
lsblk --pairs --nodeps | grep 'RM="1"'
Sample output:
NAME="sda" MAJ:MIN="8:0" RM="1" SIZE="59.5G" RO="0" TYPE="disk" MOUNTPOINT=""
Note it is listing the devices, not its partitions. If you like to see the partitions also,
lsblk --pairs | grep 'RM="1"'
| 0
| 1
| 0
| 0
|
2011-05-06T12:30:00.000
| 5
| 0
| false
| 5,911,445
| 0
| 0
| 0
| 1
|
How can I get a list of removable drives (plugged into USB) in Linux? I'm fine with using KDE, GNOME or other DE libraries if it would make things easier.
|
In Python on Unix, determine if I am using my computer? or idle?
| 5,914,591
| 0
| 8
| 2,328
| 0
|
python,networking,keyboard,python-idle
|
Stick a webcam on your computer that grabs an image every five seconds, then there's some python modules for image analysis that can check if you are still sitting in your seat.
Or get a microswitch wired into your chair, connect that to your PC serial port (or one of those modern USB ports) and read that from Python...
| 0
| 1
| 1
| 0
|
2011-05-06T16:40:00.000
| 5
| 0
| false
| 5,914,506
| 0
| 0
| 0
| 1
|
I would like to write a script to do an heavy network upload, in the background.
However, I would like it to pause when I am using my computer (either by detecting network activity or keyboard activity or that I am not idle).
What is the best way to detect that I am using the computer, on Python on Unix?
|
Can cx-freeze be used in Ubuntu to freeze a python script to a Windows executable?
| 5,915,297
| 4
| 6
| 1,065
| 0
|
python,cx-freeze
|
You can do that.... but you'll have to install Wine (apt-get install wine) and then install in Wine the windows version of Python and all the python libraries your application needs, and then you'll be able to freeze your script into an exe for windows in your ubuntu box.
| 0
| 1
| 0
| 0
|
2011-05-06T17:52:00.000
| 1
| 0.664037
| false
| 5,915,151
| 0
| 0
| 0
| 1
|
When I use cxfreeze in Ubuntu, it automatically compiles the python script to a Linux executable. I've looked through the documentation extensively, and I can't find a way to freeze the script into a .exe for the purposes of running the program on a Windows machine. Can this be done-?
|
How to uninstall wxpython 2.8 on Mac OSX 10.6
| 5,922,093
| 8
| 5
| 4,762
| 0
|
python,macos,wxpython,uninstallation
|
If you look in the .dmg for wxPython, there is an uninstall_wxPython.py unininstall script. Just drag it to your desktop and run python ~/Desktop/uninstall_wxPython.py in a terminal.
| 1
| 1
| 0
| 0
|
2011-05-07T11:33:00.000
| 1
| 1
| false
| 5,920,764
| 0
| 0
| 0
| 1
|
Some details of my machine and installed packages before proceeding further:
Mac OSX version: 10.6.6
Python version: Activestate Python 2.7.1
wxpython version: wxpython 2.8 (uses Carbon API hence limited to 32-bit mode arch only)
I installed wxPython2.8-osx-unicode-py2.7 from wxpython website using their .dmg installer file. This package uses the Carbon API and hence is limited to 32-bit mode only. I have to write my applications using "arch -i386" in order to import wx, and due to this limitation I am unable to import certain other packages likes "MySQLdb" which are not available in 32-bit mode. So, my best option is to uninstall wxpython 2.8 and install wxpython 2.9 because version 2.9 uses Cocoa API which has both 32-bit and 64-bit support.
I don't know how to uninstall wxpython2.8 on my Mac OSX. Can anyone please help me?
|
Pyaudio installation error - 'command 'gcc' failed with exit status 1'
| 5,922,091
| 42
| 64
| 61,454
| 0
|
python,linux,gcc,pyaudio
|
Well, I solved the problem by using the package manager,
$ sudo apt-get install python-pyaudio
Although still has no clue why easy_install fails.
| 0
| 1
| 0
| 0
|
2011-05-07T15:17:00.000
| 10
| 1
| false
| 5,921,947
| 0
| 0
| 0
| 5
|
I'm running Ubuntu 11.04, Python 2.7.1 and wanted to install Pyaudio. So I ran,
$ sudo easy_install pyaudio
in the terminal and the process exited with following error messages,
Searching for pyaudio
Reading http://pypi.python.org/simple/pyaudio/
Reading http://people.csail.mit.edu/hubert/pyaudio/
Best match: pyaudio 0.2.4
Downloading http://people.csail.mit.edu/hubert/pyaudio/packages/pyaudio-0.2.4.tar.gz
Processing pyaudio-0.2.4.tar.gz
Running PyAudio-0.2.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-0Tetss/PyAudio-0.2.4/egg-dist-tmp-PYy9T8
In file included from /usr/include/python2.7/Python.h:8:0,
from src/_portaudiomodule.c:30:
/usr/include/python2.7/pyconfig.h:1155:0: warning: "_POSIX_C_SOURCE" redefined
/usr/include/features.h:214:0: note: this is the location of the previous definition
src/_portaudiomodule.c:31:23: fatal error: portaudio.h: No such file or directory
compilation terminated.
error: Setup script exited with error: command 'gcc' failed with exit status 1
I wasn't sure whether to post this on askubuntu.com or here in stackoveflow, but anyway here it is in stackoverflow. Also I google'd a bit this question and found by installing python-dev have solved the problem for some. I've already installed python-dev. What may have gone wrong?
UPDATE
Following are the new errors I get after installing libportaudio-dev,
Searching for pyaudio
Reading http://pypi.python.org/simple/pyaudio/
Reading http://people.csail.mit.edu/hubert/pyaudio/
Best match: pyaudio 0.2.4
Downloading http://people.csail.mit.edu/hubert/pyaudio/packages/pyaudio-0.2.4.tar.gz
Processing pyaudio-0.2.4.tar.gz
Running PyAudio-0.2.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-LMpsIy/PyAudio-0.2.4/egg-dist-tmp-AExlqd
In file included from /usr/include/python2.7/Python.h:8:0,
from src/_portaudiomodule.c:30:
/usr/include/python2.7/pyconfig.h:1155:0: warning: "_POSIX_C_SOURCE" redefined
/usr/include/features.h:214:0: note: this is the location of the previous definition
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_hostApi’:
src/_portaudiomodule.c:211:38: error: ‘PaDeviceInfo’ has no member named ‘hostApi’
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultLowInputLatency’:
src/_portaudiomodule.c:253:42: error: ‘PaDeviceInfo’ has no member named ‘defaultLowInputLatency’
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultLowOutputLatency’:
src/_portaudiomodule.c:267:42: error: ‘PaDeviceInfo’ has no member named ‘defaultLowOutputLatency’
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultHighInputLatency’:
src/_portaudiomodule.c:282:42: error: ‘PaDeviceInfo’ has no member named ‘defaultHighInputLatency’
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultHighOutputLatency’:
src/_portaudiomodule.c:296:42: error: ‘PaDeviceInfo’ has no member named ‘defaultHighOutputLatency’
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultSampleRate’:
src/_portaudiomodule.c:310:42: error: ‘PaDeviceInfo’ has no member named ‘defaultSampleRate’
src/_portaudiomodule.c: At top level:
src/_portaudiomodule.c:465:3: error: expected specifier-qualifier-list before ‘PaHostApiInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_structVersion’:
src/_portaudiomodule.c:475:13: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c:481:29: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_type’:
src/_portaudiomodule.c:489:13: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c:495:36: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_name’:
src/_portaudiomodule.c:503:13: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c:503:32: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c:509:34: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_deviceCount’:
src/_portaudiomodule.c:517:13: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c:523:29: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_defaultInputDevice’:
src/_portaudiomodule.c:531:13: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c:537:29: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_defaultOutputDevice’:
src/_portaudiomodule.c:545:13: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c:551:29: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_dealloc’:
src/_portaudiomodule.c:569:7: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: At top level:
src/_portaudiomodule.c:910:3: error: expected specifier-qualifier-list before ‘PaStreamParameters’
src/_portaudiomodule.c: In function ‘_is_open’:
src/_portaudiomodule.c:921:23: error: ‘_pyAudio_Stream’ has no member named ‘is_open’
src/_portaudiomodule.c: In function ‘_cleanup_Stream_object’:
src/_portaudiomodule.c:932:19: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c:933:17: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c:935:19: error: ‘_pyAudio_Stream’ has no member named ‘inputParameters’
src/_portaudiomodule.c:936:22: error: ‘_pyAudio_Stream’ has no member named ‘inputParameters’
src/_portaudiomodule.c:937:17: error: ‘_pyAudio_Stream’ has no member named ‘inputParameters’
src/_portaudiomodule.c:940:19: error: ‘_pyAudio_Stream’ has no member named ‘outputParameters’
src/_portaudiomodule.c:941:22: error: ‘_pyAudio_Stream’ has no member named ‘outputParameters’
src/_portaudiomodule.c:942:17: error: ‘_pyAudio_Stream’ has no member named ‘outputParameters’
src/_portaudiomodule.c:946:15: error: ‘_pyAudio_Stream’ has no member named ‘is_open’
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_structVersion’:
src/_portaudiomodule.c:973:13: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c:981:29: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_inputLatency’:
src/_portaudiomodule.c:998:13: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c:1006:33: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_outputLatency’:
src/_portaudiomodule.c:1023:13: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c:1031:33: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_sampleRate’:
src/_portaudiomodule.c:1048:13: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c:1056:33: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c: In function ‘pa_get_version’:
src/_portaudiomodule.c:1168:3: warning: implicit declaration of function ‘Pa_GetVersion’
src/_portaudiomodule.c: In function ‘pa_get_version_text’:
src/_portaudiomodule.c:1177:3: warning: implicit declaration of function ‘Pa_GetVersionText’
src/_portaudiomodule.c:1177:3: warning: passing argument 1 of ‘PyString_FromString’ makes pointer from integer without a cast
/usr/include/python2.7/stringobject.h:63:24: note: expected ‘const char *’ but argument is of type ‘int’
src/_portaudiomodule.c: In function ‘pa_get_host_api_count’:
src/_portaudiomodule.c:1221:3: error: ‘PaHostApiIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1221:3: note: each undeclared identifier is reported only once for each function it appears in
src/_portaudiomodule.c:1221:18: error: expected ‘;’ before ‘count’
src/_portaudiomodule.c:1226:3: error: ‘count’ undeclared (first use in this function)
src/_portaudiomodule.c:1226:3: warning: implicit declaration of function ‘Pa_GetHostApiCount’
src/_portaudiomodule.c: In function ‘pa_get_default_host_api’:
src/_portaudiomodule.c:1248:3: error: ‘PaHostApiIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1248:18: error: expected ‘;’ before ‘index’
src/_portaudiomodule.c:1253:3: warning: implicit declaration of function ‘Pa_GetDefaultHostApi’
src/_portaudiomodule.c:1253:3: error: lvalue required as left operand of assignment
src/_portaudiomodule.c:1265:7: warning: passing argument 1 of ‘Pa_GetErrorText’ makes integer from pointer without a cast
/usr/include/portaudio.h:93:13: note: expected ‘PaError’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c:1269:3: warning: passing argument 1 of ‘PyInt_FromLong’ makes integer from pointer without a cast
/usr/include/python2.7/intobject.h:38:24: note: expected ‘long int’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c: In function ‘pa_host_api_type_id_to_host_api_index’:
src/_portaudiomodule.c:1275:3: error: ‘PaHostApiTypeId’ undeclared (first use in this function)
src/_portaudiomodule.c:1275:19: error: expected ‘;’ before ‘typeid’
src/_portaudiomodule.c:1276:3: error: ‘PaHostApiIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1276:18: error: expected ‘;’ before ‘index’
src/_portaudiomodule.c:1278:37: error: ‘typeid’ undeclared (first use in this function)
src/_portaudiomodule.c:1281:3: warning: implicit declaration of function ‘Pa_HostApiTypeIdToHostApiIndex’
src/_portaudiomodule.c:1293:7: warning: passing argument 1 of ‘Pa_GetErrorText’ makes integer from pointer without a cast
/usr/include/portaudio.h:93:13: note: expected ‘PaError’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c:1297:3: warning: passing argument 1 of ‘PyInt_FromLong’ makes integer from pointer without a cast
/usr/include/python2.7/intobject.h:38:24: note: expected ‘long int’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c: In function ‘pa_host_api_device_index_to_device_index’:
src/_portaudiomodule.c:1303:3: error: ‘PaHostApiIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1303:18: error: expected ‘;’ before ‘apiIndex’
src/_portaudiomodule.c:1305:3: error: ‘PaDeviceIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1305:17: error: expected ‘;’ before ‘devIndex’
src/_portaudiomodule.c:1308:38: error: ‘apiIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1311:3: error: ‘devIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1311:3: warning: implicit declaration of function ‘Pa_HostApiDeviceIndexToDeviceIndex’
src/_portaudiomodule.c: In function ‘pa_get_host_api_info’:
src/_portaudiomodule.c:1332:3: error: ‘PaHostApiIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1332:18: error: expected ‘;’ before ‘index’
src/_portaudiomodule.c:1333:3: error: ‘PaHostApiInfo’ undeclared (first use in this function)
src/_portaudiomodule.c:1333:18: error: ‘_info’ undeclared (first use in this function)
src/_portaudiomodule.c:1339:27: error: expected expression before ‘)’ token
src/_portaudiomodule.c:1345:7: error: ‘paInvalidHostApi’ undeclared (first use in this function)
src/_portaudiomodule.c:1350:10: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: In function ‘pa_get_device_count’:
src/_portaudiomodule.c:1364:3: error: ‘PaDeviceIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1364:17: error: expected ‘;’ before ‘count’
src/_portaudiomodule.c:1369:3: error: ‘count’ undeclared (first use in this function)
src/_portaudiomodule.c:1369:3: warning: implicit declaration of function ‘Pa_GetDeviceCount’
src/_portaudiomodule.c: In function ‘pa_get_default_input_device’:
src/_portaudiomodule.c:1390:3: error: ‘PaDeviceIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1390:17: error: expected ‘;’ before ‘index’
src/_portaudiomodule.c:1395:3: warning: implicit declaration of function ‘Pa_GetDefaultInputDevice’
src/_portaudiomodule.c:1395:3: error: lvalue required as left operand of assignment
src/_portaudiomodule.c:1396:13: warning: comparison between pointer and integer
src/_portaudiomodule.c:1409:7: warning: passing argument 1 of ‘Pa_GetErrorText’ makes integer from pointer without a cast
/usr/include/portaudio.h:93:13: note: expected ‘PaError’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c:1413:3: warning: passing argument 1 of ‘PyInt_FromLong’ makes integer from pointer without a cast
/usr/include/python2.7/intobject.h:38:24: note: expected ‘long int’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c: In function ‘pa_get_default_output_device’:
src/_portaudiomodule.c:1419:3: error: ‘PaDeviceIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1419:17: error: expected ‘;’ before ‘index’
src/_portaudiomodule.c:1424:3: warning: implicit declaration of function ‘Pa_GetDefaultOutputDevice’
src/_portaudiomodule.c:1424:3: error: lvalue required as left operand of assignment
src/_portaudiomodule.c:1425:13: warning: comparison between pointer and integer
src/_portaudiomodule.c:1438:7: warning: passing argument 1 of ‘Pa_GetErrorText’ makes integer from pointer without a cast
/usr/include/portaudio.h:93:13: note: expected ‘PaError’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c:1442:3: warning: passing argument 1 of ‘PyInt_FromLong’ makes integer from pointer without a cast
/usr/include/python2.7/intobject.h:38:24: note: expected ‘long int’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c: In function ‘pa_get_device_info’:
src/_portaudiomodule.c:1448:3: error: ‘PaDeviceIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1448:17: error: expected ‘;’ before ‘index’
src/_portaudiomodule.c:1455:3: warning: passing argument 1 of ‘Pa_GetDeviceInfo’ makes integer from pointer without a cast
/usr/include/portaudio.h:182:21: note: expected ‘PaDeviceID’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c:1460:30: error: ‘paInvalidDevice’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘pa_open’:
src/_portaudiomodule.c:1601:3: error: ‘PaStreamParameters’ undeclared (first use in this function)
src/_portaudiomodule.c:1601:23: error: ‘outputParameters’ undeclared (first use in this function)
src/_portaudiomodule.c:1602:23: error: ‘inputParameters’ undeclared (first use in this function)
src/_portaudiomodule.c:1606:28: error: expected expression before ‘)’ token
src/_portaudiomodule.c:1622:9: error: ‘paInvalidDevice’ undeclared (first use in this function)
src/_portaudiomodule.c:1643:28: error: expected expression before ‘)’ token
src/_portaudiomodule.c:1679:3: error: ‘PaStreamInfo’ undeclared (first use in this function)
src/_portaudiomodule.c:1679:17: error: ‘streamInfo’ undeclared (first use in this function)
src/_portaudiomodule.c:1696:9: warning: passing argument 5 of ‘Pa_OpenStream’ makes pointer from integer without a cast
/usr/include/portaudio.h:325:9: note: expected ‘void *’ but argument is of type ‘int’
src/_portaudiomodule.c:1696:9: warning: passing argument 7 of ‘Pa_OpenStream’ makes integer from pointer without a cast
/usr/include/portaudio.h:325:9: note: expected ‘int’ but argument is of type ‘void *’
src/_portaudiomodule.c:1696:9: warning: passing argument 8 of ‘Pa_OpenStream’ makes integer from pointer without a cast
/usr/include/portaudio.h:325:9: note: expected ‘PaSampleFormat’ but argument is of type ‘void *’
src/_portaudiomodule.c:1696:9: error: too few arguments to function ‘Pa_OpenStream’
/usr/include/portaudio.h:325:9: note: declared here
src/_portaudiomodule.c:1712:31: error: expected expression before ‘)’ token
src/_portaudiomodule.c:1724:15: error: ‘_pyAudio_Stream’ has no member named ‘inputParameters’
src/_portaudiomodule.c:1725:15: error: ‘_pyAudio_Stream’ has no member named ‘outputParameters’
src/_portaudiomodule.c:1726:15: error: ‘_pyAudio_Stream’ has no member named ‘is_open’
src/_portaudiomodule.c:1727:15: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c: In function ‘pa_is_format_supported’:
src/_portaudiomodule.c:1791:3: error: ‘PaStreamParameters’ undeclared (first use in this function)
src/_portaudiomodule.c:1791:22: error: expected ‘;’ before ‘inputParams’
src/_portaudiomodule.c:1792:22: error: expected ‘;’ before ‘outputParams’
src/_portaudiomodule.c:1812:5: error: ‘inputParams’ undeclared (first use in this function)
src/_portaudiomodule.c:1820:5: error: ‘outputParams’ undeclared (first use in this function)
src/_portaudiomodule.c:1827:3: warning: implicit declaration of function ‘Pa_IsFormatSupported’
src/_portaudiomodule.c:1831:16: error: ‘paFormatIsSupported’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘pa_start_stream’:
src/_portaudiomodule.c:1870:16: error: ‘paStreamIsNotStopped’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘pa_stop_stream’:
src/_portaudiomodule.c:1911:16: error: ‘paStreamIsStopped’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘pa_abort_stream’:
src/_portaudiomodule.c:1952:16: error: ‘paStreamIsStopped’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘pa_is_stream_stopped’:
src/_portaudiomodule.c:1994:3: warning: implicit declaration of function ‘Pa_IsStreamStopped’
src/_portaudiomodule.c: In function ‘pa_is_stream_active’:
src/_portaudiomodule.c:2039:3: warning: implicit declaration of function ‘Pa_IsStreamActive’
src/_portaudiomodule.c: In function ‘pa_get_stream_time’:
src/_portaudiomodule.c:2086:3: warning: implicit declaration of function ‘Pa_GetStreamTime’
src/_portaudiomodule.c: In function ‘pa_get_stream_cpu_load’:
src/_portaudiomodule.c:2118:3: warning: implicit declaration of function ‘Pa_GetStreamCpuLoad’
src/_portaudiomodule.c: In function ‘pa_write_stream’:
src/_portaudiomodule.c:2167:3: warning: implicit declaration of function ‘Pa_WriteStream’
src/_portaudiomodule.c:2171:16: error: ‘paOutputUnderflowed’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘pa_read_stream’:
src/_portaudiomodule.c:2233:3: error: ‘PaStreamParameters’ undeclared (first use in this function)
src/_portaudiomodule.c:2233:23: error: ‘inputParameters’ undeclared (first use in this function)
src/_portaudiomodule.c:2233:53: error: ‘_pyAudio_Stream’ has no member named ‘inputParameters’
src/_portaudiomodule.c:2253:3: warning: implicit declaration of function ‘Pa_ReadStream’
src/_portaudiomodule.c:2259:15: error: ‘paInputOverflowed’ undeclared (first use in this function)
src/_portaudiomodule.c:2265:22: error: ‘paOutputUnderflowed’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘pa_get_stream_write_available’:
src/_portaudiomodule.c:2309:3: warning: implicit declaration of function ‘Pa_GetStreamWriteAvailable’
src/_portaudiomodule.c: In function ‘pa_get_stream_read_available’:
src/_portaudiomodule.c:2334:3: warning: implicit declaration of function ‘Pa_GetStreamReadAvailable’
src/_portaudiomodule.c: In function ‘init_portaudio’:
src/_portaudiomodule.c:2384:49: error: ‘paInDevelopment’ undeclared (first use in this function)
src/_portaudiomodule.c:2385:47: error: ‘paDirectSound’ undeclared (first use in this function)
src/_portaudiomodule.c:2386:39: error: ‘paMME’ undeclared (first use in this function)
src/_portaudiomodule.c:2387:40: error: ‘paASIO’ undeclared (first use in this function)
src/_portaudiomodule.c:2388:48: error: ‘paSoundManager’ undeclared (first use in this function)
src/_portaudiomodule.c:2389:45: error: ‘paCoreAudio’ undeclared (first use in this function)
src/_portaudiomodule.c:2390:39: error: ‘paOSS’ undeclared (first use in this function)
src/_portaudiomodule.c:2391:40: error: ‘paALSA’ undeclared (first use in this function)
src/_portaudiomodule.c:2392:38: error: ‘paAL’ undeclared (first use in this function)
src/_portaudiomodule.c:2393:40: error: ‘paBeOS’ undeclared (first use in this function)
src/_portaudiomodule.c:2394:41: error: ‘paWDMKS’ undeclared (first use in this function)
src/_portaudiomodule.c:2395:40: error: ‘paJACK’ undeclared (first use in this function)
src/_portaudiomodule.c:2396:42: error: ‘paWASAPI’ undeclared (first use in this function)
src/_portaudiomodule.c:2410:50: error: ‘paNotInitialized’ undeclared (first use in this function)
src/_portaudiomodule.c:2412:6: error: ‘paUnanticipatedHostError’ undeclared (first use in this function)
src/_portaudiomodule.c:2417:49: error: ‘paInvalidDevice’ undeclared (first use in this function)
src/_portaudiomodule.c:2433:6: error: ‘paIncompatibleHostApiSpecificStreamInfo’ undeclared (first use in this function)
src/_portaudiomodule.c:2434:51: error: ‘paStreamIsStopped’ undeclared (first use in this function)
src/_portaudiomodule.c:2435:54: error: ‘paStreamIsNotStopped’ undeclared (first use in this function)
src/_portaudiomodule.c:2436:51: error: ‘paInputOverflowed’ undeclared (first use in this function)
src/_portaudiomodule.c:2437:53: error: ‘paOutputUnderflowed’ undeclared (first use in this function)
src/_portaudiomodule.c:2438:51: error: ‘paHostApiNotFound’ undeclared (first use in this function)
src/_portaudiomodule.c:2439:50: error: ‘paInvalidHostApi’ undeclared (first use in this function)
src/_portaudiomodule.c:2441:6: error: ‘paCanNotReadFromACallbackStream’ undeclared (first use in this function)
src/_portaudiomodule.c:2443:6: error: ‘paCanNotWriteToACallbackStream’ undeclared (first use in this function)
src/_portaudiomodule.c:2445:6: error: ‘paCanNotReadFromAnOutputOnlyStream’ undeclared (first use in this function)
src/_portaudiomodule.c:2447:6: error: ‘paCanNotWriteToAnInputOnlyStream’ undeclared (first use in this function)
src/_portaudiomodule.c:2449:6: error: ‘paIncompatibleStreamHostApi’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_defaultOutputDevice’:
src/_portaudiomodule.c:552:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_defaultInputDevice’:
src/_portaudiomodule.c:538:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_deviceCount’:
src/_portaudiomodule.c:524:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_type’:
src/_portaudiomodule.c:496:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_structVersion’:
src/_portaudiomodule.c:482:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_name’:
src/_portaudiomodule.c:510:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultSampleRate’:
src/_portaudiomodule.c:311:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultHighOutputLatency’:
src/_portaudiomodule.c:297:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultHighInputLatency’:
src/_portaudiomodule.c:283:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultLowOutputLatency’:
src/_portaudiomodule.c:268:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultLowInputLatency’:
src/_portaudiomodule.c:254:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_hostApi’:
src/_portaudiomodule.c:212:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_sampleRate’:
src/_portaudiomodule.c:1057:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_is_open’:
src/_portaudiomodule.c:922:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_outputLatency’:
src/_portaudiomodule.c:1032:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_inputLatency’:
src/_portaudiomodule.c:1007:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_structVersion’:
src/_portaudiomodule.c:982:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘pa_is_format_supported’:
src/_portaudiomodule.c:1841:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘pa_get_device_count’:
src/_portaudiomodule.c:1385:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘pa_host_api_device_index_to_device_index’:
src/_portaudiomodule.c:1327:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘pa_get_host_api_count’:
src/_portaudiomodule.c:1243:1: warning: control reaches end of non-void function
error: Setup script exited with error: command 'gcc' failed with exit status 1
|
Pyaudio installation error - 'command 'gcc' failed with exit status 1'
| 44,772,116
| 27
| 64
| 61,454
| 0
|
python,linux,gcc,pyaudio
|
I install in my virtualenv. pyaudio (0.2.11)
pip install pyaudio -> error
sudo apt-get install portaudio19-dev -> success
pip install pyaudio -> success
| 0
| 1
| 0
| 0
|
2011-05-07T15:17:00.000
| 10
| 1
| false
| 5,921,947
| 0
| 0
| 0
| 5
|
I'm running Ubuntu 11.04, Python 2.7.1 and wanted to install Pyaudio. So I ran,
$ sudo easy_install pyaudio
in the terminal and the process exited with following error messages,
Searching for pyaudio
Reading http://pypi.python.org/simple/pyaudio/
Reading http://people.csail.mit.edu/hubert/pyaudio/
Best match: pyaudio 0.2.4
Downloading http://people.csail.mit.edu/hubert/pyaudio/packages/pyaudio-0.2.4.tar.gz
Processing pyaudio-0.2.4.tar.gz
Running PyAudio-0.2.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-0Tetss/PyAudio-0.2.4/egg-dist-tmp-PYy9T8
In file included from /usr/include/python2.7/Python.h:8:0,
from src/_portaudiomodule.c:30:
/usr/include/python2.7/pyconfig.h:1155:0: warning: "_POSIX_C_SOURCE" redefined
/usr/include/features.h:214:0: note: this is the location of the previous definition
src/_portaudiomodule.c:31:23: fatal error: portaudio.h: No such file or directory
compilation terminated.
error: Setup script exited with error: command 'gcc' failed with exit status 1
I wasn't sure whether to post this on askubuntu.com or here in stackoveflow, but anyway here it is in stackoverflow. Also I google'd a bit this question and found by installing python-dev have solved the problem for some. I've already installed python-dev. What may have gone wrong?
UPDATE
Following are the new errors I get after installing libportaudio-dev,
Searching for pyaudio
Reading http://pypi.python.org/simple/pyaudio/
Reading http://people.csail.mit.edu/hubert/pyaudio/
Best match: pyaudio 0.2.4
Downloading http://people.csail.mit.edu/hubert/pyaudio/packages/pyaudio-0.2.4.tar.gz
Processing pyaudio-0.2.4.tar.gz
Running PyAudio-0.2.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-LMpsIy/PyAudio-0.2.4/egg-dist-tmp-AExlqd
In file included from /usr/include/python2.7/Python.h:8:0,
from src/_portaudiomodule.c:30:
/usr/include/python2.7/pyconfig.h:1155:0: warning: "_POSIX_C_SOURCE" redefined
/usr/include/features.h:214:0: note: this is the location of the previous definition
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_hostApi’:
src/_portaudiomodule.c:211:38: error: ‘PaDeviceInfo’ has no member named ‘hostApi’
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultLowInputLatency’:
src/_portaudiomodule.c:253:42: error: ‘PaDeviceInfo’ has no member named ‘defaultLowInputLatency’
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultLowOutputLatency’:
src/_portaudiomodule.c:267:42: error: ‘PaDeviceInfo’ has no member named ‘defaultLowOutputLatency’
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultHighInputLatency’:
src/_portaudiomodule.c:282:42: error: ‘PaDeviceInfo’ has no member named ‘defaultHighInputLatency’
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultHighOutputLatency’:
src/_portaudiomodule.c:296:42: error: ‘PaDeviceInfo’ has no member named ‘defaultHighOutputLatency’
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultSampleRate’:
src/_portaudiomodule.c:310:42: error: ‘PaDeviceInfo’ has no member named ‘defaultSampleRate’
src/_portaudiomodule.c: At top level:
src/_portaudiomodule.c:465:3: error: expected specifier-qualifier-list before ‘PaHostApiInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_structVersion’:
src/_portaudiomodule.c:475:13: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c:481:29: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_type’:
src/_portaudiomodule.c:489:13: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c:495:36: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_name’:
src/_portaudiomodule.c:503:13: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c:503:32: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c:509:34: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_deviceCount’:
src/_portaudiomodule.c:517:13: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c:523:29: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_defaultInputDevice’:
src/_portaudiomodule.c:531:13: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c:537:29: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_defaultOutputDevice’:
src/_portaudiomodule.c:545:13: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c:551:29: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_dealloc’:
src/_portaudiomodule.c:569:7: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: At top level:
src/_portaudiomodule.c:910:3: error: expected specifier-qualifier-list before ‘PaStreamParameters’
src/_portaudiomodule.c: In function ‘_is_open’:
src/_portaudiomodule.c:921:23: error: ‘_pyAudio_Stream’ has no member named ‘is_open’
src/_portaudiomodule.c: In function ‘_cleanup_Stream_object’:
src/_portaudiomodule.c:932:19: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c:933:17: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c:935:19: error: ‘_pyAudio_Stream’ has no member named ‘inputParameters’
src/_portaudiomodule.c:936:22: error: ‘_pyAudio_Stream’ has no member named ‘inputParameters’
src/_portaudiomodule.c:937:17: error: ‘_pyAudio_Stream’ has no member named ‘inputParameters’
src/_portaudiomodule.c:940:19: error: ‘_pyAudio_Stream’ has no member named ‘outputParameters’
src/_portaudiomodule.c:941:22: error: ‘_pyAudio_Stream’ has no member named ‘outputParameters’
src/_portaudiomodule.c:942:17: error: ‘_pyAudio_Stream’ has no member named ‘outputParameters’
src/_portaudiomodule.c:946:15: error: ‘_pyAudio_Stream’ has no member named ‘is_open’
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_structVersion’:
src/_portaudiomodule.c:973:13: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c:981:29: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_inputLatency’:
src/_portaudiomodule.c:998:13: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c:1006:33: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_outputLatency’:
src/_portaudiomodule.c:1023:13: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c:1031:33: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_sampleRate’:
src/_portaudiomodule.c:1048:13: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c:1056:33: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c: In function ‘pa_get_version’:
src/_portaudiomodule.c:1168:3: warning: implicit declaration of function ‘Pa_GetVersion’
src/_portaudiomodule.c: In function ‘pa_get_version_text’:
src/_portaudiomodule.c:1177:3: warning: implicit declaration of function ‘Pa_GetVersionText’
src/_portaudiomodule.c:1177:3: warning: passing argument 1 of ‘PyString_FromString’ makes pointer from integer without a cast
/usr/include/python2.7/stringobject.h:63:24: note: expected ‘const char *’ but argument is of type ‘int’
src/_portaudiomodule.c: In function ‘pa_get_host_api_count’:
src/_portaudiomodule.c:1221:3: error: ‘PaHostApiIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1221:3: note: each undeclared identifier is reported only once for each function it appears in
src/_portaudiomodule.c:1221:18: error: expected ‘;’ before ‘count’
src/_portaudiomodule.c:1226:3: error: ‘count’ undeclared (first use in this function)
src/_portaudiomodule.c:1226:3: warning: implicit declaration of function ‘Pa_GetHostApiCount’
src/_portaudiomodule.c: In function ‘pa_get_default_host_api’:
src/_portaudiomodule.c:1248:3: error: ‘PaHostApiIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1248:18: error: expected ‘;’ before ‘index’
src/_portaudiomodule.c:1253:3: warning: implicit declaration of function ‘Pa_GetDefaultHostApi’
src/_portaudiomodule.c:1253:3: error: lvalue required as left operand of assignment
src/_portaudiomodule.c:1265:7: warning: passing argument 1 of ‘Pa_GetErrorText’ makes integer from pointer without a cast
/usr/include/portaudio.h:93:13: note: expected ‘PaError’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c:1269:3: warning: passing argument 1 of ‘PyInt_FromLong’ makes integer from pointer without a cast
/usr/include/python2.7/intobject.h:38:24: note: expected ‘long int’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c: In function ‘pa_host_api_type_id_to_host_api_index’:
src/_portaudiomodule.c:1275:3: error: ‘PaHostApiTypeId’ undeclared (first use in this function)
src/_portaudiomodule.c:1275:19: error: expected ‘;’ before ‘typeid’
src/_portaudiomodule.c:1276:3: error: ‘PaHostApiIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1276:18: error: expected ‘;’ before ‘index’
src/_portaudiomodule.c:1278:37: error: ‘typeid’ undeclared (first use in this function)
src/_portaudiomodule.c:1281:3: warning: implicit declaration of function ‘Pa_HostApiTypeIdToHostApiIndex’
src/_portaudiomodule.c:1293:7: warning: passing argument 1 of ‘Pa_GetErrorText’ makes integer from pointer without a cast
/usr/include/portaudio.h:93:13: note: expected ‘PaError’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c:1297:3: warning: passing argument 1 of ‘PyInt_FromLong’ makes integer from pointer without a cast
/usr/include/python2.7/intobject.h:38:24: note: expected ‘long int’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c: In function ‘pa_host_api_device_index_to_device_index’:
src/_portaudiomodule.c:1303:3: error: ‘PaHostApiIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1303:18: error: expected ‘;’ before ‘apiIndex’
src/_portaudiomodule.c:1305:3: error: ‘PaDeviceIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1305:17: error: expected ‘;’ before ‘devIndex’
src/_portaudiomodule.c:1308:38: error: ‘apiIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1311:3: error: ‘devIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1311:3: warning: implicit declaration of function ‘Pa_HostApiDeviceIndexToDeviceIndex’
src/_portaudiomodule.c: In function ‘pa_get_host_api_info’:
src/_portaudiomodule.c:1332:3: error: ‘PaHostApiIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1332:18: error: expected ‘;’ before ‘index’
src/_portaudiomodule.c:1333:3: error: ‘PaHostApiInfo’ undeclared (first use in this function)
src/_portaudiomodule.c:1333:18: error: ‘_info’ undeclared (first use in this function)
src/_portaudiomodule.c:1339:27: error: expected expression before ‘)’ token
src/_portaudiomodule.c:1345:7: error: ‘paInvalidHostApi’ undeclared (first use in this function)
src/_portaudiomodule.c:1350:10: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: In function ‘pa_get_device_count’:
src/_portaudiomodule.c:1364:3: error: ‘PaDeviceIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1364:17: error: expected ‘;’ before ‘count’
src/_portaudiomodule.c:1369:3: error: ‘count’ undeclared (first use in this function)
src/_portaudiomodule.c:1369:3: warning: implicit declaration of function ‘Pa_GetDeviceCount’
src/_portaudiomodule.c: In function ‘pa_get_default_input_device’:
src/_portaudiomodule.c:1390:3: error: ‘PaDeviceIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1390:17: error: expected ‘;’ before ‘index’
src/_portaudiomodule.c:1395:3: warning: implicit declaration of function ‘Pa_GetDefaultInputDevice’
src/_portaudiomodule.c:1395:3: error: lvalue required as left operand of assignment
src/_portaudiomodule.c:1396:13: warning: comparison between pointer and integer
src/_portaudiomodule.c:1409:7: warning: passing argument 1 of ‘Pa_GetErrorText’ makes integer from pointer without a cast
/usr/include/portaudio.h:93:13: note: expected ‘PaError’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c:1413:3: warning: passing argument 1 of ‘PyInt_FromLong’ makes integer from pointer without a cast
/usr/include/python2.7/intobject.h:38:24: note: expected ‘long int’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c: In function ‘pa_get_default_output_device’:
src/_portaudiomodule.c:1419:3: error: ‘PaDeviceIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1419:17: error: expected ‘;’ before ‘index’
src/_portaudiomodule.c:1424:3: warning: implicit declaration of function ‘Pa_GetDefaultOutputDevice’
src/_portaudiomodule.c:1424:3: error: lvalue required as left operand of assignment
src/_portaudiomodule.c:1425:13: warning: comparison between pointer and integer
src/_portaudiomodule.c:1438:7: warning: passing argument 1 of ‘Pa_GetErrorText’ makes integer from pointer without a cast
/usr/include/portaudio.h:93:13: note: expected ‘PaError’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c:1442:3: warning: passing argument 1 of ‘PyInt_FromLong’ makes integer from pointer without a cast
/usr/include/python2.7/intobject.h:38:24: note: expected ‘long int’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c: In function ‘pa_get_device_info’:
src/_portaudiomodule.c:1448:3: error: ‘PaDeviceIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1448:17: error: expected ‘;’ before ‘index’
src/_portaudiomodule.c:1455:3: warning: passing argument 1 of ‘Pa_GetDeviceInfo’ makes integer from pointer without a cast
/usr/include/portaudio.h:182:21: note: expected ‘PaDeviceID’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c:1460:30: error: ‘paInvalidDevice’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘pa_open’:
src/_portaudiomodule.c:1601:3: error: ‘PaStreamParameters’ undeclared (first use in this function)
src/_portaudiomodule.c:1601:23: error: ‘outputParameters’ undeclared (first use in this function)
src/_portaudiomodule.c:1602:23: error: ‘inputParameters’ undeclared (first use in this function)
src/_portaudiomodule.c:1606:28: error: expected expression before ‘)’ token
src/_portaudiomodule.c:1622:9: error: ‘paInvalidDevice’ undeclared (first use in this function)
src/_portaudiomodule.c:1643:28: error: expected expression before ‘)’ token
src/_portaudiomodule.c:1679:3: error: ‘PaStreamInfo’ undeclared (first use in this function)
src/_portaudiomodule.c:1679:17: error: ‘streamInfo’ undeclared (first use in this function)
src/_portaudiomodule.c:1696:9: warning: passing argument 5 of ‘Pa_OpenStream’ makes pointer from integer without a cast
/usr/include/portaudio.h:325:9: note: expected ‘void *’ but argument is of type ‘int’
src/_portaudiomodule.c:1696:9: warning: passing argument 7 of ‘Pa_OpenStream’ makes integer from pointer without a cast
/usr/include/portaudio.h:325:9: note: expected ‘int’ but argument is of type ‘void *’
src/_portaudiomodule.c:1696:9: warning: passing argument 8 of ‘Pa_OpenStream’ makes integer from pointer without a cast
/usr/include/portaudio.h:325:9: note: expected ‘PaSampleFormat’ but argument is of type ‘void *’
src/_portaudiomodule.c:1696:9: error: too few arguments to function ‘Pa_OpenStream’
/usr/include/portaudio.h:325:9: note: declared here
src/_portaudiomodule.c:1712:31: error: expected expression before ‘)’ token
src/_portaudiomodule.c:1724:15: error: ‘_pyAudio_Stream’ has no member named ‘inputParameters’
src/_portaudiomodule.c:1725:15: error: ‘_pyAudio_Stream’ has no member named ‘outputParameters’
src/_portaudiomodule.c:1726:15: error: ‘_pyAudio_Stream’ has no member named ‘is_open’
src/_portaudiomodule.c:1727:15: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c: In function ‘pa_is_format_supported’:
src/_portaudiomodule.c:1791:3: error: ‘PaStreamParameters’ undeclared (first use in this function)
src/_portaudiomodule.c:1791:22: error: expected ‘;’ before ‘inputParams’
src/_portaudiomodule.c:1792:22: error: expected ‘;’ before ‘outputParams’
src/_portaudiomodule.c:1812:5: error: ‘inputParams’ undeclared (first use in this function)
src/_portaudiomodule.c:1820:5: error: ‘outputParams’ undeclared (first use in this function)
src/_portaudiomodule.c:1827:3: warning: implicit declaration of function ‘Pa_IsFormatSupported’
src/_portaudiomodule.c:1831:16: error: ‘paFormatIsSupported’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘pa_start_stream’:
src/_portaudiomodule.c:1870:16: error: ‘paStreamIsNotStopped’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘pa_stop_stream’:
src/_portaudiomodule.c:1911:16: error: ‘paStreamIsStopped’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘pa_abort_stream’:
src/_portaudiomodule.c:1952:16: error: ‘paStreamIsStopped’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘pa_is_stream_stopped’:
src/_portaudiomodule.c:1994:3: warning: implicit declaration of function ‘Pa_IsStreamStopped’
src/_portaudiomodule.c: In function ‘pa_is_stream_active’:
src/_portaudiomodule.c:2039:3: warning: implicit declaration of function ‘Pa_IsStreamActive’
src/_portaudiomodule.c: In function ‘pa_get_stream_time’:
src/_portaudiomodule.c:2086:3: warning: implicit declaration of function ‘Pa_GetStreamTime’
src/_portaudiomodule.c: In function ‘pa_get_stream_cpu_load’:
src/_portaudiomodule.c:2118:3: warning: implicit declaration of function ‘Pa_GetStreamCpuLoad’
src/_portaudiomodule.c: In function ‘pa_write_stream’:
src/_portaudiomodule.c:2167:3: warning: implicit declaration of function ‘Pa_WriteStream’
src/_portaudiomodule.c:2171:16: error: ‘paOutputUnderflowed’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘pa_read_stream’:
src/_portaudiomodule.c:2233:3: error: ‘PaStreamParameters’ undeclared (first use in this function)
src/_portaudiomodule.c:2233:23: error: ‘inputParameters’ undeclared (first use in this function)
src/_portaudiomodule.c:2233:53: error: ‘_pyAudio_Stream’ has no member named ‘inputParameters’
src/_portaudiomodule.c:2253:3: warning: implicit declaration of function ‘Pa_ReadStream’
src/_portaudiomodule.c:2259:15: error: ‘paInputOverflowed’ undeclared (first use in this function)
src/_portaudiomodule.c:2265:22: error: ‘paOutputUnderflowed’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘pa_get_stream_write_available’:
src/_portaudiomodule.c:2309:3: warning: implicit declaration of function ‘Pa_GetStreamWriteAvailable’
src/_portaudiomodule.c: In function ‘pa_get_stream_read_available’:
src/_portaudiomodule.c:2334:3: warning: implicit declaration of function ‘Pa_GetStreamReadAvailable’
src/_portaudiomodule.c: In function ‘init_portaudio’:
src/_portaudiomodule.c:2384:49: error: ‘paInDevelopment’ undeclared (first use in this function)
src/_portaudiomodule.c:2385:47: error: ‘paDirectSound’ undeclared (first use in this function)
src/_portaudiomodule.c:2386:39: error: ‘paMME’ undeclared (first use in this function)
src/_portaudiomodule.c:2387:40: error: ‘paASIO’ undeclared (first use in this function)
src/_portaudiomodule.c:2388:48: error: ‘paSoundManager’ undeclared (first use in this function)
src/_portaudiomodule.c:2389:45: error: ‘paCoreAudio’ undeclared (first use in this function)
src/_portaudiomodule.c:2390:39: error: ‘paOSS’ undeclared (first use in this function)
src/_portaudiomodule.c:2391:40: error: ‘paALSA’ undeclared (first use in this function)
src/_portaudiomodule.c:2392:38: error: ‘paAL’ undeclared (first use in this function)
src/_portaudiomodule.c:2393:40: error: ‘paBeOS’ undeclared (first use in this function)
src/_portaudiomodule.c:2394:41: error: ‘paWDMKS’ undeclared (first use in this function)
src/_portaudiomodule.c:2395:40: error: ‘paJACK’ undeclared (first use in this function)
src/_portaudiomodule.c:2396:42: error: ‘paWASAPI’ undeclared (first use in this function)
src/_portaudiomodule.c:2410:50: error: ‘paNotInitialized’ undeclared (first use in this function)
src/_portaudiomodule.c:2412:6: error: ‘paUnanticipatedHostError’ undeclared (first use in this function)
src/_portaudiomodule.c:2417:49: error: ‘paInvalidDevice’ undeclared (first use in this function)
src/_portaudiomodule.c:2433:6: error: ‘paIncompatibleHostApiSpecificStreamInfo’ undeclared (first use in this function)
src/_portaudiomodule.c:2434:51: error: ‘paStreamIsStopped’ undeclared (first use in this function)
src/_portaudiomodule.c:2435:54: error: ‘paStreamIsNotStopped’ undeclared (first use in this function)
src/_portaudiomodule.c:2436:51: error: ‘paInputOverflowed’ undeclared (first use in this function)
src/_portaudiomodule.c:2437:53: error: ‘paOutputUnderflowed’ undeclared (first use in this function)
src/_portaudiomodule.c:2438:51: error: ‘paHostApiNotFound’ undeclared (first use in this function)
src/_portaudiomodule.c:2439:50: error: ‘paInvalidHostApi’ undeclared (first use in this function)
src/_portaudiomodule.c:2441:6: error: ‘paCanNotReadFromACallbackStream’ undeclared (first use in this function)
src/_portaudiomodule.c:2443:6: error: ‘paCanNotWriteToACallbackStream’ undeclared (first use in this function)
src/_portaudiomodule.c:2445:6: error: ‘paCanNotReadFromAnOutputOnlyStream’ undeclared (first use in this function)
src/_portaudiomodule.c:2447:6: error: ‘paCanNotWriteToAnInputOnlyStream’ undeclared (first use in this function)
src/_portaudiomodule.c:2449:6: error: ‘paIncompatibleStreamHostApi’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_defaultOutputDevice’:
src/_portaudiomodule.c:552:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_defaultInputDevice’:
src/_portaudiomodule.c:538:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_deviceCount’:
src/_portaudiomodule.c:524:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_type’:
src/_portaudiomodule.c:496:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_structVersion’:
src/_portaudiomodule.c:482:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_name’:
src/_portaudiomodule.c:510:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultSampleRate’:
src/_portaudiomodule.c:311:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultHighOutputLatency’:
src/_portaudiomodule.c:297:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultHighInputLatency’:
src/_portaudiomodule.c:283:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultLowOutputLatency’:
src/_portaudiomodule.c:268:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultLowInputLatency’:
src/_portaudiomodule.c:254:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_hostApi’:
src/_portaudiomodule.c:212:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_sampleRate’:
src/_portaudiomodule.c:1057:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_is_open’:
src/_portaudiomodule.c:922:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_outputLatency’:
src/_portaudiomodule.c:1032:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_inputLatency’:
src/_portaudiomodule.c:1007:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_structVersion’:
src/_portaudiomodule.c:982:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘pa_is_format_supported’:
src/_portaudiomodule.c:1841:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘pa_get_device_count’:
src/_portaudiomodule.c:1385:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘pa_host_api_device_index_to_device_index’:
src/_portaudiomodule.c:1327:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘pa_get_host_api_count’:
src/_portaudiomodule.c:1243:1: warning: control reaches end of non-void function
error: Setup script exited with error: command 'gcc' failed with exit status 1
|
Pyaudio installation error - 'command 'gcc' failed with exit status 1'
| 35,901,952
| 1
| 64
| 61,454
| 0
|
python,linux,gcc,pyaudio
|
I found this question after experiencing a similar error on OpenSuse (13.2). So I figured I'd post my solution as well, in case other people find this via Google.
Although libportaudio2 is the package containing the libs, you need portaudio-devel as well to make the installation work.
| 0
| 1
| 0
| 0
|
2011-05-07T15:17:00.000
| 10
| 0.019997
| false
| 5,921,947
| 0
| 0
| 0
| 5
|
I'm running Ubuntu 11.04, Python 2.7.1 and wanted to install Pyaudio. So I ran,
$ sudo easy_install pyaudio
in the terminal and the process exited with following error messages,
Searching for pyaudio
Reading http://pypi.python.org/simple/pyaudio/
Reading http://people.csail.mit.edu/hubert/pyaudio/
Best match: pyaudio 0.2.4
Downloading http://people.csail.mit.edu/hubert/pyaudio/packages/pyaudio-0.2.4.tar.gz
Processing pyaudio-0.2.4.tar.gz
Running PyAudio-0.2.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-0Tetss/PyAudio-0.2.4/egg-dist-tmp-PYy9T8
In file included from /usr/include/python2.7/Python.h:8:0,
from src/_portaudiomodule.c:30:
/usr/include/python2.7/pyconfig.h:1155:0: warning: "_POSIX_C_SOURCE" redefined
/usr/include/features.h:214:0: note: this is the location of the previous definition
src/_portaudiomodule.c:31:23: fatal error: portaudio.h: No such file or directory
compilation terminated.
error: Setup script exited with error: command 'gcc' failed with exit status 1
I wasn't sure whether to post this on askubuntu.com or here in stackoveflow, but anyway here it is in stackoverflow. Also I google'd a bit this question and found by installing python-dev have solved the problem for some. I've already installed python-dev. What may have gone wrong?
UPDATE
Following are the new errors I get after installing libportaudio-dev,
Searching for pyaudio
Reading http://pypi.python.org/simple/pyaudio/
Reading http://people.csail.mit.edu/hubert/pyaudio/
Best match: pyaudio 0.2.4
Downloading http://people.csail.mit.edu/hubert/pyaudio/packages/pyaudio-0.2.4.tar.gz
Processing pyaudio-0.2.4.tar.gz
Running PyAudio-0.2.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-LMpsIy/PyAudio-0.2.4/egg-dist-tmp-AExlqd
In file included from /usr/include/python2.7/Python.h:8:0,
from src/_portaudiomodule.c:30:
/usr/include/python2.7/pyconfig.h:1155:0: warning: "_POSIX_C_SOURCE" redefined
/usr/include/features.h:214:0: note: this is the location of the previous definition
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_hostApi’:
src/_portaudiomodule.c:211:38: error: ‘PaDeviceInfo’ has no member named ‘hostApi’
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultLowInputLatency’:
src/_portaudiomodule.c:253:42: error: ‘PaDeviceInfo’ has no member named ‘defaultLowInputLatency’
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultLowOutputLatency’:
src/_portaudiomodule.c:267:42: error: ‘PaDeviceInfo’ has no member named ‘defaultLowOutputLatency’
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultHighInputLatency’:
src/_portaudiomodule.c:282:42: error: ‘PaDeviceInfo’ has no member named ‘defaultHighInputLatency’
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultHighOutputLatency’:
src/_portaudiomodule.c:296:42: error: ‘PaDeviceInfo’ has no member named ‘defaultHighOutputLatency’
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultSampleRate’:
src/_portaudiomodule.c:310:42: error: ‘PaDeviceInfo’ has no member named ‘defaultSampleRate’
src/_portaudiomodule.c: At top level:
src/_portaudiomodule.c:465:3: error: expected specifier-qualifier-list before ‘PaHostApiInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_structVersion’:
src/_portaudiomodule.c:475:13: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c:481:29: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_type’:
src/_portaudiomodule.c:489:13: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c:495:36: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_name’:
src/_portaudiomodule.c:503:13: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c:503:32: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c:509:34: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_deviceCount’:
src/_portaudiomodule.c:517:13: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c:523:29: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_defaultInputDevice’:
src/_portaudiomodule.c:531:13: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c:537:29: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_defaultOutputDevice’:
src/_portaudiomodule.c:545:13: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c:551:29: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_dealloc’:
src/_portaudiomodule.c:569:7: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: At top level:
src/_portaudiomodule.c:910:3: error: expected specifier-qualifier-list before ‘PaStreamParameters’
src/_portaudiomodule.c: In function ‘_is_open’:
src/_portaudiomodule.c:921:23: error: ‘_pyAudio_Stream’ has no member named ‘is_open’
src/_portaudiomodule.c: In function ‘_cleanup_Stream_object’:
src/_portaudiomodule.c:932:19: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c:933:17: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c:935:19: error: ‘_pyAudio_Stream’ has no member named ‘inputParameters’
src/_portaudiomodule.c:936:22: error: ‘_pyAudio_Stream’ has no member named ‘inputParameters’
src/_portaudiomodule.c:937:17: error: ‘_pyAudio_Stream’ has no member named ‘inputParameters’
src/_portaudiomodule.c:940:19: error: ‘_pyAudio_Stream’ has no member named ‘outputParameters’
src/_portaudiomodule.c:941:22: error: ‘_pyAudio_Stream’ has no member named ‘outputParameters’
src/_portaudiomodule.c:942:17: error: ‘_pyAudio_Stream’ has no member named ‘outputParameters’
src/_portaudiomodule.c:946:15: error: ‘_pyAudio_Stream’ has no member named ‘is_open’
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_structVersion’:
src/_portaudiomodule.c:973:13: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c:981:29: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_inputLatency’:
src/_portaudiomodule.c:998:13: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c:1006:33: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_outputLatency’:
src/_portaudiomodule.c:1023:13: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c:1031:33: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_sampleRate’:
src/_portaudiomodule.c:1048:13: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c:1056:33: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c: In function ‘pa_get_version’:
src/_portaudiomodule.c:1168:3: warning: implicit declaration of function ‘Pa_GetVersion’
src/_portaudiomodule.c: In function ‘pa_get_version_text’:
src/_portaudiomodule.c:1177:3: warning: implicit declaration of function ‘Pa_GetVersionText’
src/_portaudiomodule.c:1177:3: warning: passing argument 1 of ‘PyString_FromString’ makes pointer from integer without a cast
/usr/include/python2.7/stringobject.h:63:24: note: expected ‘const char *’ but argument is of type ‘int’
src/_portaudiomodule.c: In function ‘pa_get_host_api_count’:
src/_portaudiomodule.c:1221:3: error: ‘PaHostApiIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1221:3: note: each undeclared identifier is reported only once for each function it appears in
src/_portaudiomodule.c:1221:18: error: expected ‘;’ before ‘count’
src/_portaudiomodule.c:1226:3: error: ‘count’ undeclared (first use in this function)
src/_portaudiomodule.c:1226:3: warning: implicit declaration of function ‘Pa_GetHostApiCount’
src/_portaudiomodule.c: In function ‘pa_get_default_host_api’:
src/_portaudiomodule.c:1248:3: error: ‘PaHostApiIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1248:18: error: expected ‘;’ before ‘index’
src/_portaudiomodule.c:1253:3: warning: implicit declaration of function ‘Pa_GetDefaultHostApi’
src/_portaudiomodule.c:1253:3: error: lvalue required as left operand of assignment
src/_portaudiomodule.c:1265:7: warning: passing argument 1 of ‘Pa_GetErrorText’ makes integer from pointer without a cast
/usr/include/portaudio.h:93:13: note: expected ‘PaError’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c:1269:3: warning: passing argument 1 of ‘PyInt_FromLong’ makes integer from pointer without a cast
/usr/include/python2.7/intobject.h:38:24: note: expected ‘long int’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c: In function ‘pa_host_api_type_id_to_host_api_index’:
src/_portaudiomodule.c:1275:3: error: ‘PaHostApiTypeId’ undeclared (first use in this function)
src/_portaudiomodule.c:1275:19: error: expected ‘;’ before ‘typeid’
src/_portaudiomodule.c:1276:3: error: ‘PaHostApiIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1276:18: error: expected ‘;’ before ‘index’
src/_portaudiomodule.c:1278:37: error: ‘typeid’ undeclared (first use in this function)
src/_portaudiomodule.c:1281:3: warning: implicit declaration of function ‘Pa_HostApiTypeIdToHostApiIndex’
src/_portaudiomodule.c:1293:7: warning: passing argument 1 of ‘Pa_GetErrorText’ makes integer from pointer without a cast
/usr/include/portaudio.h:93:13: note: expected ‘PaError’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c:1297:3: warning: passing argument 1 of ‘PyInt_FromLong’ makes integer from pointer without a cast
/usr/include/python2.7/intobject.h:38:24: note: expected ‘long int’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c: In function ‘pa_host_api_device_index_to_device_index’:
src/_portaudiomodule.c:1303:3: error: ‘PaHostApiIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1303:18: error: expected ‘;’ before ‘apiIndex’
src/_portaudiomodule.c:1305:3: error: ‘PaDeviceIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1305:17: error: expected ‘;’ before ‘devIndex’
src/_portaudiomodule.c:1308:38: error: ‘apiIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1311:3: error: ‘devIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1311:3: warning: implicit declaration of function ‘Pa_HostApiDeviceIndexToDeviceIndex’
src/_portaudiomodule.c: In function ‘pa_get_host_api_info’:
src/_portaudiomodule.c:1332:3: error: ‘PaHostApiIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1332:18: error: expected ‘;’ before ‘index’
src/_portaudiomodule.c:1333:3: error: ‘PaHostApiInfo’ undeclared (first use in this function)
src/_portaudiomodule.c:1333:18: error: ‘_info’ undeclared (first use in this function)
src/_portaudiomodule.c:1339:27: error: expected expression before ‘)’ token
src/_portaudiomodule.c:1345:7: error: ‘paInvalidHostApi’ undeclared (first use in this function)
src/_portaudiomodule.c:1350:10: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: In function ‘pa_get_device_count’:
src/_portaudiomodule.c:1364:3: error: ‘PaDeviceIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1364:17: error: expected ‘;’ before ‘count’
src/_portaudiomodule.c:1369:3: error: ‘count’ undeclared (first use in this function)
src/_portaudiomodule.c:1369:3: warning: implicit declaration of function ‘Pa_GetDeviceCount’
src/_portaudiomodule.c: In function ‘pa_get_default_input_device’:
src/_portaudiomodule.c:1390:3: error: ‘PaDeviceIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1390:17: error: expected ‘;’ before ‘index’
src/_portaudiomodule.c:1395:3: warning: implicit declaration of function ‘Pa_GetDefaultInputDevice’
src/_portaudiomodule.c:1395:3: error: lvalue required as left operand of assignment
src/_portaudiomodule.c:1396:13: warning: comparison between pointer and integer
src/_portaudiomodule.c:1409:7: warning: passing argument 1 of ‘Pa_GetErrorText’ makes integer from pointer without a cast
/usr/include/portaudio.h:93:13: note: expected ‘PaError’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c:1413:3: warning: passing argument 1 of ‘PyInt_FromLong’ makes integer from pointer without a cast
/usr/include/python2.7/intobject.h:38:24: note: expected ‘long int’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c: In function ‘pa_get_default_output_device’:
src/_portaudiomodule.c:1419:3: error: ‘PaDeviceIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1419:17: error: expected ‘;’ before ‘index’
src/_portaudiomodule.c:1424:3: warning: implicit declaration of function ‘Pa_GetDefaultOutputDevice’
src/_portaudiomodule.c:1424:3: error: lvalue required as left operand of assignment
src/_portaudiomodule.c:1425:13: warning: comparison between pointer and integer
src/_portaudiomodule.c:1438:7: warning: passing argument 1 of ‘Pa_GetErrorText’ makes integer from pointer without a cast
/usr/include/portaudio.h:93:13: note: expected ‘PaError’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c:1442:3: warning: passing argument 1 of ‘PyInt_FromLong’ makes integer from pointer without a cast
/usr/include/python2.7/intobject.h:38:24: note: expected ‘long int’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c: In function ‘pa_get_device_info’:
src/_portaudiomodule.c:1448:3: error: ‘PaDeviceIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1448:17: error: expected ‘;’ before ‘index’
src/_portaudiomodule.c:1455:3: warning: passing argument 1 of ‘Pa_GetDeviceInfo’ makes integer from pointer without a cast
/usr/include/portaudio.h:182:21: note: expected ‘PaDeviceID’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c:1460:30: error: ‘paInvalidDevice’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘pa_open’:
src/_portaudiomodule.c:1601:3: error: ‘PaStreamParameters’ undeclared (first use in this function)
src/_portaudiomodule.c:1601:23: error: ‘outputParameters’ undeclared (first use in this function)
src/_portaudiomodule.c:1602:23: error: ‘inputParameters’ undeclared (first use in this function)
src/_portaudiomodule.c:1606:28: error: expected expression before ‘)’ token
src/_portaudiomodule.c:1622:9: error: ‘paInvalidDevice’ undeclared (first use in this function)
src/_portaudiomodule.c:1643:28: error: expected expression before ‘)’ token
src/_portaudiomodule.c:1679:3: error: ‘PaStreamInfo’ undeclared (first use in this function)
src/_portaudiomodule.c:1679:17: error: ‘streamInfo’ undeclared (first use in this function)
src/_portaudiomodule.c:1696:9: warning: passing argument 5 of ‘Pa_OpenStream’ makes pointer from integer without a cast
/usr/include/portaudio.h:325:9: note: expected ‘void *’ but argument is of type ‘int’
src/_portaudiomodule.c:1696:9: warning: passing argument 7 of ‘Pa_OpenStream’ makes integer from pointer without a cast
/usr/include/portaudio.h:325:9: note: expected ‘int’ but argument is of type ‘void *’
src/_portaudiomodule.c:1696:9: warning: passing argument 8 of ‘Pa_OpenStream’ makes integer from pointer without a cast
/usr/include/portaudio.h:325:9: note: expected ‘PaSampleFormat’ but argument is of type ‘void *’
src/_portaudiomodule.c:1696:9: error: too few arguments to function ‘Pa_OpenStream’
/usr/include/portaudio.h:325:9: note: declared here
src/_portaudiomodule.c:1712:31: error: expected expression before ‘)’ token
src/_portaudiomodule.c:1724:15: error: ‘_pyAudio_Stream’ has no member named ‘inputParameters’
src/_portaudiomodule.c:1725:15: error: ‘_pyAudio_Stream’ has no member named ‘outputParameters’
src/_portaudiomodule.c:1726:15: error: ‘_pyAudio_Stream’ has no member named ‘is_open’
src/_portaudiomodule.c:1727:15: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c: In function ‘pa_is_format_supported’:
src/_portaudiomodule.c:1791:3: error: ‘PaStreamParameters’ undeclared (first use in this function)
src/_portaudiomodule.c:1791:22: error: expected ‘;’ before ‘inputParams’
src/_portaudiomodule.c:1792:22: error: expected ‘;’ before ‘outputParams’
src/_portaudiomodule.c:1812:5: error: ‘inputParams’ undeclared (first use in this function)
src/_portaudiomodule.c:1820:5: error: ‘outputParams’ undeclared (first use in this function)
src/_portaudiomodule.c:1827:3: warning: implicit declaration of function ‘Pa_IsFormatSupported’
src/_portaudiomodule.c:1831:16: error: ‘paFormatIsSupported’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘pa_start_stream’:
src/_portaudiomodule.c:1870:16: error: ‘paStreamIsNotStopped’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘pa_stop_stream’:
src/_portaudiomodule.c:1911:16: error: ‘paStreamIsStopped’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘pa_abort_stream’:
src/_portaudiomodule.c:1952:16: error: ‘paStreamIsStopped’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘pa_is_stream_stopped’:
src/_portaudiomodule.c:1994:3: warning: implicit declaration of function ‘Pa_IsStreamStopped’
src/_portaudiomodule.c: In function ‘pa_is_stream_active’:
src/_portaudiomodule.c:2039:3: warning: implicit declaration of function ‘Pa_IsStreamActive’
src/_portaudiomodule.c: In function ‘pa_get_stream_time’:
src/_portaudiomodule.c:2086:3: warning: implicit declaration of function ‘Pa_GetStreamTime’
src/_portaudiomodule.c: In function ‘pa_get_stream_cpu_load’:
src/_portaudiomodule.c:2118:3: warning: implicit declaration of function ‘Pa_GetStreamCpuLoad’
src/_portaudiomodule.c: In function ‘pa_write_stream’:
src/_portaudiomodule.c:2167:3: warning: implicit declaration of function ‘Pa_WriteStream’
src/_portaudiomodule.c:2171:16: error: ‘paOutputUnderflowed’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘pa_read_stream’:
src/_portaudiomodule.c:2233:3: error: ‘PaStreamParameters’ undeclared (first use in this function)
src/_portaudiomodule.c:2233:23: error: ‘inputParameters’ undeclared (first use in this function)
src/_portaudiomodule.c:2233:53: error: ‘_pyAudio_Stream’ has no member named ‘inputParameters’
src/_portaudiomodule.c:2253:3: warning: implicit declaration of function ‘Pa_ReadStream’
src/_portaudiomodule.c:2259:15: error: ‘paInputOverflowed’ undeclared (first use in this function)
src/_portaudiomodule.c:2265:22: error: ‘paOutputUnderflowed’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘pa_get_stream_write_available’:
src/_portaudiomodule.c:2309:3: warning: implicit declaration of function ‘Pa_GetStreamWriteAvailable’
src/_portaudiomodule.c: In function ‘pa_get_stream_read_available’:
src/_portaudiomodule.c:2334:3: warning: implicit declaration of function ‘Pa_GetStreamReadAvailable’
src/_portaudiomodule.c: In function ‘init_portaudio’:
src/_portaudiomodule.c:2384:49: error: ‘paInDevelopment’ undeclared (first use in this function)
src/_portaudiomodule.c:2385:47: error: ‘paDirectSound’ undeclared (first use in this function)
src/_portaudiomodule.c:2386:39: error: ‘paMME’ undeclared (first use in this function)
src/_portaudiomodule.c:2387:40: error: ‘paASIO’ undeclared (first use in this function)
src/_portaudiomodule.c:2388:48: error: ‘paSoundManager’ undeclared (first use in this function)
src/_portaudiomodule.c:2389:45: error: ‘paCoreAudio’ undeclared (first use in this function)
src/_portaudiomodule.c:2390:39: error: ‘paOSS’ undeclared (first use in this function)
src/_portaudiomodule.c:2391:40: error: ‘paALSA’ undeclared (first use in this function)
src/_portaudiomodule.c:2392:38: error: ‘paAL’ undeclared (first use in this function)
src/_portaudiomodule.c:2393:40: error: ‘paBeOS’ undeclared (first use in this function)
src/_portaudiomodule.c:2394:41: error: ‘paWDMKS’ undeclared (first use in this function)
src/_portaudiomodule.c:2395:40: error: ‘paJACK’ undeclared (first use in this function)
src/_portaudiomodule.c:2396:42: error: ‘paWASAPI’ undeclared (first use in this function)
src/_portaudiomodule.c:2410:50: error: ‘paNotInitialized’ undeclared (first use in this function)
src/_portaudiomodule.c:2412:6: error: ‘paUnanticipatedHostError’ undeclared (first use in this function)
src/_portaudiomodule.c:2417:49: error: ‘paInvalidDevice’ undeclared (first use in this function)
src/_portaudiomodule.c:2433:6: error: ‘paIncompatibleHostApiSpecificStreamInfo’ undeclared (first use in this function)
src/_portaudiomodule.c:2434:51: error: ‘paStreamIsStopped’ undeclared (first use in this function)
src/_portaudiomodule.c:2435:54: error: ‘paStreamIsNotStopped’ undeclared (first use in this function)
src/_portaudiomodule.c:2436:51: error: ‘paInputOverflowed’ undeclared (first use in this function)
src/_portaudiomodule.c:2437:53: error: ‘paOutputUnderflowed’ undeclared (first use in this function)
src/_portaudiomodule.c:2438:51: error: ‘paHostApiNotFound’ undeclared (first use in this function)
src/_portaudiomodule.c:2439:50: error: ‘paInvalidHostApi’ undeclared (first use in this function)
src/_portaudiomodule.c:2441:6: error: ‘paCanNotReadFromACallbackStream’ undeclared (first use in this function)
src/_portaudiomodule.c:2443:6: error: ‘paCanNotWriteToACallbackStream’ undeclared (first use in this function)
src/_portaudiomodule.c:2445:6: error: ‘paCanNotReadFromAnOutputOnlyStream’ undeclared (first use in this function)
src/_portaudiomodule.c:2447:6: error: ‘paCanNotWriteToAnInputOnlyStream’ undeclared (first use in this function)
src/_portaudiomodule.c:2449:6: error: ‘paIncompatibleStreamHostApi’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_defaultOutputDevice’:
src/_portaudiomodule.c:552:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_defaultInputDevice’:
src/_portaudiomodule.c:538:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_deviceCount’:
src/_portaudiomodule.c:524:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_type’:
src/_portaudiomodule.c:496:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_structVersion’:
src/_portaudiomodule.c:482:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_name’:
src/_portaudiomodule.c:510:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultSampleRate’:
src/_portaudiomodule.c:311:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultHighOutputLatency’:
src/_portaudiomodule.c:297:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultHighInputLatency’:
src/_portaudiomodule.c:283:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultLowOutputLatency’:
src/_portaudiomodule.c:268:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultLowInputLatency’:
src/_portaudiomodule.c:254:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_hostApi’:
src/_portaudiomodule.c:212:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_sampleRate’:
src/_portaudiomodule.c:1057:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_is_open’:
src/_portaudiomodule.c:922:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_outputLatency’:
src/_portaudiomodule.c:1032:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_inputLatency’:
src/_portaudiomodule.c:1007:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_structVersion’:
src/_portaudiomodule.c:982:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘pa_is_format_supported’:
src/_portaudiomodule.c:1841:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘pa_get_device_count’:
src/_portaudiomodule.c:1385:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘pa_host_api_device_index_to_device_index’:
src/_portaudiomodule.c:1327:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘pa_get_host_api_count’:
src/_portaudiomodule.c:1243:1: warning: control reaches end of non-void function
error: Setup script exited with error: command 'gcc' failed with exit status 1
|
Pyaudio installation error - 'command 'gcc' failed with exit status 1'
| 41,717,929
| 5
| 64
| 61,454
| 0
|
python,linux,gcc,pyaudio
|
This is how I get it work:
brew update (you can ignore this step if your brew is up to date)
brew install portaudio
brew link --overwrite portaudio
sudo python2.7 -m pip install --global-option='build_ext' --global-option='-I/usr/local/include' --global-option='-L/usr/local/lib' pyaudio
| 0
| 1
| 0
| 0
|
2011-05-07T15:17:00.000
| 10
| 0.099668
| false
| 5,921,947
| 0
| 0
| 0
| 5
|
I'm running Ubuntu 11.04, Python 2.7.1 and wanted to install Pyaudio. So I ran,
$ sudo easy_install pyaudio
in the terminal and the process exited with following error messages,
Searching for pyaudio
Reading http://pypi.python.org/simple/pyaudio/
Reading http://people.csail.mit.edu/hubert/pyaudio/
Best match: pyaudio 0.2.4
Downloading http://people.csail.mit.edu/hubert/pyaudio/packages/pyaudio-0.2.4.tar.gz
Processing pyaudio-0.2.4.tar.gz
Running PyAudio-0.2.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-0Tetss/PyAudio-0.2.4/egg-dist-tmp-PYy9T8
In file included from /usr/include/python2.7/Python.h:8:0,
from src/_portaudiomodule.c:30:
/usr/include/python2.7/pyconfig.h:1155:0: warning: "_POSIX_C_SOURCE" redefined
/usr/include/features.h:214:0: note: this is the location of the previous definition
src/_portaudiomodule.c:31:23: fatal error: portaudio.h: No such file or directory
compilation terminated.
error: Setup script exited with error: command 'gcc' failed with exit status 1
I wasn't sure whether to post this on askubuntu.com or here in stackoveflow, but anyway here it is in stackoverflow. Also I google'd a bit this question and found by installing python-dev have solved the problem for some. I've already installed python-dev. What may have gone wrong?
UPDATE
Following are the new errors I get after installing libportaudio-dev,
Searching for pyaudio
Reading http://pypi.python.org/simple/pyaudio/
Reading http://people.csail.mit.edu/hubert/pyaudio/
Best match: pyaudio 0.2.4
Downloading http://people.csail.mit.edu/hubert/pyaudio/packages/pyaudio-0.2.4.tar.gz
Processing pyaudio-0.2.4.tar.gz
Running PyAudio-0.2.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-LMpsIy/PyAudio-0.2.4/egg-dist-tmp-AExlqd
In file included from /usr/include/python2.7/Python.h:8:0,
from src/_portaudiomodule.c:30:
/usr/include/python2.7/pyconfig.h:1155:0: warning: "_POSIX_C_SOURCE" redefined
/usr/include/features.h:214:0: note: this is the location of the previous definition
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_hostApi’:
src/_portaudiomodule.c:211:38: error: ‘PaDeviceInfo’ has no member named ‘hostApi’
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultLowInputLatency’:
src/_portaudiomodule.c:253:42: error: ‘PaDeviceInfo’ has no member named ‘defaultLowInputLatency’
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultLowOutputLatency’:
src/_portaudiomodule.c:267:42: error: ‘PaDeviceInfo’ has no member named ‘defaultLowOutputLatency’
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultHighInputLatency’:
src/_portaudiomodule.c:282:42: error: ‘PaDeviceInfo’ has no member named ‘defaultHighInputLatency’
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultHighOutputLatency’:
src/_portaudiomodule.c:296:42: error: ‘PaDeviceInfo’ has no member named ‘defaultHighOutputLatency’
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultSampleRate’:
src/_portaudiomodule.c:310:42: error: ‘PaDeviceInfo’ has no member named ‘defaultSampleRate’
src/_portaudiomodule.c: At top level:
src/_portaudiomodule.c:465:3: error: expected specifier-qualifier-list before ‘PaHostApiInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_structVersion’:
src/_portaudiomodule.c:475:13: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c:481:29: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_type’:
src/_portaudiomodule.c:489:13: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c:495:36: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_name’:
src/_portaudiomodule.c:503:13: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c:503:32: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c:509:34: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_deviceCount’:
src/_portaudiomodule.c:517:13: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c:523:29: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_defaultInputDevice’:
src/_portaudiomodule.c:531:13: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c:537:29: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_defaultOutputDevice’:
src/_portaudiomodule.c:545:13: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c:551:29: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_dealloc’:
src/_portaudiomodule.c:569:7: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: At top level:
src/_portaudiomodule.c:910:3: error: expected specifier-qualifier-list before ‘PaStreamParameters’
src/_portaudiomodule.c: In function ‘_is_open’:
src/_portaudiomodule.c:921:23: error: ‘_pyAudio_Stream’ has no member named ‘is_open’
src/_portaudiomodule.c: In function ‘_cleanup_Stream_object’:
src/_portaudiomodule.c:932:19: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c:933:17: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c:935:19: error: ‘_pyAudio_Stream’ has no member named ‘inputParameters’
src/_portaudiomodule.c:936:22: error: ‘_pyAudio_Stream’ has no member named ‘inputParameters’
src/_portaudiomodule.c:937:17: error: ‘_pyAudio_Stream’ has no member named ‘inputParameters’
src/_portaudiomodule.c:940:19: error: ‘_pyAudio_Stream’ has no member named ‘outputParameters’
src/_portaudiomodule.c:941:22: error: ‘_pyAudio_Stream’ has no member named ‘outputParameters’
src/_portaudiomodule.c:942:17: error: ‘_pyAudio_Stream’ has no member named ‘outputParameters’
src/_portaudiomodule.c:946:15: error: ‘_pyAudio_Stream’ has no member named ‘is_open’
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_structVersion’:
src/_portaudiomodule.c:973:13: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c:981:29: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_inputLatency’:
src/_portaudiomodule.c:998:13: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c:1006:33: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_outputLatency’:
src/_portaudiomodule.c:1023:13: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c:1031:33: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_sampleRate’:
src/_portaudiomodule.c:1048:13: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c:1056:33: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c: In function ‘pa_get_version’:
src/_portaudiomodule.c:1168:3: warning: implicit declaration of function ‘Pa_GetVersion’
src/_portaudiomodule.c: In function ‘pa_get_version_text’:
src/_portaudiomodule.c:1177:3: warning: implicit declaration of function ‘Pa_GetVersionText’
src/_portaudiomodule.c:1177:3: warning: passing argument 1 of ‘PyString_FromString’ makes pointer from integer without a cast
/usr/include/python2.7/stringobject.h:63:24: note: expected ‘const char *’ but argument is of type ‘int’
src/_portaudiomodule.c: In function ‘pa_get_host_api_count’:
src/_portaudiomodule.c:1221:3: error: ‘PaHostApiIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1221:3: note: each undeclared identifier is reported only once for each function it appears in
src/_portaudiomodule.c:1221:18: error: expected ‘;’ before ‘count’
src/_portaudiomodule.c:1226:3: error: ‘count’ undeclared (first use in this function)
src/_portaudiomodule.c:1226:3: warning: implicit declaration of function ‘Pa_GetHostApiCount’
src/_portaudiomodule.c: In function ‘pa_get_default_host_api’:
src/_portaudiomodule.c:1248:3: error: ‘PaHostApiIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1248:18: error: expected ‘;’ before ‘index’
src/_portaudiomodule.c:1253:3: warning: implicit declaration of function ‘Pa_GetDefaultHostApi’
src/_portaudiomodule.c:1253:3: error: lvalue required as left operand of assignment
src/_portaudiomodule.c:1265:7: warning: passing argument 1 of ‘Pa_GetErrorText’ makes integer from pointer without a cast
/usr/include/portaudio.h:93:13: note: expected ‘PaError’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c:1269:3: warning: passing argument 1 of ‘PyInt_FromLong’ makes integer from pointer without a cast
/usr/include/python2.7/intobject.h:38:24: note: expected ‘long int’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c: In function ‘pa_host_api_type_id_to_host_api_index’:
src/_portaudiomodule.c:1275:3: error: ‘PaHostApiTypeId’ undeclared (first use in this function)
src/_portaudiomodule.c:1275:19: error: expected ‘;’ before ‘typeid’
src/_portaudiomodule.c:1276:3: error: ‘PaHostApiIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1276:18: error: expected ‘;’ before ‘index’
src/_portaudiomodule.c:1278:37: error: ‘typeid’ undeclared (first use in this function)
src/_portaudiomodule.c:1281:3: warning: implicit declaration of function ‘Pa_HostApiTypeIdToHostApiIndex’
src/_portaudiomodule.c:1293:7: warning: passing argument 1 of ‘Pa_GetErrorText’ makes integer from pointer without a cast
/usr/include/portaudio.h:93:13: note: expected ‘PaError’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c:1297:3: warning: passing argument 1 of ‘PyInt_FromLong’ makes integer from pointer without a cast
/usr/include/python2.7/intobject.h:38:24: note: expected ‘long int’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c: In function ‘pa_host_api_device_index_to_device_index’:
src/_portaudiomodule.c:1303:3: error: ‘PaHostApiIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1303:18: error: expected ‘;’ before ‘apiIndex’
src/_portaudiomodule.c:1305:3: error: ‘PaDeviceIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1305:17: error: expected ‘;’ before ‘devIndex’
src/_portaudiomodule.c:1308:38: error: ‘apiIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1311:3: error: ‘devIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1311:3: warning: implicit declaration of function ‘Pa_HostApiDeviceIndexToDeviceIndex’
src/_portaudiomodule.c: In function ‘pa_get_host_api_info’:
src/_portaudiomodule.c:1332:3: error: ‘PaHostApiIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1332:18: error: expected ‘;’ before ‘index’
src/_portaudiomodule.c:1333:3: error: ‘PaHostApiInfo’ undeclared (first use in this function)
src/_portaudiomodule.c:1333:18: error: ‘_info’ undeclared (first use in this function)
src/_portaudiomodule.c:1339:27: error: expected expression before ‘)’ token
src/_portaudiomodule.c:1345:7: error: ‘paInvalidHostApi’ undeclared (first use in this function)
src/_portaudiomodule.c:1350:10: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: In function ‘pa_get_device_count’:
src/_portaudiomodule.c:1364:3: error: ‘PaDeviceIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1364:17: error: expected ‘;’ before ‘count’
src/_portaudiomodule.c:1369:3: error: ‘count’ undeclared (first use in this function)
src/_portaudiomodule.c:1369:3: warning: implicit declaration of function ‘Pa_GetDeviceCount’
src/_portaudiomodule.c: In function ‘pa_get_default_input_device’:
src/_portaudiomodule.c:1390:3: error: ‘PaDeviceIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1390:17: error: expected ‘;’ before ‘index’
src/_portaudiomodule.c:1395:3: warning: implicit declaration of function ‘Pa_GetDefaultInputDevice’
src/_portaudiomodule.c:1395:3: error: lvalue required as left operand of assignment
src/_portaudiomodule.c:1396:13: warning: comparison between pointer and integer
src/_portaudiomodule.c:1409:7: warning: passing argument 1 of ‘Pa_GetErrorText’ makes integer from pointer without a cast
/usr/include/portaudio.h:93:13: note: expected ‘PaError’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c:1413:3: warning: passing argument 1 of ‘PyInt_FromLong’ makes integer from pointer without a cast
/usr/include/python2.7/intobject.h:38:24: note: expected ‘long int’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c: In function ‘pa_get_default_output_device’:
src/_portaudiomodule.c:1419:3: error: ‘PaDeviceIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1419:17: error: expected ‘;’ before ‘index’
src/_portaudiomodule.c:1424:3: warning: implicit declaration of function ‘Pa_GetDefaultOutputDevice’
src/_portaudiomodule.c:1424:3: error: lvalue required as left operand of assignment
src/_portaudiomodule.c:1425:13: warning: comparison between pointer and integer
src/_portaudiomodule.c:1438:7: warning: passing argument 1 of ‘Pa_GetErrorText’ makes integer from pointer without a cast
/usr/include/portaudio.h:93:13: note: expected ‘PaError’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c:1442:3: warning: passing argument 1 of ‘PyInt_FromLong’ makes integer from pointer without a cast
/usr/include/python2.7/intobject.h:38:24: note: expected ‘long int’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c: In function ‘pa_get_device_info’:
src/_portaudiomodule.c:1448:3: error: ‘PaDeviceIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1448:17: error: expected ‘;’ before ‘index’
src/_portaudiomodule.c:1455:3: warning: passing argument 1 of ‘Pa_GetDeviceInfo’ makes integer from pointer without a cast
/usr/include/portaudio.h:182:21: note: expected ‘PaDeviceID’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c:1460:30: error: ‘paInvalidDevice’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘pa_open’:
src/_portaudiomodule.c:1601:3: error: ‘PaStreamParameters’ undeclared (first use in this function)
src/_portaudiomodule.c:1601:23: error: ‘outputParameters’ undeclared (first use in this function)
src/_portaudiomodule.c:1602:23: error: ‘inputParameters’ undeclared (first use in this function)
src/_portaudiomodule.c:1606:28: error: expected expression before ‘)’ token
src/_portaudiomodule.c:1622:9: error: ‘paInvalidDevice’ undeclared (first use in this function)
src/_portaudiomodule.c:1643:28: error: expected expression before ‘)’ token
src/_portaudiomodule.c:1679:3: error: ‘PaStreamInfo’ undeclared (first use in this function)
src/_portaudiomodule.c:1679:17: error: ‘streamInfo’ undeclared (first use in this function)
src/_portaudiomodule.c:1696:9: warning: passing argument 5 of ‘Pa_OpenStream’ makes pointer from integer without a cast
/usr/include/portaudio.h:325:9: note: expected ‘void *’ but argument is of type ‘int’
src/_portaudiomodule.c:1696:9: warning: passing argument 7 of ‘Pa_OpenStream’ makes integer from pointer without a cast
/usr/include/portaudio.h:325:9: note: expected ‘int’ but argument is of type ‘void *’
src/_portaudiomodule.c:1696:9: warning: passing argument 8 of ‘Pa_OpenStream’ makes integer from pointer without a cast
/usr/include/portaudio.h:325:9: note: expected ‘PaSampleFormat’ but argument is of type ‘void *’
src/_portaudiomodule.c:1696:9: error: too few arguments to function ‘Pa_OpenStream’
/usr/include/portaudio.h:325:9: note: declared here
src/_portaudiomodule.c:1712:31: error: expected expression before ‘)’ token
src/_portaudiomodule.c:1724:15: error: ‘_pyAudio_Stream’ has no member named ‘inputParameters’
src/_portaudiomodule.c:1725:15: error: ‘_pyAudio_Stream’ has no member named ‘outputParameters’
src/_portaudiomodule.c:1726:15: error: ‘_pyAudio_Stream’ has no member named ‘is_open’
src/_portaudiomodule.c:1727:15: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c: In function ‘pa_is_format_supported’:
src/_portaudiomodule.c:1791:3: error: ‘PaStreamParameters’ undeclared (first use in this function)
src/_portaudiomodule.c:1791:22: error: expected ‘;’ before ‘inputParams’
src/_portaudiomodule.c:1792:22: error: expected ‘;’ before ‘outputParams’
src/_portaudiomodule.c:1812:5: error: ‘inputParams’ undeclared (first use in this function)
src/_portaudiomodule.c:1820:5: error: ‘outputParams’ undeclared (first use in this function)
src/_portaudiomodule.c:1827:3: warning: implicit declaration of function ‘Pa_IsFormatSupported’
src/_portaudiomodule.c:1831:16: error: ‘paFormatIsSupported’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘pa_start_stream’:
src/_portaudiomodule.c:1870:16: error: ‘paStreamIsNotStopped’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘pa_stop_stream’:
src/_portaudiomodule.c:1911:16: error: ‘paStreamIsStopped’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘pa_abort_stream’:
src/_portaudiomodule.c:1952:16: error: ‘paStreamIsStopped’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘pa_is_stream_stopped’:
src/_portaudiomodule.c:1994:3: warning: implicit declaration of function ‘Pa_IsStreamStopped’
src/_portaudiomodule.c: In function ‘pa_is_stream_active’:
src/_portaudiomodule.c:2039:3: warning: implicit declaration of function ‘Pa_IsStreamActive’
src/_portaudiomodule.c: In function ‘pa_get_stream_time’:
src/_portaudiomodule.c:2086:3: warning: implicit declaration of function ‘Pa_GetStreamTime’
src/_portaudiomodule.c: In function ‘pa_get_stream_cpu_load’:
src/_portaudiomodule.c:2118:3: warning: implicit declaration of function ‘Pa_GetStreamCpuLoad’
src/_portaudiomodule.c: In function ‘pa_write_stream’:
src/_portaudiomodule.c:2167:3: warning: implicit declaration of function ‘Pa_WriteStream’
src/_portaudiomodule.c:2171:16: error: ‘paOutputUnderflowed’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘pa_read_stream’:
src/_portaudiomodule.c:2233:3: error: ‘PaStreamParameters’ undeclared (first use in this function)
src/_portaudiomodule.c:2233:23: error: ‘inputParameters’ undeclared (first use in this function)
src/_portaudiomodule.c:2233:53: error: ‘_pyAudio_Stream’ has no member named ‘inputParameters’
src/_portaudiomodule.c:2253:3: warning: implicit declaration of function ‘Pa_ReadStream’
src/_portaudiomodule.c:2259:15: error: ‘paInputOverflowed’ undeclared (first use in this function)
src/_portaudiomodule.c:2265:22: error: ‘paOutputUnderflowed’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘pa_get_stream_write_available’:
src/_portaudiomodule.c:2309:3: warning: implicit declaration of function ‘Pa_GetStreamWriteAvailable’
src/_portaudiomodule.c: In function ‘pa_get_stream_read_available’:
src/_portaudiomodule.c:2334:3: warning: implicit declaration of function ‘Pa_GetStreamReadAvailable’
src/_portaudiomodule.c: In function ‘init_portaudio’:
src/_portaudiomodule.c:2384:49: error: ‘paInDevelopment’ undeclared (first use in this function)
src/_portaudiomodule.c:2385:47: error: ‘paDirectSound’ undeclared (first use in this function)
src/_portaudiomodule.c:2386:39: error: ‘paMME’ undeclared (first use in this function)
src/_portaudiomodule.c:2387:40: error: ‘paASIO’ undeclared (first use in this function)
src/_portaudiomodule.c:2388:48: error: ‘paSoundManager’ undeclared (first use in this function)
src/_portaudiomodule.c:2389:45: error: ‘paCoreAudio’ undeclared (first use in this function)
src/_portaudiomodule.c:2390:39: error: ‘paOSS’ undeclared (first use in this function)
src/_portaudiomodule.c:2391:40: error: ‘paALSA’ undeclared (first use in this function)
src/_portaudiomodule.c:2392:38: error: ‘paAL’ undeclared (first use in this function)
src/_portaudiomodule.c:2393:40: error: ‘paBeOS’ undeclared (first use in this function)
src/_portaudiomodule.c:2394:41: error: ‘paWDMKS’ undeclared (first use in this function)
src/_portaudiomodule.c:2395:40: error: ‘paJACK’ undeclared (first use in this function)
src/_portaudiomodule.c:2396:42: error: ‘paWASAPI’ undeclared (first use in this function)
src/_portaudiomodule.c:2410:50: error: ‘paNotInitialized’ undeclared (first use in this function)
src/_portaudiomodule.c:2412:6: error: ‘paUnanticipatedHostError’ undeclared (first use in this function)
src/_portaudiomodule.c:2417:49: error: ‘paInvalidDevice’ undeclared (first use in this function)
src/_portaudiomodule.c:2433:6: error: ‘paIncompatibleHostApiSpecificStreamInfo’ undeclared (first use in this function)
src/_portaudiomodule.c:2434:51: error: ‘paStreamIsStopped’ undeclared (first use in this function)
src/_portaudiomodule.c:2435:54: error: ‘paStreamIsNotStopped’ undeclared (first use in this function)
src/_portaudiomodule.c:2436:51: error: ‘paInputOverflowed’ undeclared (first use in this function)
src/_portaudiomodule.c:2437:53: error: ‘paOutputUnderflowed’ undeclared (first use in this function)
src/_portaudiomodule.c:2438:51: error: ‘paHostApiNotFound’ undeclared (first use in this function)
src/_portaudiomodule.c:2439:50: error: ‘paInvalidHostApi’ undeclared (first use in this function)
src/_portaudiomodule.c:2441:6: error: ‘paCanNotReadFromACallbackStream’ undeclared (first use in this function)
src/_portaudiomodule.c:2443:6: error: ‘paCanNotWriteToACallbackStream’ undeclared (first use in this function)
src/_portaudiomodule.c:2445:6: error: ‘paCanNotReadFromAnOutputOnlyStream’ undeclared (first use in this function)
src/_portaudiomodule.c:2447:6: error: ‘paCanNotWriteToAnInputOnlyStream’ undeclared (first use in this function)
src/_portaudiomodule.c:2449:6: error: ‘paIncompatibleStreamHostApi’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_defaultOutputDevice’:
src/_portaudiomodule.c:552:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_defaultInputDevice’:
src/_portaudiomodule.c:538:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_deviceCount’:
src/_portaudiomodule.c:524:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_type’:
src/_portaudiomodule.c:496:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_structVersion’:
src/_portaudiomodule.c:482:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_name’:
src/_portaudiomodule.c:510:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultSampleRate’:
src/_portaudiomodule.c:311:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultHighOutputLatency’:
src/_portaudiomodule.c:297:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultHighInputLatency’:
src/_portaudiomodule.c:283:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultLowOutputLatency’:
src/_portaudiomodule.c:268:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultLowInputLatency’:
src/_portaudiomodule.c:254:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_hostApi’:
src/_portaudiomodule.c:212:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_sampleRate’:
src/_portaudiomodule.c:1057:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_is_open’:
src/_portaudiomodule.c:922:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_outputLatency’:
src/_portaudiomodule.c:1032:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_inputLatency’:
src/_portaudiomodule.c:1007:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_structVersion’:
src/_portaudiomodule.c:982:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘pa_is_format_supported’:
src/_portaudiomodule.c:1841:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘pa_get_device_count’:
src/_portaudiomodule.c:1385:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘pa_host_api_device_index_to_device_index’:
src/_portaudiomodule.c:1327:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘pa_get_host_api_count’:
src/_portaudiomodule.c:1243:1: warning: control reaches end of non-void function
error: Setup script exited with error: command 'gcc' failed with exit status 1
|
Pyaudio installation error - 'command 'gcc' failed with exit status 1'
| 64,455,416
| 2
| 64
| 61,454
| 0
|
python,linux,gcc,pyaudio
|
Had the same problem too. I'm working on a MAC and solved the issue by running these lines of code.
brew install portaudio
pip install pyaudio
| 0
| 1
| 0
| 0
|
2011-05-07T15:17:00.000
| 10
| 0.039979
| false
| 5,921,947
| 0
| 0
| 0
| 5
|
I'm running Ubuntu 11.04, Python 2.7.1 and wanted to install Pyaudio. So I ran,
$ sudo easy_install pyaudio
in the terminal and the process exited with following error messages,
Searching for pyaudio
Reading http://pypi.python.org/simple/pyaudio/
Reading http://people.csail.mit.edu/hubert/pyaudio/
Best match: pyaudio 0.2.4
Downloading http://people.csail.mit.edu/hubert/pyaudio/packages/pyaudio-0.2.4.tar.gz
Processing pyaudio-0.2.4.tar.gz
Running PyAudio-0.2.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-0Tetss/PyAudio-0.2.4/egg-dist-tmp-PYy9T8
In file included from /usr/include/python2.7/Python.h:8:0,
from src/_portaudiomodule.c:30:
/usr/include/python2.7/pyconfig.h:1155:0: warning: "_POSIX_C_SOURCE" redefined
/usr/include/features.h:214:0: note: this is the location of the previous definition
src/_portaudiomodule.c:31:23: fatal error: portaudio.h: No such file or directory
compilation terminated.
error: Setup script exited with error: command 'gcc' failed with exit status 1
I wasn't sure whether to post this on askubuntu.com or here in stackoveflow, but anyway here it is in stackoverflow. Also I google'd a bit this question and found by installing python-dev have solved the problem for some. I've already installed python-dev. What may have gone wrong?
UPDATE
Following are the new errors I get after installing libportaudio-dev,
Searching for pyaudio
Reading http://pypi.python.org/simple/pyaudio/
Reading http://people.csail.mit.edu/hubert/pyaudio/
Best match: pyaudio 0.2.4
Downloading http://people.csail.mit.edu/hubert/pyaudio/packages/pyaudio-0.2.4.tar.gz
Processing pyaudio-0.2.4.tar.gz
Running PyAudio-0.2.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-LMpsIy/PyAudio-0.2.4/egg-dist-tmp-AExlqd
In file included from /usr/include/python2.7/Python.h:8:0,
from src/_portaudiomodule.c:30:
/usr/include/python2.7/pyconfig.h:1155:0: warning: "_POSIX_C_SOURCE" redefined
/usr/include/features.h:214:0: note: this is the location of the previous definition
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_hostApi’:
src/_portaudiomodule.c:211:38: error: ‘PaDeviceInfo’ has no member named ‘hostApi’
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultLowInputLatency’:
src/_portaudiomodule.c:253:42: error: ‘PaDeviceInfo’ has no member named ‘defaultLowInputLatency’
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultLowOutputLatency’:
src/_portaudiomodule.c:267:42: error: ‘PaDeviceInfo’ has no member named ‘defaultLowOutputLatency’
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultHighInputLatency’:
src/_portaudiomodule.c:282:42: error: ‘PaDeviceInfo’ has no member named ‘defaultHighInputLatency’
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultHighOutputLatency’:
src/_portaudiomodule.c:296:42: error: ‘PaDeviceInfo’ has no member named ‘defaultHighOutputLatency’
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultSampleRate’:
src/_portaudiomodule.c:310:42: error: ‘PaDeviceInfo’ has no member named ‘defaultSampleRate’
src/_portaudiomodule.c: At top level:
src/_portaudiomodule.c:465:3: error: expected specifier-qualifier-list before ‘PaHostApiInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_structVersion’:
src/_portaudiomodule.c:475:13: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c:481:29: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_type’:
src/_portaudiomodule.c:489:13: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c:495:36: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_name’:
src/_portaudiomodule.c:503:13: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c:503:32: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c:509:34: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_deviceCount’:
src/_portaudiomodule.c:517:13: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c:523:29: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_defaultInputDevice’:
src/_portaudiomodule.c:531:13: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c:537:29: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_defaultOutputDevice’:
src/_portaudiomodule.c:545:13: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c:551:29: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_dealloc’:
src/_portaudiomodule.c:569:7: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: At top level:
src/_portaudiomodule.c:910:3: error: expected specifier-qualifier-list before ‘PaStreamParameters’
src/_portaudiomodule.c: In function ‘_is_open’:
src/_portaudiomodule.c:921:23: error: ‘_pyAudio_Stream’ has no member named ‘is_open’
src/_portaudiomodule.c: In function ‘_cleanup_Stream_object’:
src/_portaudiomodule.c:932:19: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c:933:17: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c:935:19: error: ‘_pyAudio_Stream’ has no member named ‘inputParameters’
src/_portaudiomodule.c:936:22: error: ‘_pyAudio_Stream’ has no member named ‘inputParameters’
src/_portaudiomodule.c:937:17: error: ‘_pyAudio_Stream’ has no member named ‘inputParameters’
src/_portaudiomodule.c:940:19: error: ‘_pyAudio_Stream’ has no member named ‘outputParameters’
src/_portaudiomodule.c:941:22: error: ‘_pyAudio_Stream’ has no member named ‘outputParameters’
src/_portaudiomodule.c:942:17: error: ‘_pyAudio_Stream’ has no member named ‘outputParameters’
src/_portaudiomodule.c:946:15: error: ‘_pyAudio_Stream’ has no member named ‘is_open’
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_structVersion’:
src/_portaudiomodule.c:973:13: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c:981:29: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_inputLatency’:
src/_portaudiomodule.c:998:13: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c:1006:33: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_outputLatency’:
src/_portaudiomodule.c:1023:13: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c:1031:33: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_sampleRate’:
src/_portaudiomodule.c:1048:13: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c:1056:33: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c: In function ‘pa_get_version’:
src/_portaudiomodule.c:1168:3: warning: implicit declaration of function ‘Pa_GetVersion’
src/_portaudiomodule.c: In function ‘pa_get_version_text’:
src/_portaudiomodule.c:1177:3: warning: implicit declaration of function ‘Pa_GetVersionText’
src/_portaudiomodule.c:1177:3: warning: passing argument 1 of ‘PyString_FromString’ makes pointer from integer without a cast
/usr/include/python2.7/stringobject.h:63:24: note: expected ‘const char *’ but argument is of type ‘int’
src/_portaudiomodule.c: In function ‘pa_get_host_api_count’:
src/_portaudiomodule.c:1221:3: error: ‘PaHostApiIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1221:3: note: each undeclared identifier is reported only once for each function it appears in
src/_portaudiomodule.c:1221:18: error: expected ‘;’ before ‘count’
src/_portaudiomodule.c:1226:3: error: ‘count’ undeclared (first use in this function)
src/_portaudiomodule.c:1226:3: warning: implicit declaration of function ‘Pa_GetHostApiCount’
src/_portaudiomodule.c: In function ‘pa_get_default_host_api’:
src/_portaudiomodule.c:1248:3: error: ‘PaHostApiIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1248:18: error: expected ‘;’ before ‘index’
src/_portaudiomodule.c:1253:3: warning: implicit declaration of function ‘Pa_GetDefaultHostApi’
src/_portaudiomodule.c:1253:3: error: lvalue required as left operand of assignment
src/_portaudiomodule.c:1265:7: warning: passing argument 1 of ‘Pa_GetErrorText’ makes integer from pointer without a cast
/usr/include/portaudio.h:93:13: note: expected ‘PaError’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c:1269:3: warning: passing argument 1 of ‘PyInt_FromLong’ makes integer from pointer without a cast
/usr/include/python2.7/intobject.h:38:24: note: expected ‘long int’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c: In function ‘pa_host_api_type_id_to_host_api_index’:
src/_portaudiomodule.c:1275:3: error: ‘PaHostApiTypeId’ undeclared (first use in this function)
src/_portaudiomodule.c:1275:19: error: expected ‘;’ before ‘typeid’
src/_portaudiomodule.c:1276:3: error: ‘PaHostApiIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1276:18: error: expected ‘;’ before ‘index’
src/_portaudiomodule.c:1278:37: error: ‘typeid’ undeclared (first use in this function)
src/_portaudiomodule.c:1281:3: warning: implicit declaration of function ‘Pa_HostApiTypeIdToHostApiIndex’
src/_portaudiomodule.c:1293:7: warning: passing argument 1 of ‘Pa_GetErrorText’ makes integer from pointer without a cast
/usr/include/portaudio.h:93:13: note: expected ‘PaError’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c:1297:3: warning: passing argument 1 of ‘PyInt_FromLong’ makes integer from pointer without a cast
/usr/include/python2.7/intobject.h:38:24: note: expected ‘long int’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c: In function ‘pa_host_api_device_index_to_device_index’:
src/_portaudiomodule.c:1303:3: error: ‘PaHostApiIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1303:18: error: expected ‘;’ before ‘apiIndex’
src/_portaudiomodule.c:1305:3: error: ‘PaDeviceIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1305:17: error: expected ‘;’ before ‘devIndex’
src/_portaudiomodule.c:1308:38: error: ‘apiIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1311:3: error: ‘devIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1311:3: warning: implicit declaration of function ‘Pa_HostApiDeviceIndexToDeviceIndex’
src/_portaudiomodule.c: In function ‘pa_get_host_api_info’:
src/_portaudiomodule.c:1332:3: error: ‘PaHostApiIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1332:18: error: expected ‘;’ before ‘index’
src/_portaudiomodule.c:1333:3: error: ‘PaHostApiInfo’ undeclared (first use in this function)
src/_portaudiomodule.c:1333:18: error: ‘_info’ undeclared (first use in this function)
src/_portaudiomodule.c:1339:27: error: expected expression before ‘)’ token
src/_portaudiomodule.c:1345:7: error: ‘paInvalidHostApi’ undeclared (first use in this function)
src/_portaudiomodule.c:1350:10: error: ‘_pyAudio_paHostApiInfo’ has no member named ‘apiInfo’
src/_portaudiomodule.c: In function ‘pa_get_device_count’:
src/_portaudiomodule.c:1364:3: error: ‘PaDeviceIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1364:17: error: expected ‘;’ before ‘count’
src/_portaudiomodule.c:1369:3: error: ‘count’ undeclared (first use in this function)
src/_portaudiomodule.c:1369:3: warning: implicit declaration of function ‘Pa_GetDeviceCount’
src/_portaudiomodule.c: In function ‘pa_get_default_input_device’:
src/_portaudiomodule.c:1390:3: error: ‘PaDeviceIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1390:17: error: expected ‘;’ before ‘index’
src/_portaudiomodule.c:1395:3: warning: implicit declaration of function ‘Pa_GetDefaultInputDevice’
src/_portaudiomodule.c:1395:3: error: lvalue required as left operand of assignment
src/_portaudiomodule.c:1396:13: warning: comparison between pointer and integer
src/_portaudiomodule.c:1409:7: warning: passing argument 1 of ‘Pa_GetErrorText’ makes integer from pointer without a cast
/usr/include/portaudio.h:93:13: note: expected ‘PaError’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c:1413:3: warning: passing argument 1 of ‘PyInt_FromLong’ makes integer from pointer without a cast
/usr/include/python2.7/intobject.h:38:24: note: expected ‘long int’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c: In function ‘pa_get_default_output_device’:
src/_portaudiomodule.c:1419:3: error: ‘PaDeviceIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1419:17: error: expected ‘;’ before ‘index’
src/_portaudiomodule.c:1424:3: warning: implicit declaration of function ‘Pa_GetDefaultOutputDevice’
src/_portaudiomodule.c:1424:3: error: lvalue required as left operand of assignment
src/_portaudiomodule.c:1425:13: warning: comparison between pointer and integer
src/_portaudiomodule.c:1438:7: warning: passing argument 1 of ‘Pa_GetErrorText’ makes integer from pointer without a cast
/usr/include/portaudio.h:93:13: note: expected ‘PaError’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c:1442:3: warning: passing argument 1 of ‘PyInt_FromLong’ makes integer from pointer without a cast
/usr/include/python2.7/intobject.h:38:24: note: expected ‘long int’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c: In function ‘pa_get_device_info’:
src/_portaudiomodule.c:1448:3: error: ‘PaDeviceIndex’ undeclared (first use in this function)
src/_portaudiomodule.c:1448:17: error: expected ‘;’ before ‘index’
src/_portaudiomodule.c:1455:3: warning: passing argument 1 of ‘Pa_GetDeviceInfo’ makes integer from pointer without a cast
/usr/include/portaudio.h:182:21: note: expected ‘PaDeviceID’ but argument is of type ‘char * (*)(const char *, int)’
src/_portaudiomodule.c:1460:30: error: ‘paInvalidDevice’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘pa_open’:
src/_portaudiomodule.c:1601:3: error: ‘PaStreamParameters’ undeclared (first use in this function)
src/_portaudiomodule.c:1601:23: error: ‘outputParameters’ undeclared (first use in this function)
src/_portaudiomodule.c:1602:23: error: ‘inputParameters’ undeclared (first use in this function)
src/_portaudiomodule.c:1606:28: error: expected expression before ‘)’ token
src/_portaudiomodule.c:1622:9: error: ‘paInvalidDevice’ undeclared (first use in this function)
src/_portaudiomodule.c:1643:28: error: expected expression before ‘)’ token
src/_portaudiomodule.c:1679:3: error: ‘PaStreamInfo’ undeclared (first use in this function)
src/_portaudiomodule.c:1679:17: error: ‘streamInfo’ undeclared (first use in this function)
src/_portaudiomodule.c:1696:9: warning: passing argument 5 of ‘Pa_OpenStream’ makes pointer from integer without a cast
/usr/include/portaudio.h:325:9: note: expected ‘void *’ but argument is of type ‘int’
src/_portaudiomodule.c:1696:9: warning: passing argument 7 of ‘Pa_OpenStream’ makes integer from pointer without a cast
/usr/include/portaudio.h:325:9: note: expected ‘int’ but argument is of type ‘void *’
src/_portaudiomodule.c:1696:9: warning: passing argument 8 of ‘Pa_OpenStream’ makes integer from pointer without a cast
/usr/include/portaudio.h:325:9: note: expected ‘PaSampleFormat’ but argument is of type ‘void *’
src/_portaudiomodule.c:1696:9: error: too few arguments to function ‘Pa_OpenStream’
/usr/include/portaudio.h:325:9: note: declared here
src/_portaudiomodule.c:1712:31: error: expected expression before ‘)’ token
src/_portaudiomodule.c:1724:15: error: ‘_pyAudio_Stream’ has no member named ‘inputParameters’
src/_portaudiomodule.c:1725:15: error: ‘_pyAudio_Stream’ has no member named ‘outputParameters’
src/_portaudiomodule.c:1726:15: error: ‘_pyAudio_Stream’ has no member named ‘is_open’
src/_portaudiomodule.c:1727:15: error: ‘_pyAudio_Stream’ has no member named ‘streamInfo’
src/_portaudiomodule.c: In function ‘pa_is_format_supported’:
src/_portaudiomodule.c:1791:3: error: ‘PaStreamParameters’ undeclared (first use in this function)
src/_portaudiomodule.c:1791:22: error: expected ‘;’ before ‘inputParams’
src/_portaudiomodule.c:1792:22: error: expected ‘;’ before ‘outputParams’
src/_portaudiomodule.c:1812:5: error: ‘inputParams’ undeclared (first use in this function)
src/_portaudiomodule.c:1820:5: error: ‘outputParams’ undeclared (first use in this function)
src/_portaudiomodule.c:1827:3: warning: implicit declaration of function ‘Pa_IsFormatSupported’
src/_portaudiomodule.c:1831:16: error: ‘paFormatIsSupported’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘pa_start_stream’:
src/_portaudiomodule.c:1870:16: error: ‘paStreamIsNotStopped’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘pa_stop_stream’:
src/_portaudiomodule.c:1911:16: error: ‘paStreamIsStopped’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘pa_abort_stream’:
src/_portaudiomodule.c:1952:16: error: ‘paStreamIsStopped’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘pa_is_stream_stopped’:
src/_portaudiomodule.c:1994:3: warning: implicit declaration of function ‘Pa_IsStreamStopped’
src/_portaudiomodule.c: In function ‘pa_is_stream_active’:
src/_portaudiomodule.c:2039:3: warning: implicit declaration of function ‘Pa_IsStreamActive’
src/_portaudiomodule.c: In function ‘pa_get_stream_time’:
src/_portaudiomodule.c:2086:3: warning: implicit declaration of function ‘Pa_GetStreamTime’
src/_portaudiomodule.c: In function ‘pa_get_stream_cpu_load’:
src/_portaudiomodule.c:2118:3: warning: implicit declaration of function ‘Pa_GetStreamCpuLoad’
src/_portaudiomodule.c: In function ‘pa_write_stream’:
src/_portaudiomodule.c:2167:3: warning: implicit declaration of function ‘Pa_WriteStream’
src/_portaudiomodule.c:2171:16: error: ‘paOutputUnderflowed’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘pa_read_stream’:
src/_portaudiomodule.c:2233:3: error: ‘PaStreamParameters’ undeclared (first use in this function)
src/_portaudiomodule.c:2233:23: error: ‘inputParameters’ undeclared (first use in this function)
src/_portaudiomodule.c:2233:53: error: ‘_pyAudio_Stream’ has no member named ‘inputParameters’
src/_portaudiomodule.c:2253:3: warning: implicit declaration of function ‘Pa_ReadStream’
src/_portaudiomodule.c:2259:15: error: ‘paInputOverflowed’ undeclared (first use in this function)
src/_portaudiomodule.c:2265:22: error: ‘paOutputUnderflowed’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘pa_get_stream_write_available’:
src/_portaudiomodule.c:2309:3: warning: implicit declaration of function ‘Pa_GetStreamWriteAvailable’
src/_portaudiomodule.c: In function ‘pa_get_stream_read_available’:
src/_portaudiomodule.c:2334:3: warning: implicit declaration of function ‘Pa_GetStreamReadAvailable’
src/_portaudiomodule.c: In function ‘init_portaudio’:
src/_portaudiomodule.c:2384:49: error: ‘paInDevelopment’ undeclared (first use in this function)
src/_portaudiomodule.c:2385:47: error: ‘paDirectSound’ undeclared (first use in this function)
src/_portaudiomodule.c:2386:39: error: ‘paMME’ undeclared (first use in this function)
src/_portaudiomodule.c:2387:40: error: ‘paASIO’ undeclared (first use in this function)
src/_portaudiomodule.c:2388:48: error: ‘paSoundManager’ undeclared (first use in this function)
src/_portaudiomodule.c:2389:45: error: ‘paCoreAudio’ undeclared (first use in this function)
src/_portaudiomodule.c:2390:39: error: ‘paOSS’ undeclared (first use in this function)
src/_portaudiomodule.c:2391:40: error: ‘paALSA’ undeclared (first use in this function)
src/_portaudiomodule.c:2392:38: error: ‘paAL’ undeclared (first use in this function)
src/_portaudiomodule.c:2393:40: error: ‘paBeOS’ undeclared (first use in this function)
src/_portaudiomodule.c:2394:41: error: ‘paWDMKS’ undeclared (first use in this function)
src/_portaudiomodule.c:2395:40: error: ‘paJACK’ undeclared (first use in this function)
src/_portaudiomodule.c:2396:42: error: ‘paWASAPI’ undeclared (first use in this function)
src/_portaudiomodule.c:2410:50: error: ‘paNotInitialized’ undeclared (first use in this function)
src/_portaudiomodule.c:2412:6: error: ‘paUnanticipatedHostError’ undeclared (first use in this function)
src/_portaudiomodule.c:2417:49: error: ‘paInvalidDevice’ undeclared (first use in this function)
src/_portaudiomodule.c:2433:6: error: ‘paIncompatibleHostApiSpecificStreamInfo’ undeclared (first use in this function)
src/_portaudiomodule.c:2434:51: error: ‘paStreamIsStopped’ undeclared (first use in this function)
src/_portaudiomodule.c:2435:54: error: ‘paStreamIsNotStopped’ undeclared (first use in this function)
src/_portaudiomodule.c:2436:51: error: ‘paInputOverflowed’ undeclared (first use in this function)
src/_portaudiomodule.c:2437:53: error: ‘paOutputUnderflowed’ undeclared (first use in this function)
src/_portaudiomodule.c:2438:51: error: ‘paHostApiNotFound’ undeclared (first use in this function)
src/_portaudiomodule.c:2439:50: error: ‘paInvalidHostApi’ undeclared (first use in this function)
src/_portaudiomodule.c:2441:6: error: ‘paCanNotReadFromACallbackStream’ undeclared (first use in this function)
src/_portaudiomodule.c:2443:6: error: ‘paCanNotWriteToACallbackStream’ undeclared (first use in this function)
src/_portaudiomodule.c:2445:6: error: ‘paCanNotReadFromAnOutputOnlyStream’ undeclared (first use in this function)
src/_portaudiomodule.c:2447:6: error: ‘paCanNotWriteToAnInputOnlyStream’ undeclared (first use in this function)
src/_portaudiomodule.c:2449:6: error: ‘paIncompatibleStreamHostApi’ undeclared (first use in this function)
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_defaultOutputDevice’:
src/_portaudiomodule.c:552:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_defaultInputDevice’:
src/_portaudiomodule.c:538:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_deviceCount’:
src/_portaudiomodule.c:524:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_type’:
src/_portaudiomodule.c:496:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_structVersion’:
src/_portaudiomodule.c:482:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paHostApiInfo_get_name’:
src/_portaudiomodule.c:510:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultSampleRate’:
src/_portaudiomodule.c:311:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultHighOutputLatency’:
src/_portaudiomodule.c:297:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultHighInputLatency’:
src/_portaudiomodule.c:283:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultLowOutputLatency’:
src/_portaudiomodule.c:268:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_defaultLowInputLatency’:
src/_portaudiomodule.c:254:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_paDeviceInfo_get_hostApi’:
src/_portaudiomodule.c:212:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_sampleRate’:
src/_portaudiomodule.c:1057:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_is_open’:
src/_portaudiomodule.c:922:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_outputLatency’:
src/_portaudiomodule.c:1032:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_inputLatency’:
src/_portaudiomodule.c:1007:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘_pyAudio_Stream_get_structVersion’:
src/_portaudiomodule.c:982:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘pa_is_format_supported’:
src/_portaudiomodule.c:1841:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘pa_get_device_count’:
src/_portaudiomodule.c:1385:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘pa_host_api_device_index_to_device_index’:
src/_portaudiomodule.c:1327:1: warning: control reaches end of non-void function
src/_portaudiomodule.c: In function ‘pa_get_host_api_count’:
src/_portaudiomodule.c:1243:1: warning: control reaches end of non-void function
error: Setup script exited with error: command 'gcc' failed with exit status 1
|
How to execute a shell command through Python
| 27,853,231
| 1
| 6
| 8,218
| 0
|
python,shell
|
subprocess.check_output appears to be the canonical convenience function in Python 2.4+ for executing a command and inspecting the output. It also raises an error if the command returns a non-zero value (indicating an error).
Like subprocess.call, check_output is a convenience wrapper around subprocess.Popen, so you may prefer using Popen directly. But convenience wrappers are ...convenient, in theory.
| 0
| 1
| 0
| 0
|
2011-05-07T16:52:00.000
| 4
| 0.049958
| false
| 5,922,590
| 1
| 0
| 0
| 1
|
I am new to Python programming. I want to execute a shell command "at" from a Python program. Can any one of the Python gurus help me out? Thanks in advance.
|
How do I use Python 3.0 under Apache?
| 5,931,096
| 1
| 3
| 1,328
| 0
|
python,windows,apache,python-3.x
|
Python 3.0 is only supported via CGI. Put your CGI script in cgi-bin\. If you're willing to look at newer versions, preliminary support is available in mod_wsgi (but you'll probably have to build it yourself).
| 0
| 1
| 0
| 0
|
2011-05-08T23:06:00.000
| 3
| 0.066568
| false
| 5,930,982
| 0
| 0
| 0
| 1
|
I've searched for ages on how to use Python 3 under Apache. If there is a walkthrough anywhere, it's very well hidden. Thus, hopefully, one of you Python professionals could make a quick 1-2-3 on how it's done!
I'm on Windows 7 using the newest version of XAMPP.
|
Get Changed Environment Variable in Python
| 5,935,757
| 1
| 2
| 2,356
| 0
|
python
|
If your process sets/updates an environment variable and then calls the Python script, you would see the updated value in your Python script. But if these are parallel processes and the environment variable gets modified when the Python script is running then the updates to the environemnt variable is not seen in the Python script.
| 0
| 1
| 0
| 0
|
2011-05-09T10:10:00.000
| 2
| 0.099668
| false
| 5,935,404
| 1
| 0
| 0
| 2
|
I have a requirement where 1 process sets a value as environment variable and I read that value in python using
os.environ
As per python doc:
This mapping is captured the first
time the os module is imported,
typically during Python startup as
part of processing site.py. Changes to
the environment made after this time
are not reflected in os.environ,
except for changes made by modifying
os.environ directly.
My problem is the process set/change the variable every time it calls the python script.
Please tell me a way to read the changed value.
Thanks,
|
Get Changed Environment Variable in Python
| 5,935,419
| 3
| 2
| 2,356
| 0
|
python
|
I guess you can use os.getenv() to get the value of an environment variable any time, and this will reflect the most up-to-date state.
Update: note that there is no such thing as one "global" environment, at least not on Linux. Quoting Wikipedia:
In all Unix and Unix-like systems, each process has its own private set of environment variables. By default, when a process is created it inherits a duplicate environment of its parent process, except for explicit changes made by the parent when it creates the child.
Therefore, if you launch (fork) two processes from the same parent process (such as bash), and change an environment variable in one of the processes, the other process won't see it because it uses another copy of the environment of the parent process. Similarly, if you change the environment in the parent process after having launched the child processes, the child processes won't see the change because they have already created their private copy of the environment.
| 0
| 1
| 0
| 0
|
2011-05-09T10:10:00.000
| 2
| 1.2
| true
| 5,935,404
| 1
| 0
| 0
| 2
|
I have a requirement where 1 process sets a value as environment variable and I read that value in python using
os.environ
As per python doc:
This mapping is captured the first
time the os module is imported,
typically during Python startup as
part of processing site.py. Changes to
the environment made after this time
are not reflected in os.environ,
except for changes made by modifying
os.environ directly.
My problem is the process set/change the variable every time it calls the python script.
Please tell me a way to read the changed value.
Thanks,
|
mac snow leopard setuptools stick to MacOSX10.4u.sdk when trying to install python-mysql
| 5,936,425
| 0
| 0
| 358
| 1
|
python,mysql,macos,osx-snow-leopard,compilation
|
Check your environment for CFLAGS or LDFLAGS. Both of these can include the -isysroot argument that influences the SDK selection. The other place to start at is to look at the output of python2.6-config --cflags --ldflags since (I believe) that this influences the Makefile generation. Make sure to run easy_install with --verbose and see if it yields any additional insight.
| 0
| 1
| 0
| 0
|
2011-05-09T10:58:00.000
| 1
| 1.2
| true
| 5,935,910
| 0
| 0
| 0
| 1
|
when I try to install python-mysql today, I got a number of compilation error or complaining /Developer/SDKs/MacOSX10.4u.sdk not found, like the following:
running build
running build_py
copying MySQLdb/release.py -> build/lib.macosx-10.3-i386-2.6/MySQLdb
running build_ext
building '_mysql' extension
Compiling with an SDK that doesn't seem to exist: /Developer/SDKs/MacOSX10.4u.sdk
Please check your Xcode installation
However, I already installed latest xcode 4.0, which does include latest GCC and SDK.
I tried to find out where the 10.4u.sdk is specified, but could not find it in the system environment, program source and setuptools source.
I tried to export
export SDK=/Developer/SDKs/MacOSX10.5.sdk
export SDKROOT=/Developer/SDKs/MacOSX10.5.sdk
but still has no luck.
so anyone has any idea where this is specified in Mac Snow Leopard pls?
thx
|
Resolve mac address by host name
| 5,936,797
| 0
| 1
| 2,670
| 0
|
python,perl,ip,mac-address,hostname
|
The ethers file on a UNIX system maps Ethernet address to IP-number (or hostname). If your /etc/ethers is properly maintained, you can look it up in there.
| 0
| 1
| 0
| 1
|
2011-05-09T12:20:00.000
| 2
| 0
| false
| 5,936,781
| 0
| 0
| 0
| 1
|
I've wrote several perl scripts during my internship, and I would like to simplify the use of them. The scripts asks in arg, a mac address, and returns which switch is connected, speed...etc.
Instead of giving a mac address, I would like to give a host name of a computer. So, how can I resolve the hostname to mac address ?
Thanks, bye.
Edit -> Solution could be : bash command or perl module or something powerfull like that...
|
What are some good examples of processes to automate for a python beginner to start with?
| 5,945,001
| 1
| 1
| 117
| 0
|
python,linux,command-line
|
What you want to automate depends on what you are doing manually and what your role is ? If you are a system administrator (say) and if you have shell scripts written to automate some of the tasks (like server management, user account creation etc.) you can port them to Python.
| 0
| 1
| 0
| 0
|
2011-05-10T03:14:00.000
| 1
| 1.2
| true
| 5,944,764
| 1
| 0
| 0
| 1
|
Trying to get some initial bearings on useful processes that a basic working knowledge of python can assist with or make less tedious. Specifically, processes that can be executed on the command line in a Linux environment. An example or two of both the tedious process as well as sample code to use as a starting point would be greatly appreciated.
|
How do I upload an entire directory to S3?
| 5,959,764
| 9
| 3
| 3,211
| 0
|
python,file,amazon-web-services,amazon-s3
|
Install S3 (http://s3tools.org/download)
Configure it:
s3cmd --configure
Create a bucket: s3cmd mb s3://my-bucket (alternatively, you can do this via a tool like S3Fox)
Sync your local directory with S3: s3cmd sync /path/to/local/dir/ s3://my-bucket
| 0
| 1
| 0
| 0
|
2011-05-10T05:07:00.000
| 1
| 1.2
| true
| 5,945,408
| 0
| 0
| 0
| 1
|
I want my directory, and all its sub directories and files, to go straight to S3. Clone it.
Is there an easy script/program to do that?
I'm on Ubuntu linux.
|
Google App Engine : alternate method of get_by_id()
| 5,989,456
| 1
| 1
| 814
| 0
|
python,google-app-engine
|
The problem disappear by itself after the 2011-05-10, which is the v1.5 launch date. Not sure this problem is related.
I didn't change any code, as the get_by_id() was fine all the while and on this few days. Beside, I added a cron job to run the get_by_id() every minutes and try to get the instance alive.
From my observation, the get_by_id() failed because it couldn't query the datastore.
Btw, the setting of datastore is Master/Slave Replication.
| 0
| 1
| 0
| 0
|
2011-05-10T06:41:00.000
| 4
| 1.2
| true
| 5,946,170
| 0
| 0
| 1
| 3
|
By given an entity ID , I will query by models = Model.get_by_id(id). However, I find out that some time it will not return result collectly.
Is there any alternative or recommended method to query by entity ID in Google App Engine, python?
|
Google App Engine : alternate method of get_by_id()
| 5,949,477
| 3
| 1
| 814
| 0
|
python,google-app-engine
|
If Model.get_by_id(id) returns None, this indicates that you've supplied an invalid ID, not that the method itself is unreliable.
It's not inconceivable that this method could fail in the event of a system outage, but if it did, your call would throw a datastore exception, not return an empty result.
| 0
| 1
| 0
| 0
|
2011-05-10T06:41:00.000
| 4
| 0.148885
| false
| 5,946,170
| 0
| 0
| 1
| 3
|
By given an entity ID , I will query by models = Model.get_by_id(id). However, I find out that some time it will not return result collectly.
Is there any alternative or recommended method to query by entity ID in Google App Engine, python?
|
Google App Engine : alternate method of get_by_id()
| 5,946,313
| 0
| 1
| 814
| 0
|
python,google-app-engine
|
get_by_id() always get the object, if the passed object is a valid id of object and if the objects exists in the datastore.
id can be got by object.key.id in the templat
else you always have the object.get(key).
| 0
| 1
| 0
| 0
|
2011-05-10T06:41:00.000
| 4
| 0
| false
| 5,946,170
| 0
| 0
| 1
| 3
|
By given an entity ID , I will query by models = Model.get_by_id(id). However, I find out that some time it will not return result collectly.
Is there any alternative or recommended method to query by entity ID in Google App Engine, python?
|
Send Data From Flex to Python (GAE)
| 5,948,044
| 1
| 0
| 181
| 0
|
python,apache-flex,google-app-engine,google-cloud-datastore
|
Have flex send a request to the Python server. COuld be a form post or JSON data or whatever.
| 0
| 1
| 0
| 0
|
2011-05-10T09:05:00.000
| 3
| 1.2
| true
| 5,947,727
| 0
| 0
| 1
| 1
|
I'm working on a project that runs off Google App Engine (Python) which stores various user details inside GAE's datastore. I have Flex content which users can use and once done the Flex app needs to send data to the Python backend to 'mark' the user off for that task. Any suggestions?
|
Secure python web app
| 5,947,923
| 0
| 0
| 517
| 0
|
python,security,web-applications
|
Easiest and most secure: Put Apache or Nginx in front of it with an HTTPS proxy.
Update: Or VPN access as suggested by Jakob. Good idea.
| 0
| 1
| 0
| 1
|
2011-05-10T09:16:00.000
| 2
| 1.2
| true
| 5,947,849
| 0
| 0
| 1
| 2
|
i have python web app build on top of BaseHTTPServer, which runs on specyfic port. It runs system commands and shows output. I want do limit access to this app. What are posible ways to do it? Requirements:
it must not be limited to LAN
simple to implement/deploy
|
Secure python web app
| 5,947,916
| 0
| 0
| 517
| 0
|
python,security,web-applications
|
Common methods: VPN access. Firewalls, logging, denyhosts style defences, complicated root passwords, no su, run as its own user.
(if it was my personal server)
Logic bombs
| 0
| 1
| 0
| 1
|
2011-05-10T09:16:00.000
| 2
| 0
| false
| 5,947,849
| 0
| 0
| 1
| 2
|
i have python web app build on top of BaseHTTPServer, which runs on specyfic port. It runs system commands and shows output. I want do limit access to this app. What are posible ways to do it? Requirements:
it must not be limited to LAN
simple to implement/deploy
|
determining URL that forwarded
| 5,951,213
| 1
| 1
| 199
| 0
|
python,google-app-engine,url
|
If by forwarding you mean HTTP redirection, you can check the Referer header.
If you mean DNS resolving (e.g. distinguishing between your application being invoked via your own domain and .appspot.com one), there is SERVER_NAME environment variable (os.environ["SERVER_NAME"]) that stores the domain (e.g. www.example.com) used to issue the request.
| 0
| 1
| 0
| 0
|
2011-05-10T13:44:00.000
| 3
| 0.066568
| false
| 5,951,035
| 0
| 0
| 1
| 1
|
I have a series of different domain names that I would like to all point (via URL forwarding from my domain host) to a google app engine application that reads what the forwarding URL is. So if the domain typed in was original XYZ.com, then when I am forwarded to my application, I can return what that original domain name was. I'm using the python variant. How best can I do this without coding for each and every variant?
|
How to know the system is Debian or CentOS in Python?
| 5,952,044
| 3
| 6
| 1,337
| 0
|
python,debian,centos,yum,apt
|
If you just need to know whether to use yum or apt, one approach is simply to pick one of those commands and try it. If it works, it works; if not, catch the exception and try the other command.
| 0
| 1
| 0
| 1
|
2011-05-10T14:49:00.000
| 2
| 0.291313
| false
| 5,951,930
| 0
| 0
| 0
| 1
|
I want to write some install scripts by python, it should know the OS to choose either apt command or yum command.
It seems sys.platform can tell 'win32' or the others, but how to know it is working on Debian or CentOS in Python?
|
Get content from open window in Linux
| 5,961,317
| 4
| 1
| 1,235
| 0
|
python,linux,window-managers
|
I think the correct answer may be "with some difficulty". Essentially, the contents of a window is a bitmap. This bitmap is drawn on by a whole slew of primitives (including "display this octet-string, using that encoding and a specific font"), but the window contents is still "just pixels".
Getting the "just pixels" is pretty straight-forward, as these things go. You open a session to the X server and say "given me the contents of window W" and it hands it over.
Doing something useful with it is, unfortunately, a completely different matter, as you'd potentially have to (essentially) OCR the bitmap for what you want.
If you decide to take that route, have a look at the source of xwd, as that does, essentially, that.
| 0
| 1
| 0
| 0
|
2011-05-11T07:05:00.000
| 3
| 0.26052
| false
| 5,960,483
| 0
| 0
| 0
| 1
|
I want to collect data and parse it eventually from an open window in linux.
An example- Suppose a terminal window is open. I need to retrieve all the data that appears on that window. After retrieval, I would parse it to get specific commands entered.
So is it possible to do that? If so, how? I would prefer to use python to code this entire thing.
I am making a guess that first I would have to get some sort of ID for the open window and then use some kind of library to get the content from the window whose ID I have got.
Please help. I am quite a newbie.
|
check if a file is 'complete' (with python)
| 5,967,726
| 1
| 3
| 6,644
| 0
|
python,macos,file-io
|
It seems like you have control of the (python?) program doing the copying. What commands are you using to copy? I would think writing your code such that it blocks until the copy operation is complete would be sufficient.
Is this program multi-threaded or processed? If so you could add file paths to a queue when they are complete and then have the other thread only act on items in the queue.
| 0
| 1
| 0
| 1
|
2011-05-11T16:23:00.000
| 6
| 0.033321
| false
| 5,967,521
| 0
| 0
| 0
| 2
|
is it possible to check if a file is done copying of if its complete using python?
or even on the command line.
i manipulate files programmatically in a specific folder on mac osx but i need to check if the file is complete before running the code which makes the manipulation.
|
check if a file is 'complete' (with python)
| 5,967,724
| 2
| 3
| 6,644
| 0
|
python,macos,file-io
|
If you know where the files are being copied from, you can check to see whether the size of the copy has reached the size of the original.
Alternatively, if a file's size doesn't change for a couple of seconds, it is probably done being copied, which may be good enough. (May not work well for slow network connections, however.)
| 0
| 1
| 0
| 1
|
2011-05-11T16:23:00.000
| 6
| 1.2
| true
| 5,967,521
| 0
| 0
| 0
| 2
|
is it possible to check if a file is done copying of if its complete using python?
or even on the command line.
i manipulate files programmatically in a specific folder on mac osx but i need to check if the file is complete before running the code which makes the manipulation.
|
Troubleshoot python daemon that quits unexpectedly?
| 5,969,373
| 1
| 4
| 2,169
| 0
|
python,strace
|
I would generally start by adding logging to it. At a minimum, have whatever is launching it capture stdout/stderr so that any stack traces are saved. Examine your except blocks to make sure you're not capturing exceptions silently.
| 0
| 1
| 0
| 1
|
2011-05-11T19:08:00.000
| 3
| 0.066568
| false
| 5,969,337
| 0
| 0
| 0
| 1
|
What's the best way to monitor a python daemon to determine the cause of it quitting unexpectedly? Is strace my best option or is there something Python specific that does the job?
|
Two Python instances, same libraries
| 5,982,042
| 4
| 2
| 113
| 0
|
python,linux,libraries
|
You should be able to install the files to an external location and define the environment variable PYTHONPATH to point to the directory that contains the modules.
| 0
| 1
| 0
| 0
|
2011-05-12T17:26:00.000
| 2
| 1.2
| true
| 5,981,933
| 1
| 0
| 0
| 2
|
I currently have both Python 2.6 and 2.7 running on my Linux machine.
Now, from Python 2.7, I can't access the libraries that I installed through package manager for Python 2.6.
I tried uninstalling the library and installing it back with Python 2.7 installed as my default runtime. No luck.
How can I share libraries between two Python instances? Is there a more correct way to do this than just copying them?
If useful: my Linux distro is Debian, and my package manager is apt.
|
Two Python instances, same libraries
| 5,982,011
| 0
| 2
| 113
| 0
|
python,linux,libraries
|
You should have now both a /usr/lib/python2.6 folder and a /usr/lib/python2.7. Try creating links inside the 2.7 folders to the required files or folders inside the 2.6 folder.
| 0
| 1
| 0
| 0
|
2011-05-12T17:26:00.000
| 2
| 0
| false
| 5,981,933
| 1
| 0
| 0
| 2
|
I currently have both Python 2.6 and 2.7 running on my Linux machine.
Now, from Python 2.7, I can't access the libraries that I installed through package manager for Python 2.6.
I tried uninstalling the library and installing it back with Python 2.7 installed as my default runtime. No luck.
How can I share libraries between two Python instances? Is there a more correct way to do this than just copying them?
If useful: my Linux distro is Debian, and my package manager is apt.
|
asynchronous file upload with ajaxupload to a tornado web server
| 5,989,216
| 2
| 3
| 1,836
| 1
|
python,file-upload,tornado,ajax-upload
|
I got the answer.
I need to use self.request.body to get the raw post data.
I also need to pass in the correct _xsrf token, otherwise tornado will fire a 403 exception.
So that's about it.
| 0
| 1
| 0
| 0
|
2011-05-12T19:00:00.000
| 1
| 1.2
| true
| 5,983,032
| 0
| 0
| 1
| 1
|
I'm using this javascript library (http://valums.com/ajax-upload/) to upload file to a tornado web server, but I don't know how to get the file content. The javascript library is uploading using XHR, so I assume I have to read the raw post data to get the file content. But I don't know how to do it with Tornado. Their documentation doesn't help with this, as usual :(
In php they have something like this:
$input = fopen("php://input", "r");
so what's the equivalence in tornado?
|
Linux user scheme for a Django production server
| 5,986,912
| 2
| 6
| 925
| 0
|
python,django,linux,nginx,uwsgi
|
I like having regular users on a system:
multiple admins show up in sudo logs -- there's nothing quite like asking a specific person why they made a specific change.
not all tasks require admin privileges, but admin-level mistakes can be more costly to repair
it is easier to manage the ~/.ssh/authorized_keys if each file contains only keys from a specific user -- if you get four or five different users in the file, it's harder to manage. Small point :) but it is so easy to write cat ~/.ssh/id_rsa.pub | ssh user@remotehost "cat - > ~/.ssh/authorized_keys" -- if one must use >> instead, it's precarious. :)
But you're right, you can do all your work as root and not bother with regular user accounts.
| 0
| 1
| 0
| 0
|
2011-05-13T01:51:00.000
| 1
| 1.2
| true
| 5,986,472
| 0
| 0
| 1
| 1
|
I'm currently trying to set up nginx + uWSGI server for my Django homepage. Some tutorials advice me to create specific UNIX users for certain daemons. Like nginx user for nginx daemon and so on. As I'm new to Linux administration, I thought just to create second user for running all the processes (nginx, uWSGI etc.), but it turned out that I need some --system users for that.
Main question is what users would you set up for nginx + uWSGI server and how to work with them? Say, I have server with freshly installed Debian Squeeze.
Should I install all the packages, virtual environment and set up all the directories as root user and then create system ones to run the scripts?
|
does C has anything like python pickle for object serialisation?
| 5,987,204
| 4
| 2
| 207
| 0
|
python,c
|
An emphatic NO on that one, I'm afraid. C has basic file I/O. Any structuring of data is up to you. Make up a format, dump it out, read it in.
There may be libraries which can do this, but by itself no C doesn't do this.
| 0
| 1
| 0
| 0
|
2011-05-13T04:19:00.000
| 3
| 1.2
| true
| 5,987,185
| 0
| 1
| 0
| 2
|
I'm wondering if C has anything similar to the python pickle module that can dump some structured data on disk and then load it back later.
I know that I can write my structure byte by byte to a file on disk and then read it back later, but with this approach there's still quite some work to do. For example, if I have a single link list structure, I can traverse the list from head to tail and write each node's data on disk. When I read the list back from the on-disk file, I have to reconstruct all links
between each pair of nodes.
Please advise if there's an easier way.
Thanks heaps!
|
does C has anything like python pickle for object serialisation?
| 5,987,230
| 2
| 2
| 207
| 0
|
python,c
|
The C library functions fread(3) and fwrite(3) will read and write 'elements of data', but that's pretty fanciful way of saying "the C library will do some multiplication and pread(2) or pwrite(2) calls behind the scenes to fill your array".
You can use them on structs, but it is probably not a good idea:
holes in the structs get written and read
you're baking in the endianness of your integers
While you can make your own format for writing objects, you might want to see if your application could use SQLite3 for on-disk storage of objects. It's well-debugged, and if your application fits its abilities well, it might be just the ticket. (And a lot easier than writing all your own formatting code.)
| 0
| 1
| 0
| 0
|
2011-05-13T04:19:00.000
| 3
| 0.132549
| false
| 5,987,185
| 0
| 1
| 0
| 2
|
I'm wondering if C has anything similar to the python pickle module that can dump some structured data on disk and then load it back later.
I know that I can write my structure byte by byte to a file on disk and then read it back later, but with this approach there's still quite some work to do. For example, if I have a single link list structure, I can traverse the list from head to tail and write each node's data on disk. When I read the list back from the on-disk file, I have to reconstruct all links
between each pair of nodes.
Please advise if there's an easier way.
Thanks heaps!
|
Python: tool to keep track of deployments
| 5,988,654
| 1
| 5
| 332
| 0
|
python,deployment,web-deployment
|
pip freeze gives you a listing of all installed packages. Bonus: if you redirect the output to a file, you can use it as part of your deployment process to install all those packages (pip can programmatically install all packages from the file).
I see you're already using virtualenv. Good. You can run pip freeze -E myvirtualenv > myproject.reqs to generate a dependency file that doubles as a status report of the Python environment.
| 0
| 1
| 0
| 0
|
2011-05-13T06:41:00.000
| 2
| 0.099668
| false
| 5,988,177
| 0
| 0
| 1
| 1
|
I'm looking for a tool to keep track of "what's running where". We have a bunch of servers, and on each of those a bunch of projects. These projects may be running on a specific version (hg tag/commit nr) and have their requirements at specific versions as well.
Fabric looks like a great start to do the actual deployments by automating the ssh part. However, once a deployment is done there is no overview of what was done.
Before reinventing the wheel I'd like to check here on SO as well (I did my best w/ Google but could be looking for the wrong keywords). Is there any such tool already?
(In practice I'm deploying Django projects, but I'm not sure that's relevant for the question; anything that keeps track of pip/virtualenv installs or server state in general should be fine)
many thanks,
Klaas
==========
EDIT FOR TEMP. SOLUTION
==========
For now, we've chosen to simply store this information in a simple key-value store (in our case: the filesystem) that we take great care to back up (in our case: using a DCVS). We keep track of this store with the same deployment tool that we use to do the actual deploys (in our case: fabric)
Passwords are stored inside a TrueCrypt volume that's stored inside our key-value store.
==========
I will still gladly accept any answer when some kind of Open Source solution to this problem pops up somewhere. I might share (part of) our solution somewhere myself in the near future.
|
Installing modules for multiple python versions
| 5,991,416
| 3
| 4
| 4,579
| 0
|
python,python-module,multiple-versions
|
You can use easy_install. To use it for particular version, you just execute it like for example sudo python2.5 easy_install package_name.
| 0
| 1
| 0
| 0
|
2011-05-13T11:27:00.000
| 2
| 1.2
| true
| 5,991,193
| 1
| 0
| 0
| 1
|
I have installed python 2.6.6 and python 2.5.5 on the same machines (Ubuntu 10.0.4), since 2.6 is my default version and 2.5 I need for maintaining old stuff.
But I have a problem to install modules(MySQLdb and net-snmp) to non-default 2.5v. It seems that only 2.6 is updated when 'sudo apt-get install _module_name_' is called.
Is there a way to tell for which version module should be installed?
Thanks in advance
|
amqp exchange types
| 7,130,213
| 0
| 0
| 356
| 0
|
python,amqp,kombu
|
For most people it is best to just use a topic exchange for everything until you fully understand how AMQP works. You can get fanout and direct behavior just by choosing the right binding key for a queue. For instance if you use "#" for a binding key, then that queue behaves as if it was connected to a direct exchange. And if you bind two or more queues to the same routing keys, then those queues function as it if was a fanout exchange.
The round robin behavior is expected. Both tasks are subscribed to the exact same queue. The fact that the binding keys are different just confuses everything. Probably whoever binds last, will set the binding key for every queue user. Best not to do that. I build a system in which several queues have anywhere from 4 to 15 instances of the exact same worker code, pulling messages off the same queue and then collecting data from web services. I have even had the workers running on different CPUs although in the end that was not necessary for performance.
I'm not sure why you are using wildcards in the binding keys. If you have 8 consumers named A through H, and each one does a different job, then why not publish messages with routing keys work.A through work.H and then use the same binding keys work.A through work.H. That way if you have multiple instances of worker B, they all bind to work.B and no message is delivered twice.
Also, if you don't ack a message after handling it, then eventually it will go back on the queue and be delivered again. Hopefully you are acking after successfully handling the message. No task manager is needed, just better understanding of all the AMQP knobs.
| 0
| 1
| 0
| 0
|
2011-05-13T23:18:00.000
| 1
| 1.2
| true
| 5,998,693
| 0
| 0
| 0
| 1
|
I'm getting into the whole amqp thing and i have a question regarding which type of exchange type to use under the following scenario's:
1) i have the need to create a worker pool where each worker does something when they receive a message. now i want different workers attached to different types of tasks; which i can specify by using the routing keys of each message in a topic fashion. on the consumer end, playing around a bit with kombu i notice that if i specify the same queue name but with different routing keys i can not 'filter' the messages. eg if i have one consumer with '#' and another with 'foo.#' - both using the same queue name, the latter consumer will work round robin on the queue with the former consumer. is this expected? i am running both consumers on the same machine.
2) so given that, i construct unique queue names for each consumer and this time, each consumer does only get what i ask for with the routing key. however, because they are distinct queues, i may get a task in more than just one consumer. eg if consumer 1 has key '#', and consumer 2 has 'foo.#'; when consumer 2 receives (and acks) a message, consumer 1 also gets the same message. this is not what i want; i would like only one consumer to get the message only. is there a way i can achieve this without writing a 'task manager'?
cheers,
|
Porting python-twisted based code to scala: framework advice needed
| 9,134,732
| 2
| 7
| 975
| 0
|
python,scala,twisted,akka,scalaz
|
Finagle seems to be modeled closely after, or at least accidentally similar, to twisted. twitter.util.Future looks a lot like twisted's Deferred. So I'm using it for the moment.
| 0
| 1
| 0
| 0
|
2011-05-15T11:30:00.000
| 1
| 1.2
| true
| 6,008,107
| 0
| 0
| 0
| 1
|
I am trying to port a significant amount of code written in python with twisted to scala, and I'm looking for opinions on what framework combination to choose.
The thing is essentially an RPC (custom protobuf-based + xmlrpc)/HTTP server and client, that does some database-keeping and transformations but later sends down rpcs to workers which are outside of the scope of this rewrite.
As a network IO/base for implementing RPC stack I am using netty. All the workflows in the old thingy were based on twisted's Deferred, and to replace it I'm currently considering either ChannelFuture directly, or wrapping it inside either scalaz.Promise or akka.Future.
I guess, one part of the question is - can it be done simpler than manually working with callbacks? I guess, if I choose this route, I can simplify it later by adding some wrappers and using continuations, but maybe I need to use something different from the beginning?
I tried to fit the workflow inside actor model but it doesn't seem to work with stdlib actors.
Thanks.
Update: Finagle seems to be modeled closely after, or at least accidentally similar, to twisted. twitter.util.Future looks a lot like twisted's Deferred. So I'm using it for the moment.
Update 2: The reasons why I ported it in the first place are static typing and performance.
|
How do I detect a socket disconnection? / How do I call socket.recv with a timeout?
| 6,010,876
| 2
| 4
| 5,998
| 0
|
python,sockets,networking,gevent
|
it's not detecting the disconnection because there wasn't any disconnection, the TCP "connection" is still alive and suppose to be reliable. if for example you unplug your LAN cable, and the re-plug it, the connection will still work.
if you really want to detect the disconnection ASAP, then i guess you should just parse every second the os network status (ifconfig/ipconfig)/ or use os events, and do what you want when you detect network disconnection.
| 0
| 1
| 1
| 0
|
2011-05-15T15:35:00.000
| 2
| 0.197375
| false
| 6,009,365
| 0
| 0
| 0
| 1
|
I'm using gevent patched socket to connect to a streaming server and I'm using an adsl connection.
I don't control the server but in my tests, if I stop the server I can detect the disconnection by just checking if the result from recv is an empty string, but if I turn off my adsl modem recv never exits. If I just disconnect my computer's network cable it doesn't return an empty string either, but when I reconnect it, it returns everything the server sent in the meantime, so I'm guessing the router or modem is keeping the connection open for me and buffering the stream while my network cable is disconnected.
I tried setting socket.SO_RCVTIMEO to a few seconds but it didn't detect the disconnection, recv continues to "block" forever. This is gevent, so it only blocks the greenthread, but I need to detect this disconnection as soon as possible so I can try to reconnect.
|
Do I need to update the watch when new sub-folder add in the monitor folder
| 6,039,032
| 2
| 2
| 181
| 0
|
python,pyinotify
|
And I find that there is an parameter auto_add in function add_watch,
which can auto add the directory in the watch when it is created.
But it need the event IN_CREATE.
| 0
| 1
| 0
| 0
|
2011-05-16T08:35:00.000
| 2
| 0.197375
| false
| 6,014,836
| 0
| 0
| 0
| 2
|
I have watch a folder that will create a new sub-folder use date as name(e.g 201105124) everyday. I have start a daemon to watch it but if a new sub-folder added, the event in the new sub-folder cannot be trigger. IS that I need to update the watch for the new folder?
Thx for your answer.
Regards
Roy
|
Do I need to update the watch when new sub-folder add in the monitor folder
| 6,015,129
| 0
| 2
| 181
| 0
|
python,pyinotify
|
Yes, you need to use update_watch after directory creation.
| 0
| 1
| 0
| 0
|
2011-05-16T08:35:00.000
| 2
| 1.2
| true
| 6,014,836
| 0
| 0
| 0
| 2
|
I have watch a folder that will create a new sub-folder use date as name(e.g 201105124) everyday. I have start a daemon to watch it but if a new sub-folder added, the event in the new sub-folder cannot be trigger. IS that I need to update the watch for the new folder?
Thx for your answer.
Regards
Roy
|
How to prevent termination of a running program using "ctrl+c" in Linux using python?
| 6,019,234
| 0
| 4
| 838
| 0
|
python,command-line,keyboard-shortcuts
|
If using X, the text is normally copied to the clipboard once it's selected. Just paste it using middle mouse button or Shift+insert.
| 0
| 1
| 0
| 0
|
2011-05-16T14:52:00.000
| 3
| 0
| false
| 6,019,192
| 0
| 0
| 0
| 1
|
I have written a piece of code in python, in which I am asking questions and users should give their input. Sometimes, these questions are difficult for the user to understand(they are non-english). So most of the time they want to copy paste the sentence into google translate. However, since this code is running in the command prompt,they have to select the text and using "right click --> copy" they can copy the text into google translate. Sometimes, by mistake the press "ctrl+c"(it is natural for everyone to use this combination for copying). Doing this will terminate the code, and they have to start over. I need to know I can prevent this from happening. In other words, if they press "ctrl+c" nothing happens and my software doesn't abort.
thanks
|
Is there a way to determine if a Linux PID is paused or not?
| 6,021,798
| 4
| 7
| 2,298
| 0
|
python,linux,process,controls,pid
|
call ps and check the STAT value.
D Uninterruptible sleep (usually IO)
R Running or runnable (on run queue)
S Interruptible sleep (waiting for an event to complete)
T Stopped, either by a job control signal or because it is being traced.
W paging (not valid since the 2.6.xx kernel)
X dead (should never be seen)
Z Defunct ("zombie") process, terminated but not reaped by its parent.
| 0
| 1
| 0
| 1
|
2011-05-16T18:35:00.000
| 3
| 0.26052
| false
| 6,021,771
| 0
| 0
| 0
| 1
|
I have a python script that is using the SIGSTOP and .SIGCONT commands with os.kill to pause or resume a process. Is there a way to determine whether the related PID is in the paused or resumed state?
|
IDE for Python: test a script
| 6,024,347
| 3
| 0
| 110
| 0
|
python,ide
|
In absence of some other file based config, you could just keep the variable definitions in a a file that you import in the main script (e.g, config.py), then have two different versions of that file for 'on' and 'off' network, (or ' development' and 'production', whatever) with the appropriate settings. No IDE needed.
| 0
| 1
| 0
| 1
|
2011-05-16T21:00:00.000
| 1
| 1.2
| true
| 6,023,377
| 0
| 0
| 0
| 1
|
Is there any IDE that allows to run a script in testing mode, allowing to replace at runtime, some values, like a folder or else?
I have a program that will have to run on a network i have no access to where I develop. Since it will use some specific folders to pick up files, I was wondering if i.e. I could use an IDE that using some parameters will translate all that is like \corporate\disk-c\myfolder into a c:\myfolder.
Thanks!
M
|
making python interpreter open in same window
| 6,401,182
| 0
| 1
| 1,148
| 0
|
emacs,buffer,python-mode
|
I use python-mode 5.2.0.
I went into python-mode.el and changed the switch-to-buffer-other-window to switch-to-buffer.
I evaluated it and now the interpreter opens up in the same window (regardless of the number of other windows I have).
Did you evaluate the function when you changed the above line?
Btw, opening the interpreter in another window is a feature, not a bug, IMHO. We want to be able to see the interpreter when we evaluate a region of code using C-c | or the buffer using C-c C-c.
| 0
| 1
| 0
| 0
|
2011-05-17T01:27:00.000
| 2
| 0
| false
| 6,025,305
| 1
| 0
| 0
| 1
|
Maybe I'm being irrational but I really really hate it when a command opens a new window in emacs. I'm using emacs on Ubuntu which came with python-mode and when I start an interpreter with C-c ! it pops up in a new window.
What I want is for emacs to switch to a new buffer in the same window. So far I've tried adding Jython(I set the interpreter to jython) to same-window-buffer-names and even going into python-mode.el and changing switch-to-buffer-other-window calls to switch-to-buffer(which I since changed back). So far I've gotten no change.
I have emacs 23.1.1 and python-mode 5.1.0
Edit: The actual name of the jython buffer is bracketed by asterisks and I don't know how to let stackoverflow know that they aren't styling information.
|
Plone 4.0.5 unified installer failing on Ubuntu 11.04 (natty) with zip/zlib error
| 6,056,817
| 2
| 5
| 5,914
| 0
|
python,ubuntu,plone,zlib
|
Instructing the Unified Installer to build its own zlib works: ./install.sh --libz=yes zeo
| 0
| 1
| 0
| 0
|
2011-05-17T12:39:00.000
| 5
| 0.07983
| false
| 6,030,876
| 0
| 0
| 0
| 2
|
I am a Plone newbie and am trying to install Plone 4.0.5 on Ubuntu 11.04 Natty using the Unified Installer.
I unpack the installer and run the ./install.sh zeo as root and I get the following error:
ZEO Cluster Install selected
Detailed installation log being written to /tmp/Plone-4.0.5-UnifiedInstaller/install.log
Root install method chosen. Will install for use by system user plone
Installing Plone 4.0.5 at /usr/local/Plone
User 'plone' already exists. No need to create it.
Skipping libjpeg build
Skipping zlib build
Skipping readline build
Installing Python 2.6.6. This takes a while...
Traceback (most recent call last):
File "", line 1, in
LookupError: unknown encoding: zip
Python zlib support is missing; something went wrong in the zlib or python build.
Installation has failed.
See the detailed installation log at /tmp/Plone-4.0.5-UnifiedInstaller/install.log
to determine the cause.
I have installed these ubuntu packages too:
apt-get install zlib1g zlib1g-dev zlibc libghc6-zlib-dev zlibc
The install.log is quite big - I'm just including mentions of zlib here:
Starting at Tue May 17 14:12:46 SAST 2011
configure: WARNING: unrecognized options: --with-readline, --with-zlib, --disable-tk, --with-cxx
...
Failed to find the necessary bits to build these modules:
_bsddb _sqlite3 _tkinter
bsddb185 dbm gdbm
sunaudiodev zlib
To find the necessary bits, look in setup.py in detect_modules() for the module's name.
Failed to build these modules:
crypt nis
...
I can't find a setup.py in the installation files.
Any ideas what I should do or what I should be looking for?
Thank you.
|
Plone 4.0.5 unified installer failing on Ubuntu 11.04 (natty) with zip/zlib error
| 6,044,639
| 1
| 5
| 5,914
| 0
|
python,ubuntu,plone,zlib
|
Note that if you have an acceptable Python on your system already (or can install one), you may use "--with-python=/path/to/Python-2.6" on the install.sh command line.
| 0
| 1
| 0
| 0
|
2011-05-17T12:39:00.000
| 5
| 0.039979
| false
| 6,030,876
| 0
| 0
| 0
| 2
|
I am a Plone newbie and am trying to install Plone 4.0.5 on Ubuntu 11.04 Natty using the Unified Installer.
I unpack the installer and run the ./install.sh zeo as root and I get the following error:
ZEO Cluster Install selected
Detailed installation log being written to /tmp/Plone-4.0.5-UnifiedInstaller/install.log
Root install method chosen. Will install for use by system user plone
Installing Plone 4.0.5 at /usr/local/Plone
User 'plone' already exists. No need to create it.
Skipping libjpeg build
Skipping zlib build
Skipping readline build
Installing Python 2.6.6. This takes a while...
Traceback (most recent call last):
File "", line 1, in
LookupError: unknown encoding: zip
Python zlib support is missing; something went wrong in the zlib or python build.
Installation has failed.
See the detailed installation log at /tmp/Plone-4.0.5-UnifiedInstaller/install.log
to determine the cause.
I have installed these ubuntu packages too:
apt-get install zlib1g zlib1g-dev zlibc libghc6-zlib-dev zlibc
The install.log is quite big - I'm just including mentions of zlib here:
Starting at Tue May 17 14:12:46 SAST 2011
configure: WARNING: unrecognized options: --with-readline, --with-zlib, --disable-tk, --with-cxx
...
Failed to find the necessary bits to build these modules:
_bsddb _sqlite3 _tkinter
bsddb185 dbm gdbm
sunaudiodev zlib
To find the necessary bits, look in setup.py in detect_modules() for the module's name.
Failed to build these modules:
crypt nis
...
I can't find a setup.py in the installation files.
Any ideas what I should do or what I should be looking for?
Thank you.
|
Can python freeze be made to compile 32 bit binaries on a 64 bit linux
| 6,045,613
| 1
| 0
| 362
| 0
|
python,linux,32bit-64bit,freeze
|
Could you use something likemake CFLAGS="-m32".?
| 0
| 1
| 0
| 0
|
2011-05-18T13:29:00.000
| 1
| 0.197375
| false
| 6,045,515
| 1
| 0
| 0
| 1
|
I've a number of python scripts that I am likely to need to distribute to users who may have minimal x86 linux setups and no guarantees of having python or a particular version of it.
My desktop is an x86-84 architecture setup, but I am able to cross compile 32 bit elf's with GCC.
The python freeze script is currently outputting a 64 bit elf, plus a 64 bit .so. Is there any option/hack etc known to get this to compile to a 32 bit output?
|
File handle leaking (maybe) in a C library makes trouble with NFS (+python, but that's incidental)
| 6,052,579
| 1
| 2
| 368
| 0
|
python,file,nfs,resource-leak
|
The kernel keeps track of file descriptors, so even if you got python to unload the .so and release the memory, it would not know to close the leaked file descriptors. The only thing that comes to mind is importing the .so after forking, and only cleaning up after the forked child process has exited (and the file handles implicitly closed on exit by the kernel).
| 0
| 1
| 0
| 0
|
2011-05-18T16:36:00.000
| 2
| 0.099668
| false
| 6,048,046
| 1
| 0
| 0
| 1
|
here is a quite cool problem.
I have a python script (main) that calls a python module (foo.py) which in turns calls another python module (barwrapper.py) uses LoadLibrary to dynamically open and access a libbar.so library.
libbar and the whole rest of the chain open and create files to perform their task. The problem arises when we issue a rmtree in the main python script to get rid of the temporary directory created by the imported modules. rmtree is invoked at the end of the script, just before exiting. The call fails because the directory contains .nfs-whatever hidden files, which I guess are the removed files. These files apparently are kept open in the code, forcing nfs to move them to these .nfs-whatever files until the file descriptor is released. This situation does not arise in other filesystems, because files associated to held descriptors are effectively removed but kept accessible by the kernel until the descriptor is closed.
We strongly suspect that the .so library is leaking file descriptors, and these non-closed files ruin the rmtree party at cleanup time. I thought about unloading the .so file in barwrapper, but apparently there's no way to do that, and I am not sure if the dynloader will actually remove the lib from the process space and close the descriptors, or if it will just mark it unloaded and that's it, waiting to be replaced by other stuff, but with the descriptors leaked.
I can't really think of other workarounds to the problem (apart from fixing the leaks, something we would not like to do, as it's a 3rd party library). Clearly, it happens only on nfs. Do you have any idea we can try out to fix it ?
|
ipython and fork()
| 6,218,845
| 0
| 7
| 1,506
| 0
|
python,fork,process,ipython
|
In Linux terminology, instead of forking the iPython process, why don't you exec a regular python interpreter from the iPython shell and have that one fork?
| 0
| 1
| 0
| 0
|
2011-05-18T19:02:00.000
| 2
| 0
| false
| 6,049,741
| 1
| 0
| 0
| 1
|
I am planning a Python script that'll use os.fork() to create a bunch of child processes to perform some computations. The parent process will block until the children terminate.
The twist is that I need to be able to run the script both from the Unix shell using python and from ipython using %run.
In what manner should the child processes terminate to avoid breaking back into the ipython command prompt? In my experience, sys.exit() won't do.
|
routing a only specific traffic through a vpn connection via python
| 6,058,965
| 0
| 4
| 2,644
| 0
|
python,vpn
|
Python itself can't be used to route traffic; though you can use it to execute system commands to change your routing table. If you're on Linux, you need to use the ip command from the iproute2 and iptables from netfilter to change the routing behavior of specific traffic.
| 0
| 1
| 1
| 0
|
2011-05-19T12:47:00.000
| 2
| 0
| false
| 6,058,818
| 0
| 0
| 0
| 2
|
Is there any method to connect to vpn through python and have that traffic of that application only route through the said VPN?
|
routing a only specific traffic through a vpn connection via python
| 41,357,041
| 0
| 4
| 2,644
| 0
|
python,vpn
|
Please, be more specific in your question. Generally, yes, it is possible.
If you use python 2.7 or newer, you can use source_address option for http connections (see reference for libraries you use) as tuple ('interface address', port).
If you use sockets in your app, use socket.bind(('interface address', port)) on created socket before socket.connect().
| 0
| 1
| 1
| 0
|
2011-05-19T12:47:00.000
| 2
| 0
| false
| 6,058,818
| 0
| 0
| 0
| 2
|
Is there any method to connect to vpn through python and have that traffic of that application only route through the said VPN?
|
Quick Sending of 4[GB] To Be Processed From 100 Machines?
| 6,062,779
| 1
| 10
| 423
| 0
|
python,nosql,distributed-computing
|
Can you write your code using a Python binding to MPI? MPI has facility for over the wire data transmission from M nodes to N nodes, M,N>=1.
Also, as mentioned above you could write the data to 100 files on a shared filesystem, then read the files on the 'master' node.
| 0
| 1
| 0
| 0
|
2011-05-19T17:19:00.000
| 5
| 0.039979
| false
| 6,062,396
| 0
| 0
| 0
| 4
|
I have 100 servers in my cluster.
At time 17:35:00, all 100 servers are provided with data (of size 1[MB]). Each server processes the data, and produces an output of about 40[MB]. The processing time for each server is 5[sec].
At time 17:35:05 (5[sec] later), there's a need for a central machine to read all the output from all 100 servers (remember, the total size of data is: 100 [machines] x 40 [MB] ~ 4[GB]), aggregate it, and produce an output.
It is of high importance that the entire process of gathering the 4[GB] data from all 100 servers takes as little time as possible. How do I go about solving this problem?
Are there any existing tools (ideally, in python, but would consider other solutions) that can help?
|
Quick Sending of 4[GB] To Be Processed From 100 Machines?
| 6,063,128
| 2
| 10
| 423
| 0
|
python,nosql,distributed-computing
|
What's your networking setup ? If your central machine is connected to the cluster by a single gigabit link, it's going to take you at least ~30s to copy the 4GByte to it (and that's assuming 100% efficiency and about 8s per gigabyte, which I've never seen).
| 0
| 1
| 0
| 0
|
2011-05-19T17:19:00.000
| 5
| 0.07983
| false
| 6,062,396
| 0
| 0
| 0
| 4
|
I have 100 servers in my cluster.
At time 17:35:00, all 100 servers are provided with data (of size 1[MB]). Each server processes the data, and produces an output of about 40[MB]. The processing time for each server is 5[sec].
At time 17:35:05 (5[sec] later), there's a need for a central machine to read all the output from all 100 servers (remember, the total size of data is: 100 [machines] x 40 [MB] ~ 4[GB]), aggregate it, and produce an output.
It is of high importance that the entire process of gathering the 4[GB] data from all 100 servers takes as little time as possible. How do I go about solving this problem?
Are there any existing tools (ideally, in python, but would consider other solutions) that can help?
|
Quick Sending of 4[GB] To Be Processed From 100 Machines?
| 6,064,685
| 5
| 10
| 423
| 0
|
python,nosql,distributed-computing
|
Look at the flow of data in your application, and then look at the data rates that your (I assume shared) disk system provides and the rate your GigE interconnect provides, and the topology of your cluster. Which of these is a bottleneck?
GigE provides theoretical maximum 125 MB/s transmission rate between nodes - thus 4GB will take ~30s to move 100 40MB chunks of data into your central node from the 100 processing nodes over GigE.
A file system shared between all your nodes provides an alternative to over-Ethernet RAM to RAM data transfer.
If your shared file system is fast at the disk read/write level (say: a bunch of many-disk RAID 0 or RAID 10 arrays aggregated into a Lustre F/S or some such) and it uses 20Gb/s or 40 Gb/s interconnect btwn block storage and nodes, then 100 nodes each writing a 40MB file to disk and the central node reading those 100 files may be faster than transferring the 100 40 MB chunks over the GigE node to node interconnect.
But if your shared file system is a RAID 5 or 6 array exported to the nodes via NFS over GigE Ethernet, that will be slower than RAM to RAM transfer via GigE using RPC or MPI because you have to write and read the disks over GigE anyway.
So, there have been some good answers and discussion or your question. But we do (did) not know your node interconnect speed, and we do not know how your disk is set up (shared disk, or one disk per node), or whether shared disk has it's own interconnect and what speed that is.
Node interconnect speed is now known. It is no longer a free variable.
Disk set up (shared/not-shared) is unknown, thus a free variable.
Disk interconnect (assuming shared disk) is unknown, thus another free variable.
How much RAM does your central node have is unknown (can it hold 4GB data in RAM?) thus is a free variable.
If everything including shared disk uses the same GigE interconnect then it is safe to say that 100 nodes each writing a 40MB file to disk and then the central node reading 100 40MB files from disk is the slowest way to go. Unless your central node cannot allocate 4GB RAM without swapping, in which case things probably get complicated.
If your shared disk is high performance it may be the case that it is faster for 100 nodes to each write a 40MB file, and for the central node to read 100 40MB files.
| 0
| 1
| 0
| 0
|
2011-05-19T17:19:00.000
| 5
| 1.2
| true
| 6,062,396
| 0
| 0
| 0
| 4
|
I have 100 servers in my cluster.
At time 17:35:00, all 100 servers are provided with data (of size 1[MB]). Each server processes the data, and produces an output of about 40[MB]. The processing time for each server is 5[sec].
At time 17:35:05 (5[sec] later), there's a need for a central machine to read all the output from all 100 servers (remember, the total size of data is: 100 [machines] x 40 [MB] ~ 4[GB]), aggregate it, and produce an output.
It is of high importance that the entire process of gathering the 4[GB] data from all 100 servers takes as little time as possible. How do I go about solving this problem?
Are there any existing tools (ideally, in python, but would consider other solutions) that can help?
|
Quick Sending of 4[GB] To Be Processed From 100 Machines?
| 6,087,129
| 2
| 10
| 423
| 0
|
python,nosql,distributed-computing
|
Experiment!
Other answers have included tips on what to experiment with, but you might solve the problem the most straight-forward way and use that as your baseline.
You have 1meg producing 40meg of output on each server - experiment with each server compressing the data to be sent. (That compression might be free-ish if compression is part of your file system).
Latency - it is never zero.
Can you change your algorithms?
Can you do some sort of hierarchical merging of outputs rather than one CPU doing all 4Gigs at once? (Decimation in time).
It is possible to buy quad socket servers with 80 cores - would that be quicker as storage could be local, and you might configure the one machine with a lot of ram.
| 0
| 1
| 0
| 0
|
2011-05-19T17:19:00.000
| 5
| 0.07983
| false
| 6,062,396
| 0
| 0
| 0
| 4
|
I have 100 servers in my cluster.
At time 17:35:00, all 100 servers are provided with data (of size 1[MB]). Each server processes the data, and produces an output of about 40[MB]. The processing time for each server is 5[sec].
At time 17:35:05 (5[sec] later), there's a need for a central machine to read all the output from all 100 servers (remember, the total size of data is: 100 [machines] x 40 [MB] ~ 4[GB]), aggregate it, and produce an output.
It is of high importance that the entire process of gathering the 4[GB] data from all 100 servers takes as little time as possible. How do I go about solving this problem?
Are there any existing tools (ideally, in python, but would consider other solutions) that can help?
|
Google App Engine Versioning in the Datastore
| 6,063,370
| 7
| 15
| 1,749
| 0
|
python,google-app-engine,google-cloud-datastore
|
Datastore has no concept of versions.
When you update a model definition, any entities you create in the future will be of the new type, and the old ones will be of the old type. This frequently leads to runtime errors if your code is not aware of these changes.
| 0
| 1
| 0
| 0
|
2011-05-19T18:35:00.000
| 2
| 1
| false
| 6,063,286
| 0
| 0
| 1
| 1
|
Google App Engine has the concept of app versions. i.e., you can have multiple versions of your app running concurrently and accessible at different subdomains. For instance: http://1.my-app-name.appspot.com, http://2.my-app-name.appspot.com.
What aspects of the app are actually "versioned" by this? Is it only the Python + Static files codebase? Does the datastore have the concept of "versions"? If not, then what happens when I update the definition of a Google App Engine model?
Thanks!
|
redirecting system call output in python
| 6,074,155
| 0
| 0
| 624
| 0
|
python,redirect,pipe,system-calls
|
Python as build-in functionality like os.listdir() or os.walk() for listing stuff
on the filesystem. Running 'ls' yourself is very bad-style. In general look at the documentation of the subprocess module giving you all flexibility for interacting with external commands.
| 0
| 1
| 0
| 0
|
2011-05-20T15:20:00.000
| 2
| 0
| false
| 6,074,034
| 1
| 0
| 0
| 1
|
I wish to execute os.system('ls') in python. the return value of this statement is an error code integer..but I want to get the contents of the present directory as a string. How to accomplish this?
|
Compiling Python 2.6.6 and need for external packages wxPython, setuptools, etc... in Ubuntu
| 6,079,512
| -1
| 2
| 2,035
| 0
|
python,ipython,ld,rpath,tcmalloc
|
If you compiled 2.6.6 and installed 2.6.5 from the repos, then ubuntu is having a conflict in finding what python you're using.
I'm flagging this to move to Superuser.
| 0
| 1
| 0
| 0
|
2011-05-21T01:57:00.000
| 3
| -0.066568
| false
| 6,079,128
| 1
| 0
| 0
| 1
|
I compiled Python 2.6.6 with google-perf tools (tcmalloc) library to eliminate some of the memory issues I was having with the default 2.6.5. After getting 2.6.6 going it seems to not work becuase I think having issues with the default 2.6.5 install in Ubuntu. Will none of the binaries installed from the software channel like wxPython and setuptools work properly with 2.6.6. Do these need to be recompiled? Any other suggestions to get it working smoothly. Can I still set 2.6.5 as default without changing the Path? The path looks in usr/local/bin first.
|
How to get the size of tar.gz in (MB) file in python
| 6,080,484
| 2
| 13
| 28,504
| 0
|
python,linux,file-io
|
Use the os.stat() function to get a stat structure. The st_size attribute of that is the size of the file in bytes.
| 0
| 1
| 0
| 1
|
2011-05-21T08:10:00.000
| 5
| 0.07983
| false
| 6,080,477
| 1
| 0
| 0
| 1
|
I am doing backups in python script but i need to get the size of tar.gz file created in MB
How can i get the size in MB of that file
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.