I think what's going on is:
1. easy_install is finding that egg at pypi.python.org is out of date
(v2.0.3) as
compared to the main download page (v2.3.0) and chooses the most current
version.
2. easy_install doesn't exhaustively search the protobuf-2.3.0.zip file and
so is not
finding the setup.py file residing in the python subfolder.
I think the simplest fix is would be to keep pypi up to date with each new
release.
Alternatively, maybe you could move setup.py to reside in the top level?
Could you try the following from protobuf-2.3.0/python:
python setup.py bdist_egg upload
This will update egg at PyPi with a current version. Note that users who use
easy_install to get the egg will only get the python files, and won't get
protoc. In
my case, I want easy_install to grab protobuf as a dependency and thus
don't need it
to install protoc anyways. I think it's possible to change setup.py so that
the egg
will include protoc (and any other files desired) but they'll reside in the
egg.
--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
> Could you try the following from protobuf-2.3.0/python:
> python setup.py bdist_egg upload
Done. Did it work? How do I test it?
> I think it's possible to change setup.py so that the egg
> will include protoc (and any other files desired) but they'll reside in
> the egg.
I doubt it, considering that protoc is a native binary, and I don't want to
maintain
a setuptools-based build system for protoc parallel to the existing
autotool-based
one.
> Done. Did it work? How do I test it?
Yes, it worked for Python 2.5 (which is the version you're using,
presumably). It
didn't work for other versions of Python, however. Looking at the setuptools
documentation, I don't see that there's any way to "cross-compile" an egg
for
different versions of python. I assume you have no interest in maintaining
multiple
versions of python just for the purpose of building eggs, so could we try
the
following:
From protobuf-2.3.0/python:
setup.py sdist bdist_egg upload
That should upload both an egg for whatever python version you're using,
and a copy
of the python source. Presumably, easy_install will still prefer a source
dist on
PyPi over downloading the whole project from the google code page.
Regarding testing, I would use virtualenv:
http://pypi.python.org/pypi/virtualenv
It creates an isolated python environment which has setuptools preinstalled.
Done. It gave me an error because the bdist was already uploaded but I'm
guessing
that doesn't matter. It looks like the source dist is now listed on
pypi.python.org.
Let me know if that solves the problem.
Yes, I am stuck with Python 2.5. We run a really old (but really stable)
Linux distro
here. :/
> Let me know if that solves the problem.
No luck -- it's still favoring the googlecode download over the PyPi source
dist.
So... we could be a bit more specific in the setup.py file about where to
get the
project.
Adding following to setup.py at around line 121 might do the trick:
download_url = 'http://pypi.python.org/pypi/protobuf',
Comment #16 on issue 66 by ken...@google.com: cannot install using
easy_install
http://code.google.com/p/protobuf/issues/detail?id=66
Unfortunately I don't think PyPi will let me upload another copy unless I
bump the
version number... :/
Comment #17 on issue 66 by ken...@google.com: cannot install using
easy_install
http://code.google.com/p/protobuf/issues/detail?id=66
I have no idea how that label got added to my previous comment.
Alright. What's the schedule for the next release? If there is one, that
is. =)
There's not a schedule. I'd imagine/hope it would happen within the next
couple
months, but can't guarantee anything.
I wish there were a way to test this without bumping the version number for
each
attempt.
you could release a 2.3.1 specifically to fix this issue - I've had to add
a 2.5 and
a 2.6 egg to our svn tree to prevent buildout from fetching the (wrong)
zipfile when
using python2.6
Our python2.6 installation on windows lives in W:\Python\Python26 and I was
able to
install the egg into
W:\Python\Python26\Lib\site-packages\protobuf-2.3.0-py2.6.egg by
following the following procedure:
- download protobuf-2.3.0 on to a filesystem that is visible from Windows
via a
mapped drive
- run the install on linux, this will among other things generate
descriptor_pb2.py
out of descriptor.proto using protoc installed on linux
- on windows cd to protobuf-2.3.0/python directory under the mapped drive
- W:\Python\Python26\python.exe setup.py install
I haven't tested this much further but at least I can successfully do:
W:\Python\Python26\python.exe
>>> from google.protobuf import descriptor_pb2
so I think there is a good chance it's a working installation.
Running `python -m easy_install protobuf` yields the following error:
Downloading http://protobuf.googlecode.com/files/protobuf-2.3.0.zip
Processing protobuf-2.3.0.zip
error: Couldn't find a setup script in
c:\temp\easy_install-fcgk7g\protobuf-2.3.0.zip
Running `python -m easy_install
http://pypi.python.org/packages/source/p/protobuf/protobuf-2.3.0.tar.gz`
stops with:
File "setup.py", line 7, in <module>
try:
ImportError: No module named ez_setup
This one is strange, because I have setuptools installed. The patch at
http://codereview.appspot.com/1692047 the latter issue, but the
installation still fails with::
Can't find required file: ../src/google/protobuf/descriptor.proto
It seems like this issue can be fixed by including required file on `sdist`
building phase inside `protobuf` checkout, and by altering meta-information
so that easy_install will prefer PyPI package version or will not search
Google Code site at all.
Confirm same issue with techtonik but I want to add more:
1) Initially I was suspecting this was virtualenv's fault but this happens
with and without a virtualenv.
2) Techtonik's patch makes sense but also the whole point of ez_setup.py is
that it's meant to be embedded into applications to bootstrap easy_install
and then get whatever dependencies you need. If you don't include the
bootstrap script, how do you expect it to magically get dependencies? :)
3) Previously I hadn't noticed this because I'd gotten the distro
python-protobuf package here:
https://launchpad.net/ubuntu/+source/protobuf
Maybe they've fixed it?
Might it have something to do with this line failing? :
generate_proto("../src/google/protobuf/descriptor.proto")
This is a diff to make protobuf more compatible with easy_install/pip and
recent version of setuptools/distribute. It's remove `ez_setup` dependency
and don't fail if `descriptor_pb2.py` exists but `descriptor.proto` isn't
found.
Attachments:
66-cannot-install-using-easy-install.diff 11.1 KB
Thanks, will look into this when doing the next release (which should be
soon).
I do also suffer from this issue, and it forces me to move out protobuf
from my pip requirements.txt, and store it in my code base :( not nice
Timothee Peignier's patch is very helpful. It extended his work with the
attached patch to cover one more remaining issue.
The 'clean' step was always removing generated *_pb2.py files. My patch
changes that behavior to only remove a *_pb2.py file in the 'clean' step if
we can locate the original source .proto file from which to regenerate it.
The previous behavior was causing problems with source distributions
('sdist' packages). If a 'clean' operation was ever run over them, we'd
lose the generated _pb2.py files forever because we no longer have access
to the original protobuf distribution with it's ../src directory full
of .proto files.
The specific motivation for this change was to allow pip's 'bundle' command
to work with the protobuf Python package.
Attachments:
protobuf-clean.patch 1.4 KB
I'd also like to see this fixed. I played around and found that with the
following file in the base of the tarball everything (at least with our
buildout) works fine.
Basically it creates a setup.py that chdirs to the subdirectory and repeats
the command. With this buildout had no problem installing it.
file: protobuf-2.4.0a/setup.py
--- cut ---
import os
import sys
import subprocess
os.chdir( os.path.join(os.path.dirname(sys.argv[0]),'python') )
subprocess.call(['python', 'setup.py'] + sys.argv[1:])
Is this the same issue?
sudo easy_install protobuf
Searching for protobuf
Reading http://pypi.python.org/simple/protobuf/
Reading http://code.google.com/p/protobuf/
Best match: protobuf 2.4.0a
Downloading http://protobuf.googlecode.com/files/protobuf-2.4.0a.zip
Processing protobuf-2.4.0a.zip
error: Couldn't find a setup script in
/tmp/easy_install-nFagtb/protobuf-2.4.0a.zip
Fedora 12, python 2.4.
No, that appears to be a separate problem with protobuf-2.4.0a. For some
reason, PyPI is returning the full distribution archive instead of just the
protobuf Python package. It doesn't look like a 2.4.0a sdist package was
upload to PyPI, which might explain the problem.
@jparise: PyPI returns link to home page. It is easy_install "intelligence"
that scans the page and finds "updated" distribution on protobuf home page.
A quick hack is to remove "home page" from setup.py meta information and
add link to home page to description (along with documentation link).
I adapted protobuf-2.4.1 to a format that pip and easy_install can parse.
Since I can't upload it to PyPI, I put it in a GitHub repository:
http://github.com/rem/python-protobuf
Install it like so:
pip
install "git+http://github.com/rem/python-pr...@v2.4.1#egg=protobuf"
(or add that URL to your requirements.txt)
I basically edited setup.py to not remove generated *_pb2.py, and generated
those files with:
protoc --python_out=.
-I ../protobuf-2.4.1/src/ ../protobuf-2.4.1/src/google/protobuf/descriptor.proto
... and similarly for google/protobuf/compiler/plugin.proto
Are you sure you cannot remove a file hosted on PyPI and reupload it?
I you do not know how to properly define setup.py and to deploy a package
to PyPI please take a look at https://github.com/ssbarnea/tendo -
release.sh and setup.py should be simple enough to explain what you have to
do. When you have the new release ready, just run release.sh
You can't replace file on pypi if you're not the original author, unless
original author give you permission.
Unless you change the package name ...
Apparently this issue still exists? Why is there no ownership on this
ticket?
I'm not sure if this is a perfect solution but it seems to work.
It appears as though the first pass through setup.py finds the file
(descriptor.proto) in the specified location. However, when the build task
is launched it's running
in "protobuf-2.4.1/python/build/bdist.linux-x86_64/rpm/BUILD/protobuf-2.4.1".
In this case, "../src/google/protobuf/descriptor.proto" does not exist.
Here's how I handled it.
if os.path.exists('../src/google/protobuf/descriptor.proto'):
generate_proto("../src/google/protobuf/descriptor.proto")
generate_proto("../src/google/protobuf/compiler/plugin.proto")
else:
generate_proto("../../../../../../src/google/protobuf/descriptor.proto")
generate_proto("../../../../../../src/google/protobuf/compiler/plugin.proto")
Is anything being done on this ticket?
No updates on this?
Three years and no fix to such a simple problem? Sad google.
Comment #44 on issue 66 by rem...@google.com: cannot install using
easy_install
http://code.google.com/p/protobuf/issues/detail?id=66
I fixed setup.py and uploaded v2.4.1 to PyPI. It should work fine now --
tested with pip and easy_install with virtualenvs and direct installs;
please let me know if you face any issues.
Changed setup.py to try and import setuptools directly, falling back to
ez_setup (for those installing directly from the protobuf source tarball),
and listed setuptools as a requirement. The PyPI package has the modified
setup.py, which will be integrated back into SVN soon and bundled by the
next release.
Issue 311 has been merged into this issue.
Confirmed working with pip on Mac OS X 10.7 with virtualenv.
Just curious, is the issue mentioned here:
https://github.com/cloudControl/PyDoozerLib/blob/master/README.md related
to this issue? Or is it a new one?
> Installation error with protobuf 2.4.1
> There is a case when you try to install pydoozerlib via python setup.py
> install and run into following error:
> [..]
> Downloading http://protobuf.googlecode.com/files/protobuf-2.4.1.zip
> Processing protobuf-2.4.1.zip
> error: Couldn't find a setup script in
> /tmp/easy_install-riZxUs/protobuf-2.4.1.zip
> Simply install protobuf via pip manually:
> $ pip install protobuf
> Then run python setup.py install again!
Assuming you are referring to this section, yes, the fix for this issue
should address it.
Comment #10 on issue 66 by danhomerick: cannot install using easy_install
http://code.google.com/p/protobuf/issues/detail?id=66I think what's going on is:
1. easy_install is finding that egg at pypi.python.org is out of date
(v2.0.3) as
compared to the main download page (v2.3.0) and chooses the most current
version.
2. easy_install doesn't exhaustively search the protobuf-2.3.0.zip file and
so is not
finding the setup.py file residing in the python subfolder.I think the simplest fix is would be to keep pypi up to date with each new
release.
Alternatively, maybe you could move setup.py to reside in the top level?Could you try the following from protobuf-2.3.0/python:
python setup.py bdist_egg uploadThis will update egg at PyPi with a current version. Note that users who use
easy_install to get the egg will only get the python files, and won't get
protoc. In
my case, I want easy_install to grab protobuf as a dependency and thus
don't need it
to install protoc anyways. I think it's possible to change setup.py so that
the egg
will include protoc (and any other files desired) but they'll reside in the
egg.--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings