Python xmpp module compatible with osx - python

Hi I'm trying to run GCM sample fromhttp://developer.android.com/google/gcm/ccs.html on osx but i'm unable to install xmpp library. On Linux installation apt-get install python-xmpp resolved case. For osx I couldn't find anything

There is another repository called ActiveState PyPM
Try to download it from here:
http://www.activestate.com/activepython/downloads
install it, and after, write on a cmd line:
pypm install xmpppy
That worked for me

Related

Where does pip install its modules? What if using a virtualenv? Also getting an error setting up mod_wsgi

I am new to Python and there are some things which I am not able to apprehend. Questions may seem like very kiddish, so bear with me.
As you know, Ubuntu comes with an outdated Python version. I wished to use the latest python. But since it is recommended not to override the system's python, I installed virtualenv.
I installed pip first, using sudo apt-get install python-pip.
Then installed virtualenv, using sudo pip install virtualenv, and did all the configurations required to link it to the latest python.
The questions which I want to ask are-
Where does the command pip install <module> store the module in the system? I am asking this question because there is a section in this link, which says "Installation into Python". I was confused by this, thinking whether installing a python module is sensitive to which python version I am using. If it is so, then where does pip install the module if I am using virtualenv and otherwise.
I have manually installed Apache HTTP Server 2.4.23 using this link. While installing mod_wsgi using command sudo pip install mod_wsgi, I am getting this error
RuntimeError: The 'apxs' command appears not to be installed or is not
executable. Please check the list of prerequisites in the
documentation for this package and install any missing Apache httpd
server packages.
I searched for it and the solution is to install developer package of Apache. But the problem is that I am not able to find it anywhere on it's site. I want to install it manually. What to do? Also, If I install it through sudo apt-get install apache2-dev, Will there be any difference ?
Note: As mentioned on this link, I have already set the value of APXS environment variable to the location of apxs script, which is /usr/local/apache/bin/apxs.
Concerning 1., if I have well understood, you would like to have the last 2.7 or 3.5 Python version on your distribution. Actually, you can have multiple python distribution on your distribution. I would suggest you to have a look on conda/anaconda (https://www.continuum.io/downloads) : it is very powerful and i think it would better suit you than virtualenv: virtualenv would enable you to create a separate python environnement, but it would not install a newer version of Python.
Concerning 2, I am not an expert in Apache2, but I would have used apt-get instead of re-compiling apache. While compiling, you may need some dependancies to build the mod_wsgi module. So I think it is way more easy to use the pre-built packages from your ubuntu.

Running Python Script with lynx command in Terminal

I just installed emacs and python on my Mac and I'm trying to learn how to run my Python Scripts through my terminal and I'm getting an error message
"sh: lynx: command not found". From what I have researched it sounds like i need to install lynx on my mac but I do not know how to get it installed so if that is the issue how do I install lynx on a macbook? I will include screenshots of the issues I'm having. Thanks very much!
python scriptTerminal
You should already have Python on your mac. My Macbook Air came with python 2.x on El Capitan OSX. When you open up the Terminal and type in "python" without any quotations does the python interpreter come up? From the look of your image, there is something wrong inside the file you are trying to run with python.
As far as I know, Lynx is a Web Browser, are you trying to do something with Lynx inside that python file? If you happen to have brew on your mac you can try brew install lynx to install lynx onto the mac.
From the script, I think you are trying to get the source code from the link you are trying to open with lynx. Try this method instead if that is what you are doing.
Code:
from urllib.request import urlopen
html = urlopen("http://www.careercast.com/jobs-rated/2016-ranking-200-jobs")
with open("lang.txt",'w') as output:
output.write(html.read())
You can use pip to install urllib.request. If you do not have pip, it is very helpful when installing python packages, or you can use easy_install. Run this in the terminal if you already have pip installed. Otherwise follow this to install it.
pip install urllib.request
You might see the above error if Lynx package is not installed on your server. Follow the below steps to install lynx on your Linux Server
Login to your Linux Server via SSH as root. Run yum install lynx to install lynx package

Installing txMYSQL on Python

I am trying to establish MYSQL connection with my twisted server script. I found out that txMYSQL is a good choice to use, I dowloaded the package out of Github and tried installing from the setup.py file, but it didn't work.
I tried inslalling txMYSQL by using easy_install txmysql but it dosen't appear to be found through this command since its not on pythons server.
How can I install txMYSQL ?
I am currently using python 2.7.8 on my Windows machine.
Try to install using pip and referencing Github repo. I tried here and worked well on a Ubuntu 12.04.4
pip install git+https://github.com/hybridlogic/txMySQL.git

How to upgrade easy_install to easy_install-3.4?

I just upgraded python to version 3.4. However, the pip wasn't installed by default for some reason. So I'm trying to install pip using the command "sudo easy_install pip." But when I typed the command, it gives me an error:
python version 3.4.0 can't run /usr/bin/easy_install. Try the alternative(s):
/usr/bin/easy_install-2.5 (uses python 2.5)
/usr/bin/easy_install-2.6 (uses python 2.6)
/usr/bin/easy_install-2.7 (uses python 2.7)
Run "man python" for more information about multiple version support in
Mac OS X.
So, I looked through online to find out how to update easy_install to version 3.4, but I could not find any source. Does anyone know how to update the version of easy_install?
To cut to the problem of pip, you can just use the get-pip.py script from the pip site.
Download the file: https://raw.github.com/pypa/pip/master/contrib/get-pip.py
And then run python get-pip.py, provided your account has administrator access.
Source: http://pip.readthedocs.org/en/latest/installing.html#install-or-upgrade-pip
I know this question is a bit old, but I just upgraded to python 3.4.2 on my Mac and running 'pip install ' wasn't working for me either.
I found this link: https://www.python.org/dev/peps/pep-0439/
which says to use 'pip3' instead of 'pip' and this worked perfectly for me.

IDLE can't import Tkinter. Your Python may not be configured for Tk

I am running Ubuntu 10.10, and I installed Python 3.2 today. The system is already running Python 2.6.
I typed idle3.2 in the terminal and it gave me:
IDLE can't import Tkinter. Your Python may not be configured for Tk.
So I searched on Stack Overflow (and in some other places) for a solution, I installed python-tk, I rechecked that I have tclsh on the system, but I still can't manage to open idle3.2.
Any input would be appreciated.
On OSX, this can be resolved with macports by installing the python tkinter package for your python version. In my case, with python 2.7, I ran on the terminal:
sudo port install py27-tkinter
change the "27" to your python version number.
On Ubuntu:
sudo apt-get install idle
Choose one from
idle
idle3
idle-python2.6
idle-python2.7
idle-python3.1
idle-python3.2
for your python version.
The problem is caused by the version between python and idle not matching.
U can check your python version by typing : python
Then sudo aptget install the right idle version same with your python version
I ran into the same error message when installing python3.4 on Fedora 20. The problem was that tk-devel was not installed during the python configure/make. The explicit steps to do this correctly are
download and extract python3.4 from python.org https://www.python.org/downloads/
Find and install the right tkinter and tk-devel:
yum search tkinter
yum install python3-tkinter-3.3.2-17.fc20.x86_64
yum search tk-devel
yum install tk-devel.x86_64
AFTER these are onboard, cd into the python3.4 package directory and run the configure; make, make install process.
I spent too much time resolving this issue. Hopefully this post will help may others to a quick resolution.
PS stackoverflow is awesome. If google brought you to this article, spend some time and surf around the site.
If you installed python-tk and the system is running python 2.6 then it is most likely that you installed Tkinter for python 2.6. Try installing python3-tk.
you need to install tk or tk-dev packages for ubuntu.
On my arch linux system I had the same problem easily solved by typing
yaourt tkinter
and installing the first package community/python-pmw 2.0.1-2 [installed]
Type "idle-python2.6" in the terminal..it worked for me

Categories

Resources