Closed caronc closed 8 years ago
I believe this is because subliminal or babelfish isn't installed properly but just dropped in PYTHONPATH. Entrypoints are thus not installed.
Does babelfish use entry points? Even after installing it in a virtualenv, i don't see any _entrypoints.txt files defined (in any egg files that is within its packaging - using v5.4). Nor is there reference to anything in its setup.py. That said, I've never played with entrypoints so I'm also not really familiar with where else it could be... perhaps the _toplevel.txt would have an impact?
The tool in question is in fact a download of several packages with a virtualenv library directory (you're right with that assumption). But the part that baffles me, is that it works for me (doing the same thing) (different version of python, but works with both 2.6.6 and 2.7.5).
It wouldn't have anything to do with this bug fixed here would it? The issue specifically hovers around a bug with the *import() function. It later got documented as fixed in Python v2.7.4 here as bug no 1776? Could it be a python version issue?
Right, babelfish doesn't use entry points from the setup.py but rather runtime registered entry points: https://github.com/Diaoul/babelfish/blob/3a177fb4097b971ce32522fdfc96785be24761dd/babelfish/language.py#L33-L44
I'm assume something is wrong with the setup but I don't know what.
Thanks for you're feedback.
The problem turned out to be a relative path include I had at the top of my script (later which i changed directories below with chdir()).
Hence, but just changing this:
from os.path import join
from os.path import dirname
import sys
sys.path.insert(0, join(dirname(__file__), 'MyLibPath'))
To this (the addition of abspath()); everything worked again.
from os.path import abspath
from os.path import join
from os.path import dirname
import sys
sys.path.insert(0, join(abspath(dirname(__file__)), 'MyLibPath'))
Sorry for wasting your time! :)
Using you're subliminal backend, I construct the languages (with babelfish) ahead of time. But I had one report from a user using Python 2.7.3 who gets an import error (of alpha2) by the time it gets to babelfish's sub libraries.
I don't expect you to support my script at all... I was just curious on how to interpret the last part of the exception being thrown. Maybe it's a bug with babel fish? Maybe it isn't? Have you seen something like that? Perhaps an obvious issue I'm overlooking or a syntax error on my part?
This syntax works for me, so i can't reproduce it
Here is the output passed along to me in it's entirety:
Thoughts?