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

Installation problems due to google_type_annotations #96

Closed
mashrurmorshed opened this issue Nov 22, 2020 · 8 comments · Fixed by #97
Closed

Installation problems due to google_type_annotations #96

mashrurmorshed opened this issue Nov 22, 2020 · 8 comments · Fixed by #97
Assignees

Comments

@mashrurmorshed
Copy link

mashrurmorshed commented Nov 22, 2020

I'm running python 3.7.5, on Ubuntu 18.04. While installing gin-config, I ran into the following error:

running install
running bdist_egg
running egg_info
writing gin_config.egg-info/PKG-INFO
writing dependency_links to gin_config.egg-info/dependency_links.txt
writing requirements to gin_config.egg-info/requires.txt
writing top-level names to gin_config.egg-info/top_level.txt
reading manifest file 'gin_config.egg-info/SOURCES.txt'
writing manifest file 'gin_config.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/gin
copying build/lib/gin/config_parser.py -> build/bdist.linux-x86_64/egg/gin
copying build/lib/gin/resource_reader.py -> build/bdist.linux-x86_64/egg/gin
creating build/bdist.linux-x86_64/egg/gin/tf
copying build/lib/gin/tf/external_configurables.py -> build/bdist.linux-x86_64/egg/gin/tf
copying build/lib/gin/tf/__init__.py -> build/bdist.linux-x86_64/egg/gin/tf
copying build/lib/gin/tf/utils.py -> build/bdist.linux-x86_64/egg/gin/tf
copying build/lib/gin/__init__.py -> build/bdist.linux-x86_64/egg/gin
copying build/lib/gin/utils.py -> build/bdist.linux-x86_64/egg/gin
copying build/lib/gin/config.py -> build/bdist.linux-x86_64/egg/gin
creating build/bdist.linux-x86_64/egg/gin/torch
copying build/lib/gin/torch/external_configurables.py -> build/bdist.linux-x86_64/egg/gin/torch
copying build/lib/gin/torch/__init__.py -> build/bdist.linux-x86_64/egg/gin/torch
creating build/bdist.linux-x86_64/egg/gin/testdata
copying build/lib/gin/testdata/import_test_configurables.py -> build/bdist.linux-x86_64/egg/gin/testdata
copying build/lib/gin/testdata/invalid_import.py -> build/bdist.linux-x86_64/egg/gin/testdata
copying build/lib/gin/testdata/__init__.py -> build/bdist.linux-x86_64/egg/gin/testdata
creating build/bdist.linux-x86_64/egg/gin/testdata/fake_package
copying build/lib/gin/testdata/fake_package/__init__.py -> build/bdist.linux-x86_64/egg/gin/testdata/fake_package
creating build/bdist.linux-x86_64/egg/gin/testdata/fake_package/fake_gin_package
creating build/bdist.linux-x86_64/egg/gin/testdata/fake_package/fake_gin_package/config
copying build/lib/gin/testdata/fake_package/fake_gin_package/config/__init__.py -> build/bdist.linux-x86_64/egg/gin/testdata/fake_package/fake_gin_package/config
copying build/lib/gin/testdata/fake_package/fake_gin_package/__init__.py -> build/bdist.linux-x86_64/egg/gin/testdata/fake_package/fake_gin_package
copying build/lib/gin/selector_map.py -> build/bdist.linux-x86_64/egg/gin
byte-compiling build/bdist.linux-x86_64/egg/gin/config_parser.py to config_parser.cpython-37.pyc
byte-compiling build/bdist.linux-x86_64/egg/gin/resource_reader.py to resource_reader.cpython-37.pyc
  File "build/bdist.linux-x86_64/egg/gin/resource_reader.py", line 18
    from __future__ import google_type_annotations
                                                 ^
SyntaxError: future feature google_type_annotations is not defined

byte-compiling build/bdist.linux-x86_64/egg/gin/tf/external_configurables.py to external_configurables.cpython-37.pyc
byte-compiling build/bdist.linux-x86_64/egg/gin/tf/__init__.py to __init__.cpython-37.pyc
byte-compiling build/bdist.linux-x86_64/egg/gin/tf/utils.py to utils.cpython-37.pyc
byte-compiling build/bdist.linux-x86_64/egg/gin/__init__.py to __init__.cpython-37.pyc
byte-compiling build/bdist.linux-x86_64/egg/gin/utils.py to utils.cpython-37.pyc
byte-compiling build/bdist.linux-x86_64/egg/gin/config.py to config.cpython-37.pyc
byte-compiling build/bdist.linux-x86_64/egg/gin/torch/external_configurables.py to external_configurables.cpython-37.pyc
byte-compiling build/bdist.linux-x86_64/egg/gin/torch/__init__.py to __init__.cpython-37.pyc
byte-compiling build/bdist.linux-x86_64/egg/gin/testdata/import_test_configurables.py to import_test_configurables.cpython-37.pyc
byte-compiling build/bdist.linux-x86_64/egg/gin/testdata/invalid_import.py to invalid_import.cpython-37.pyc
byte-compiling build/bdist.linux-x86_64/egg/gin/testdata/__init__.py to __init__.cpython-37.pyc
byte-compiling build/bdist.linux-x86_64/egg/gin/testdata/fake_package/__init__.py to __init__.cpython-37.pyc
byte-compiling build/bdist.linux-x86_64/egg/gin/testdata/fake_package/fake_gin_package/config/__init__.py to __init__.cpython-37.pyc
byte-compiling build/bdist.linux-x86_64/egg/gin/testdata/fake_package/fake_gin_package/__init__.py to __init__.cpython-37.pyc
byte-compiling build/bdist.linux-x86_64/egg/gin/selector_map.py to selector_map.cpython-37.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying gin_config.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying gin_config.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying gin_config.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying gin_config.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying gin_config.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating 'dist/gin_config-0.4.0-py3.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing gin_config-0.4.0-py3.7.egg
Removing /usr/local/lib/python3.7/dist-packages/gin_config-0.4.0-py3.7.egg
Copying gin_config-0.4.0-py3.7.egg to /usr/local/lib/python3.7/dist-packages
gin-config 0.4.0 is already the active version in easy-install.pth

Installed /usr/local/lib/python3.7/dist-packages/gin_config-0.4.0-py3.7.egg
Processing dependencies for gin-config==0.4.0
Finished processing dependencies for gin-config==0.4.0

The error seems to be thrown by from __future__ import google_type_annotations. Commenting out this import in resource_reader.py resolves the problem. Seems similar to #77, though it's supposed to be resolved.

Also checked: installing gin-config-0.3.0 directly from pip allows me to import gin without any problems (Though it lacks the bindings for torch)

@jmuchovej
Copy link

I've been running up against this, too. You need to install from this commit:

pip install git+https://github.com/google/gin-config@22f59375a70d47e467c902eaeb6f979660995b84

You'll get the pytorch configurables and a few other things but avoid the google_type_annotations error.

copybara-service bot pushed a commit that referenced this issue Nov 24, 2020
Fixes #96

PiperOrigin-RevId: 343954894
copybara-service bot pushed a commit that referenced this issue Nov 24, 2020
Fixes #96

PiperOrigin-RevId: 343954894
@sguada
Copy link
Collaborator

sguada commented Nov 24, 2020

I just pushed 0.4.0 so there should be a new package available to install directly from pypi.

@jmuchovej
Copy link

0.4.0 seems to break when trying to use gin.add_config_file_search_path(...), then running gin.parse_config_file(...). I'm getting (from ipdb):

ERROR:root:Path not found: base.gin
*** TypeError: expected str, bytes or os.PathLike object, not NoneType

This is after running:

gin.add_config_file_search_path("configs")
gin.parse_config_file("base.gin")

Both the path configs and file configs/base.gin exist on my system (with the appropriate relative directories and the like).

I can confirm that this works with 22f5937. I haven't been able to go past that commit because of google_type_annotations. 😕

@sguada
Copy link
Collaborator

sguada commented Nov 24, 2020

@dhr can you take a look at this?

@sguada sguada reopened this Nov 24, 2020
@sguada
Copy link
Collaborator

sguada commented Nov 24, 2020

can you patch d318342 to remove the issue with google_type_annotations

mashrurmorshed added a commit to mashrurmorshed/OrigamiNet that referenced this issue Nov 26, 2020
@mashrurmorshed
Copy link
Author

Hello. My problem seems to be solved; should the issue be closed?

@sarapapi
Copy link

sarapapi commented Jan 13, 2021

0.4.0 seems to break when trying to use gin.add_config_file_search_path(...), then running gin.parse_config_file(...). I'm getting (from ipdb):

ERROR:root:Path not found: base.gin
*** TypeError: expected str, bytes or os.PathLike object, not NoneType

This is after running:

gin.add_config_file_search_path("configs")
gin.parse_config_file("base.gin")

Both the path configs and file configs/base.gin exist on my system (with the appropriate relative directories and the like).

I can confirm that this works with 22f5937. I haven't been able to go past that commit because of google_type_annotations. 😕

I had the same problem and I solved downgrading to the version that @ionlights suggested, the most recent commit is still affected by this problem

@sguada
Copy link
Collaborator

sguada commented May 10, 2021

Maybe @dhr has some insights.

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

Successfully merging a pull request may close this issue.

5 participants