Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pydoop is not importable from an egg file #276

Open
simleo opened this issue Feb 13, 2018 · 2 comments
Open

Pydoop is not importable from an egg file #276

simleo opened this issue Feb 13, 2018 · 2 comments
Labels

Comments

@simleo
Copy link
Member

simleo commented Feb 13, 2018

>>> import sys
>>> sys.path.insert(0, "pydoop-1.2.0-py2.7.egg")
>>> import pydoop
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "build/bdist.linux-x86_64/egg/pydoop/__init__.py", line 194, in <module>
  File "build/bdist.linux-x86_64/egg/pydoop/__init__.py", line 179, in read_properties
IOError: [Errno 20] Not a directory: '/tmp/templib/pydoop-1.2.0-py2.7.egg/pydoop/pydoop.properties'

Tested with Pydoop 1.2.0, need to check if this also affects the current development branch. We could copy properties to a Python module as part of the installation process to avoid this.

@simleo
Copy link
Member Author

simleo commented Feb 15, 2018

Looks like it would break anyway when trying to import extension modules, see #273. Although http://peak.telecommunity.com/DevCenter/PythonEggs says it should be possible to make it work (together with pkg_resources), my attempts were unsuccessful. If we leave like this, at least we should add zip_safe=False to the setup function.

@snalanagula
Copy link

Hi,
Using pkg_resources I managed to read yaml configuration from an egg file. Please check if this helps.
Folder structure is below:

testproject-1.0-py2.7.egg/
        setup.py
        requirements.txt
        rdf/
             src
             .....
             config.yaml
from pkg_resources import resource_exists, resource_stream
import yaml 
 
config_stream = resource_stream('rdf', 'config.yaml')
config = yaml.load(config_stream)
config.get(key, None)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants