Re: OS independent way to check if a python app is running?

2009-12-27 Thread srid
On Dec 14, 12:35 pm, MRAB  wrote:
> [email protected] wrote:
> > Is there an os independent way to check if a python app is running?
>
> > Goal: I have a server program based on cherrypy that I only want to have
> > running once. If a system administrator accidentally attempts to run
> > this program more than once, I would like the 2nd instance of the
> > program to detect that its already running and exit.
>
> You could use lockfile:http://pypi.python.org/pypi/lockfile/0.7
>
> If a certain file exists and is locked, then the app is already running.

How is this different from the zc.lockfile package?
http://pypi.python.org/pypi/zc.lockfile/

-srid
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: ActivePython 3.1.1.2 vs Python 3.1.1 for OSX?

2009-09-30 Thread srid
On Sep 30, 4:51 pm, Robert Hicks  wrote:
> I am just curious which I should use. I am going to start learning
> Python soon. Are they comparable and I just do a "eenie meenie minie
> moe"?

ActivePython is essentially same as the installers from python.org -
but it also comes with additional documentation and tutorials, such
as:

Python FAQs
A snapshot of the Python Enhancement Proposals (PEPs) (For the most
recent version, refer to the PEPs on python.org .)
Dive Into Python (A tutorial for programmers)
Non-Programmers Tutorial For Python

http://docs.activestate.com/activepython/3.1/whatsincluded.html

Also note that 2.6.x is probably the best bet if you are going to use
some 3rd party libraries (after you learn the basics of Python) ..
because 3.x does not have many of those libraries ported yet.

  http://www.activestate.com/activepython/

Further, early next week - a new release of ActivePython-2.6 will be
made available that will include, for the first time, a new Python
package manager (PyPM) from ActiveState that makes it easier to
install packages from pypi.python.org (without having to compile them
yourself). This is similar to PPM from ActivePerl.

-srid
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: ActivePython 3.1.1.2 vs Python 3.1.1 for OSX?

2009-10-07 Thread srid
PyPM is now released!

  
http://groups.google.com/group/comp.lang.python/browse_thread/thread/e9efdedf264a3b8a

On Oct 1, 4:42 am, flebber  wrote:
> On Oct 1, 11:28 am, srid  wrote:
>
>
>
>
>
> > On Sep 30, 4:51 pm, Robert Hicks  wrote:
>
> > > I am just curious which I should use. I am going to start learning
> > > Python soon. Are they comparable and I just do a "eenie meenie minie
> > > moe"?
>
> > ActivePython is essentially same as the installers from python.org -
> > but it also comes with additional documentation and tutorials, such
> > as:
>
> > Python FAQs
> > A snapshot of the Python Enhancement Proposals (PEPs) (For the most
> > recent version, refer to the PEPs on python.org .)
> > Dive Into Python (A tutorial for programmers)
> > Non-Programmers Tutorial For Python
>
> >http://docs.activestate.com/activepython/3.1/whatsincluded.html
>
> > Also note that 2.6.x is probably the best bet if you are going to use
> > some 3rd party libraries (after you learn the basics of Python) ..
> > because 3.x does not have many of those libraries ported yet.
>
> >  http://www.activestate.com/activepython/
>
> > Further, early next week - a new release of ActivePython-2.6 will be
> > made available that will include, for the first time, a new Python
> > package manager (PyPM) from ActiveState that makes it easier to
> > install packages from pypi.python.org(without having to compile them
> > yourself). This is similar to PPM from ActivePerl.
>
> > -srid
>
> Thats awesome news.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: ANN: ActivePython 2.6.3.7 (and PyPM) is now available

2009-10-16 Thread srid
On Oct 16, 3:30 pm, denis  wrote:
> On Oct 7, 2:16 am, "Sridhar Ratnakumar" 
> wrote:
>
> > ...
> > This release includes a new packaging tool by activestate called Python
> > Package Manager (PyPM).PyPM- currently in beta - is the package
>
> Sridhar, folks,
>   the ActivePython FAQ says
> "While you can install most packages registered in PyPI using the PyPM
> client, some packages may not yet be available in the ActiveState
> repository"
>
> Does that mean that PyPM installs ONLY from the activestate repository
> and not from url or .tar.gz or dir/ ?

This is correct. Although it may change in the future. Note that
almost all the packages are available in the activestate repository
(see pypm.activestate.com). Some packages are not in the repository
due to build or metadata issues .. that will be slowly patched on our
side (if the package is popular) or the package authors can fix it
themselves.

As for installing from a URL, you may use easy_install (included in
ActivePython). For .tar.gz and dir/, run 'python setup.py install'
manually.

HTH.

-srid

PS: You can pass -vv option to see the actual URL of the package being
downloaded. Eg: "pypm -vv install lxml"

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: installing lxml ?

2009-11-11 Thread srid
Much of these non-trivial build steps are abstracted in the
ActiveState build repository.

1. Download ActivePython: http://www.activestate.com/activepython/
2. Run "pypm install lxml" (on Mac, Linux or Windows)

$ pypm install lxml
Ready to perform these actions:
The following packages will be installed:
 lxml-2.2.2
Get: [pypm.activestate.com] lxml 2.2.2-2
Installing lxml-2.2.2
$ python -c "import lxml; print lxml.__file__"
/Users/sridharr/.local/lib/python2.6/site-packages/lxml/__init__.py
$

-srid


On Nov 11, 4:49 am, 7stud  wrote:
> I'm trying to installlxml, but I can't figure out the installation
> instructions.  Here:
>
> http://codespeak.net/lxml/installation.html
>
> it says:
>
> 1) Get the easy_install tool.
>
> Ok, I went to the easy_install website, downloaded, and installed it.
> The last two lines of the output during installation said this:
>
> Installingeasy_install script to /Library/Frameworks/Python.framework/
> Versions/2.6/binInstallingeasy_install-2.6 script to /Library/Frameworks/
> Python.framework/Versions/2.6/bin
>
> 2) ...run the following as super-user (or administrator):
>
> easy_installlxml
>
> On MS Windows, the above will install the binary builds that we
> provide. If there is no binary build of the latest release yet, please
> search PyPI for the last release that has them and pass that version
> to easy_install like this:
> easy_installlxml==2.2.2
>
> On Linux (and most other well-behaved operating systems), easy_install
> will manage to build the source distribution as long as libxml2 and
> libxslt are properly installed, including development packages, i.e.
> header files, etc. Use your package management tool to look for
> packages like libxml2-dev or libxslt-devel if the build fails, and
> make sure they are installed.
>
> On MacOS-X, use the following to build the source distribution, and
> make sure you have a working Internet connection, as this will
> download libxml2 and libxslt in order to build them:
> STATIC_DEPS=true easy_installlxml
>
> ---
>
> My os is mac os x 10.4.11.   But this:
>
> STATIC_DEPS=true easy_installlxml
>
> is not a valid command:
>
> $ sudo STATIC_DEPS=true easy_installlxml
> Password:
> sudo: STATIC_DEPS=true: command not found
>
> In any case, if I do this:
>
> $ sudo easy_installlxml
> sudo: easy_install: command not found
>
> In other words, when I installed easy_install it did not add anything
> to my PATH which points to the installation directory mentioned during
> installation:
>
> Installingeasy_install script to /Library/Frameworks/Python.framework/
> Versions/2.6/bin
>
> Ok, so I need to use the full path to the easy_install program (which
> is not mentioned ANYWHERE in the installation instructions), i.e.
>
> /Library/Frameworks/Python.framework/Versions/2.6/bin/easy_install
>
> ...but this still isn't going to work:
>
> $ sudo STATIC_DEPS=true /Library/Frameworks/Python.framework/Versions/
> 2.6/bin/easy_installlxml
> Password:
> sudo: STATIC_DEPS=true: command not found
>
> So what the heck is going on??
>
> Attention developers: you may be one of the best programmers in the
> world, but if you can't convey how to use your software to the average
> user, then you are the equivalent of one of the worst programmers on
> the planet.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: installing lxml ?

2009-11-11 Thread srid
On Nov 11, 6:54 am, 7stud  wrote:
>
> Unfortunately, easy_install was not able to installlxml!  Here is the
> output:
>
> ---
> $ sudo STATIC_DEPS=true /Library/Frameworks/Python.framework/Versions/
> 2.6/bin/easy_installlxml
> Password:
> sudo: STATIC_DEPS=true: command not found
> $ STATIC_DEPS=true sudo /Library/Frameworks/Python.framework/Versions/
> 2.6/bin/easy_installlxml
> Password:
> Searching forlxml
> Readinghttp://pypi.python.org/simple/lxml/
> Readinghttp://codespeak.net/lxml
> Best match:lxml2.2.3
> Downloadinghttp://codespeak.net/lxml/lxml-2.2.3.tgz
> Processinglxml-2.2.3.tgz
> Runninglxml-2.2.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-
> r2obQa/lxml-2.2.3/egg-dist-tmp-7v5A1n
> Buildinglxmlversion 2.2.3.
> Traceback (most recent call last):
>   File "/Library/Frameworks/Python.framework/Versions/2.6/bin/
> easy_install", line 8, in 
>     load_entry_point('setuptools==0.6c11', 'console_scripts',
> 'easy_install')()
>   File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/
> easy_install.py", line 1712, in main
>   File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/
> easy_install.py", line 1700, in with_ei_usage
>   File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/
> easy_install.py", line 1716, in 
>   File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/distutils/core.py", line 152, in setup
>     dist.run_commands()
>   File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/distutils/dist.py", line 975, in run_commands
>     self.run_command(cmd)
>   File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/distutils/dist.py", line 995, in run_command
>     cmd_obj.run()
>   File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/
> easy_install.py", line 211, in run
>   File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/
> easy_install.py", line 446, in easy_install
>   File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/
> easy_install.py", line 476, in install_item
>   File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/
> easy_install.py", line 655, in install_eggs
>   File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/
> easy_install.py", line 930, in build_and_install
>   File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/
> easy_install.py", line 919, in run_setup
>   File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/
> sandbox.py", line 62, in run_setup
>   File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/
> sandbox.py", line 105, in run
>   File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/
> sandbox.py", line 64, in 
>   File "setup.py", line 119, in 
>
>   File "/tmp/easy_install-r2obQa/lxml-2.2.3/setupinfo.py", line 51, in
> ext_modules
> TypeError: build_libxml2xslt() got an unexpected keyword argument
> 'libiconv_version'

https://bugs.launchpad.net/lxml/+bug/480225

-srid

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: how to create a pip package

2009-11-11 Thread srid
On Nov 10, 8:25 pm, Phlip  wrote:
> On Nov 10, 3:11 pm, Wolodja Wentland 
> wrote:
>
> > The pip requirement file would contain the following line:
>
> > -e git+git://example.com/repo.git#egg=rep
>
> > I hope this answers your questions :-D
>
> Let me ask it like this. What happens when a user types..?
>
>    sudo pip install repo

Hey Phlip,

If you run "pip install repo", it will try to find a package in
http://pypi.python.org/ named "repo".

Run the following commands:

$ pip install pastescript
$ paster create myapp
$ cd myapp/
$ python setup.py sdist register upload

That's all you need to do .. to have your "myapp" project uploaded to
PyPI. From now onwards, anyone connected to the internet will be able
to run "pip install myapp" to get your package.

For more details, may I suggest you to read the official distutils
tutorial: http://wiki.python.org/moin/Distutils/Tutorial

-srid

PS: Another advantage of using distutils (or setuptools/distribute)
and uploading your package to PyPI is that you would automatically
enable other package managers (such as PyPM - http://pypm.activestate.com/
) to support your package.



-- 
http://mail.python.org/mailman/listinfo/python-list