Open j2l opened 12 years ago
Do you have your PYTHONPATH environment variable set to the pipe2py directory? In Linux this would be something like:
export PYTHONPATH=/home/mypath/pipe2py
But perhaps setenv
for Max OS X?
Thanks, I checked on http://docs.python.org/using/mac.html path seems to be ok with: export PYTHONPATH=$PYTHONPATH:/Applications/XAMPP/htdocs/pipeline/pipe2py
but no luck so far, I also tried on a pure linux box (my shared web server) and I have the same problem so I guess I missed something on both installs.
Ah - yes. the pipe2py directory with the __init__.py
is the package directory, so you'll want:
export PYTHONPATH=$PYTHONPATH:/Applications/XAMPP/htdocs/pipeline
Yeah, I did that too, no luck, it's stuck ... Any other idea?
On Sun, Nov 6, 2011 at 9:35 PM, Greg Gaughan < reply@reply.github.com>wrote:
Ah - yes. the pipe2py directory with the init.py is the package directory, so you'll want:
export PYTHONPATH=$PYTHONPATH:/Applications/XAMPP/htdocs/pipeline
Reply to this email directly or view it on GitHub: https://github.com/ggaughan/pipe2py/issues/14#issuecomment-2647519
What do you get when you
$ python
>>> import sys
>>> print sys.path
I get: ['', '/Library/Python/2.5/site-packages/feedparser-5.0.1-py2.5.egg', '/Library/Python/2.5/site-packages/simplejson-2.2.1-py2.5-macosx-10.5-i386.egg', '/Applications/XAMPP/xamppfiles/htdocs/pipeline/test/pipeline', '/Applications/XAMPP/htdocs/pipeline/pipe2py', '/Applications/XAMPP/htdocs/pipeline', '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python25.zip', '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5', '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/plat-darwin', '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/plat-mac/lib-scriptpackages', '/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python', '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload', '/Library/Python/2.5/site-packages', '/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/PyObjC']
On Mon, Nov 7, 2011 at 6:08 PM, Greg Gaughan < reply@reply.github.com>wrote:
What do you get when you
$ python
import sys print sys.path
Reply to this email directly or view it on GitHub: https://github.com/ggaughan/pipe2py/issues/14#issuecomment-2656214
Hmm. Well presumably one of those paths should have the package files in it. Though I wonder what the difference is between the contents of /Applications/XAMPP/xamppfiles/htdocs/pipeline/test/pipeline
and /Applications/XAMPP/htdocs/pipeline
.
I don't use a Mac, so I'm not sure if you need any extra steps. Perhaps Python doesn't have permission to read the package directory or files?
What happens if you try to access the package __init__.py
file from within Python:
$python
>>> open('/Applications/XAMPP/htdocs/pipeline/pipe2py/__init__.py').readlines()[:5]
open('/Applications/XAMPP/htdocs/pipeline/pipe2py/init.py').readlines()[:5] Traceback (most recent call last): File "
", line 1, in IOError: [Errno 2] No such file or directory: '/Applications/XAMPP/htdocs/pipeline/pipe2py/init.py' open('/Applications/XAMPP/htdocs/pipeline/init.py').readlines()[:5] ['#pipe2py package\n', '#Author: Greg Gaughan\n', '\n', '#See LICENCE file for licence details\n', '\n']
On Mon, Nov 7, 2011 at 8:54 PM, Greg Gaughan < reply@reply.github.com>wrote:
Hmm. Well presumably one of those paths should have the package files in it. Though I wonder what the difference is between the contents of
/Applications/XAMPP/xamppfiles/htdocs/pipeline/test/pipeline
and/Applications/XAMPP/htdocs/pipeline
.I don't use a Mac, so I'm not sure if you need any extra steps. Perhaps Python doesn't have permission to read the package directory or files?
What happens if you try to access the package
__init__.py
file from within Python:$python
open('/Applications/XAMPP/htdocs/pipeline/pipe2py/init.py').readlines()[:5]
Reply to this email directly or view it on GitHub: https://github.com/ggaughan/pipe2py/issues/14#issuecomment-2658661
So the files seem to be there but they need to be in a package directory named pipe2py
for the import pipe2py
to work. So it looks like the files in /Applications/XAMPP/htdocs/pipeline/
need to be moved into the /Applications/XAMPP/htdocs/pipeline/pipe2py/
sub-directory. Having /Applications/XAMPP/htdocs/pipeline
in sys.path
should then be enough to locate the pipe2py
package.
Right! It works now. Thanks for your help
I think I misunderstood this phrase in README:
If using a Python version before 2.6 then simplejson is needed:
pipeline/pipe2py
.At first I put simplejson source code in pipeline/pipe2py and pipe2py in pipeline/
FIXED!
On Mon, Nov 7, 2011 at 11:06 PM, Greg Gaughan < reply@reply.github.com>wrote:
So the files seem to be there but they need to be in a package directory named
pipe2py
for theimport pipe2py
to work. So it looks like the files in/Applications/XAMPP/htdocs/pipeline/
need to be moved into the/Applications/XAMPP/htdocs/pipeline/pipe2py/
sub-directory. Having/Applications/XAMPP/htdocs/pipeline
insys.path
should then be enough to locate thepipe2py
package.
Reply to this email directly or view it on GitHub: https://github.com/ggaughan/pipe2py/issues/14#issuecomment-2660563
Ok, I can compile but I cannot execute it.
My compiled pipe throws: $ python pipe_0373e6dbc0f888a2f5af7d342e56eaba.py
Traceback (most recent call last):
File "pipe_0373e6dbc0f888a2f5af7d342e56eaba.py", line 38, in
It's not the real pipe cause I want to keep it private for now.
There's no argument in this pipe, everything is hardcoded within it, why does it ask for first argument? what (and how) should I put as argument?
Thanks for your help, again ;-)
On Tue, Nov 8, 2011 at 7:56 AM, j2l jeanllegros@yahoo.fr wrote:
Right! It works now. Thanks for your help
I think I misunderstood this phrase in README:
Setting up the environment
If using a Python version before 2.6 then simplejson is needed:
- http://pypi.python.org/pypi/simplejson Put the source code in a directory, say,
pipeline/pipe2py
.At first I put simplejson source code in pipeline/pipe2py and pipe2py in pipeline/
FIXED!
On Mon, Nov 7, 2011 at 11:06 PM, Greg Gaughan < reply@reply.github.com>wrote:
So the files seem to be there but they need to be in a package directory named
pipe2py
for theimport pipe2py
to work. So it looks like the files in/Applications/XAMPP/htdocs/pipeline/
need to be moved into the/Applications/XAMPP/htdocs/pipeline/pipe2py/
sub-directory. Having/Applications/XAMPP/htdocs/pipeline
insys.path
should then be enough to locate thepipe2py
package.
Reply to this email directly or view it on GitHub: https://github.com/ggaughan/pipe2py/issues/14#issuecomment-2660563
I'll make a note to improve the README text - I can see how it could be confusing.
Sounds like there could something strange with the pipe definition. I can't seem to access it via pipes or pipe2py for some reason - could you send me the definition please? Either a link that works, or using -j
when compiling to get a .json representation.
Thanks, Greg
Sorry - just saw the bit about it being private. It sounds like a regex module parameter is missing - perhaps the loop failed to pass it something to work with. I'll need the .json file to investigate further though.
When trying to compile with Json:
python compile.py pipe_0373e6dbc0f888a2f5af7d342e56eaba.py
Traceback (most recent call last):
File "compile.py", line 356, in
Not sure if it's related but this pipe is heavy on computing, it takes 20-40s to execute in yahoo pipes and sometimes fails. Regex is used with no errors but result can be cleaner so I get some warnings at execution. Result is a list with locations so I can get the map result too.
On Wed, Nov 9, 2011 at 1:37 PM, Greg Gaughan < reply@reply.github.com>wrote:
Sorry - just saw the bit about it being private. It sounds like a regex module parameter is missing - perhaps the loop failed to pass it something to work with. I'll need the .json file to investigate further though.
Reply to this email directly or view it on GitHub: https://github.com/ggaughan/pipe2py/issues/14#issuecomment-2680651
Sorry for my simple question: What option -j? What's the full command line to get for instance pipe_2de0e4517ed76082dcddf66f7b218057.json?
I tracked another problem with a fetch page loop in the same pipe ( I
truncated the original pipe to track the bugs):
$ python pipe_XX.py
Traceback (most recent call last):
File "pipe_XX.py", line 33, in
I don't get what it means.
In Yahoo pipes, result of this fetch page loop section is in the form: 0 content html link http://... loop:fetchpage content html 1...
Thanks again,
On Fri, Nov 11, 2011 at 2:59 PM, j2l jeanllegros@yahoo.fr wrote:
When trying to compile with Json: python compile.py pipe_0373e6dbc0f888a2f5af7d342e56eaba.py Traceback (most recent call last): File "compile.py", line 356, in
pipe_def = json.loads(pjson) File "/Library/Python/2.5/site-packages/simplejson-2.2.1-py2.5-macosx-10.5-i386.egg/simplejson/init.py", line 413, in loads return _default_decoder.decode(s) File "/Library/Python/2.5/site-packages/simplejson-2.2.1-py2.5-macosx-10.5-i386.egg/simplejson/decoder.py", line 402, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/Library/Python/2.5/site-packages/simplejson-2.2.1-py2.5-macosx-10.5-i386.egg/simplejson/decoder.py", line 420, in raw_decode raise JSONDecodeError("No JSON object could be decoded", s, idx) simplejson.decoder.JSONDecodeError: No JSON object could be decoded: line 1 column 0 (char 0) Not sure if it's related but this pipe is heavy on computing, it takes 20-40s to execute in yahoo pipes and sometimes fails. Regex is used with no errors but result can be cleaner so I get some warnings at execution. Result is a list with locations so I can get the map result too.
On Wed, Nov 9, 2011 at 1:37 PM, Greg Gaughan < reply@reply.github.com>wrote:
Sorry - just saw the bit about it being private. It sounds like a regex module parameter is missing - perhaps the loop failed to pass it something to work with. I'll need the .json file to investigate further though.
Reply to this email directly or view it on GitHub: https://github.com/ggaughan/pipe2py/issues/14#issuecomment-2680651
Use the -s
option to create a .json file created (sorry, not -j), e.g.
python compile.py -s -p 2de0e4517ed76082dcddf66f7b218057
(Your earlier python compile.py pipe_0373e6dbc0f888a2f5af7d342e56eaba.py
will fail: compile.py expects a json file, not the pipe module itself.)
ok, thanks. I can produce .json file. I don't know how to help debug this. I cannot give access to this pipe or json file.
On Fri, Nov 11, 2011 at 5:27 PM, Greg Gaughan < reply@reply.github.com>wrote:
Use the
-s
option to create a .json file created (sorry, not -j), e.g.python compile.py -s -p 2de0e4517ed76082dcddf66f7b218057
(Your earlier
python compile.py pipe_0373e6dbc0f888a2f5af7d342e56eaba.py
will fail: compile.py expects a json file, not the pipe module itself.)
Reply to this email directly or view it on GitHub: https://github.com/ggaughan/pipe2py/issues/14#issuecomment-2709918
Could you find out the value of rule
just before line 30 in piperegex.py (the point where it fails).
My guess is that the regular expression is missing for some reason. What is the loop module looping over?
how to do that? I tried: print "%s" %(match) in piperegex.py but no luck
print rule
would be better. Or trace into the exception and and inspect the value of rule.
I'm not sure how far we'll get with this indirect debugging ;)
I just made a bunch of updates, can you check and see if the issue is still there?
Hi,
After pipe2py install (feedparser and simplejson are already installed), testing or compiling throws: python testbasics.py Traceback (most recent call last): File "testbasics.py", line 9, in
from pipe2py import Context
ImportError: No module named pipe2py
on Mac OS X 10.5
Any ideas?