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

Resolve error on dev server with certain system packages installed #732

Merged
merged 2 commits into from
Nov 23, 2017

Conversation

rbubley
Copy link
Collaborator

@rbubley rbubley commented Oct 30, 2017

I had been encountering this error:

Traceback (most recent call last):
  File "/Users/russ/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 240, in Handle
    handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
  File "/Users/russ/google-cloud-sdk/platform/google_appengine/google/appengine/api/lib_config.py", line 351, in __getattr__
    self._update_configs()
  File "/Users/russ/google-cloud-sdk/platform/google_appengine/google/appengine/api/lib_config.py", line 287, in _update_configs
    self._registry.initialize()
  File "/Users/russ/google-cloud-sdk/platform/google_appengine/google/appengine/api/lib_config.py", line 160, in initialize
    import_func(self._modname)
  File "/Users/russ/gae-init-project/main/appengine_config.py", line 24, in <module>
    sys_path_insert('libx')
  File "/Users/russ/gae-init-project/main/path_util.py", line 59, in sys_path_insert
    path_package_path(dirname, get_shadows_dir(dirname))
  File "/Users/russ/gae-init-project/main/path_util.py", line 50, in get_shadows_dir
    if not pkg=='__init__' and not os.path.isfile(pkg) and is_shadowing(pkg):
  File "/Users/russ/gae-init-project/main/path_util.py", line 18, in is_shadowing
    __import__(os.path.splitext(package_name)[0])
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PIL/__init__.py", line 14, in <module>
    from . import version
ValueError: Attempted relative import in non-package

I had been encountering this error:
```
Traceback (most recent call last):
  File "/Users/russ/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 240, in Handle
    handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
  File "/Users/russ/google-cloud-sdk/platform/google_appengine/google/appengine/api/lib_config.py", line 351, in __getattr__
    self._update_configs()
  File "/Users/russ/google-cloud-sdk/platform/google_appengine/google/appengine/api/lib_config.py", line 287, in _update_configs
    self._registry.initialize()
  File "/Users/russ/google-cloud-sdk/platform/google_appengine/google/appengine/api/lib_config.py", line 160, in initialize
    import_func(self._modname)
  File "/Users/russ/gae-init-project/main/appengine_config.py", line 24, in <module>
    sys_path_insert('libx')
  File "/Users/russ/gae-init-project/main/path_util.py", line 59, in sys_path_insert
    path_package_path(dirname, get_shadows_dir(dirname))
  File "/Users/russ/gae-init-project/main/path_util.py", line 50, in get_shadows_dir
    if not pkg=='__init__' and not os.path.isfile(pkg) and is_shadowing(pkg):
  File "/Users/russ/gae-init-project/main/path_util.py", line 18, in is_shadowing
    __import__(os.path.splitext(package_name)[0])
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PIL/__init__.py", line 14, in <module>
    from . import version
ValueError: Attempted relative import in non-package
```
@lipis
Copy link
Member

lipis commented Oct 30, 2017

Thanks man..I'll test it with few of my projects and report back..

@@ -44,7 +44,7 @@ def get_shadows_dir(dirname):
if not os.path.exists(dirname):
return shadow_pkgs
for pkg in os.listdir(dirname):
if not os.path.isfile(pkg) and is_shadowing(pkg):
if not pkg=='__init__.py' and os.path.isfile(pkg) and is_shadowing(pkg):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

space before after ==

@lipis lipis merged commit 6a017ab into gae-init:master Nov 23, 2017
@lipis
Copy link
Member

lipis commented Nov 23, 2017

Sorry for the delay @rbubley :)

lipis added a commit that referenced this pull request Mar 3, 2018
* master:
  Add Prettier support (#739)
  Resolve error on dev server with certain system packages installed (#732)
  chore(package): update uglify-js to version 3.1.10 (#738)
  chore(package): update uglify-js to version 3.1.9 (#736)
  chore(package): update uglify-js to version 3.1.8 (#735)
  chore(package): update uglify-js to version 3.1.7 (#734)
  Updating moment.js to 2.19.1 (#733)
  chore(package): update uglify-js to version 3.1.6 (#731)
  chore(package): update uglify-js to version 3.1.5 (#730)
  chore(package): update uglify-js to version 3.1.4 (#728)
  Add package-lock.json (#724)
  Remove Let's Encrypt support (#723)
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 this pull request may close these issues.

None yet

2 participants