How to package python3 modules for google app engine
up vote
3
down vote
favorite
I'm trying to figure out how to add a internal package to a Google App Engine deployment with Python 3 (standard).
For Python 2 the way to package modules was using a local lib/
folder and appengine_config.py
. This seems not to work anymore for Python 3? At least my app cannot find modules which are in the lib/
folder.
For Python 3 it's possible to just pip3 install -t .
the package. But this gets really messy as all packages are just installed in the app root and will also be added to the git repository of our app.
We cannot use requirements.txt
as the module is internal and will not be available on PyPI.
Is there another way to package modules for Google App Engine using Python 3?
python-3.x google-app-engine google-app-engine-python
add a comment |
up vote
3
down vote
favorite
I'm trying to figure out how to add a internal package to a Google App Engine deployment with Python 3 (standard).
For Python 2 the way to package modules was using a local lib/
folder and appengine_config.py
. This seems not to work anymore for Python 3? At least my app cannot find modules which are in the lib/
folder.
For Python 3 it's possible to just pip3 install -t .
the package. But this gets really messy as all packages are just installed in the app root and will also be added to the git repository of our app.
We cannot use requirements.txt
as the module is internal and will not be available on PyPI.
Is there another way to package modules for Google App Engine using Python 3?
python-3.x google-app-engine google-app-engine-python
Try placing the package's directory right under the top level service directory rather than underlib
, side-by-side with with theapp.yaml
file. From GAE's perspective this should appear just like another package of your app code. Not sure if just symlinking the directory from somewhere else would work like in the 1st generation (python 2.7) standard environment (see stackoverflow.com/a/34291789/4495081) to avoid copying the package
– Dan Cornilescu
Nov 19 at 18:12
add a comment |
up vote
3
down vote
favorite
up vote
3
down vote
favorite
I'm trying to figure out how to add a internal package to a Google App Engine deployment with Python 3 (standard).
For Python 2 the way to package modules was using a local lib/
folder and appengine_config.py
. This seems not to work anymore for Python 3? At least my app cannot find modules which are in the lib/
folder.
For Python 3 it's possible to just pip3 install -t .
the package. But this gets really messy as all packages are just installed in the app root and will also be added to the git repository of our app.
We cannot use requirements.txt
as the module is internal and will not be available on PyPI.
Is there another way to package modules for Google App Engine using Python 3?
python-3.x google-app-engine google-app-engine-python
I'm trying to figure out how to add a internal package to a Google App Engine deployment with Python 3 (standard).
For Python 2 the way to package modules was using a local lib/
folder and appengine_config.py
. This seems not to work anymore for Python 3? At least my app cannot find modules which are in the lib/
folder.
For Python 3 it's possible to just pip3 install -t .
the package. But this gets really messy as all packages are just installed in the app root and will also be added to the git repository of our app.
We cannot use requirements.txt
as the module is internal and will not be available on PyPI.
Is there another way to package modules for Google App Engine using Python 3?
python-3.x google-app-engine google-app-engine-python
python-3.x google-app-engine google-app-engine-python
edited Nov 19 at 16:59
Dustin
2,3941124
2,3941124
asked Nov 19 at 15:12
Carsten Rietz
334
334
Try placing the package's directory right under the top level service directory rather than underlib
, side-by-side with with theapp.yaml
file. From GAE's perspective this should appear just like another package of your app code. Not sure if just symlinking the directory from somewhere else would work like in the 1st generation (python 2.7) standard environment (see stackoverflow.com/a/34291789/4495081) to avoid copying the package
– Dan Cornilescu
Nov 19 at 18:12
add a comment |
Try placing the package's directory right under the top level service directory rather than underlib
, side-by-side with with theapp.yaml
file. From GAE's perspective this should appear just like another package of your app code. Not sure if just symlinking the directory from somewhere else would work like in the 1st generation (python 2.7) standard environment (see stackoverflow.com/a/34291789/4495081) to avoid copying the package
– Dan Cornilescu
Nov 19 at 18:12
Try placing the package's directory right under the top level service directory rather than under
lib
, side-by-side with with the app.yaml
file. From GAE's perspective this should appear just like another package of your app code. Not sure if just symlinking the directory from somewhere else would work like in the 1st generation (python 2.7) standard environment (see stackoverflow.com/a/34291789/4495081) to avoid copying the package– Dan Cornilescu
Nov 19 at 18:12
Try placing the package's directory right under the top level service directory rather than under
lib
, side-by-side with with the app.yaml
file. From GAE's perspective this should appear just like another package of your app code. Not sure if just symlinking the directory from somewhere else would work like in the 1st generation (python 2.7) standard environment (see stackoverflow.com/a/34291789/4495081) to avoid copying the package– Dan Cornilescu
Nov 19 at 18:12
add a comment |
1 Answer
1
active
oldest
votes
up vote
3
down vote
accepted
The Python 3.7 Standard runtime is an "idiomatic" Python runtime, which means it doesn't automatically add the special lib
directory to the search path for modules.
You should continue "vendoring" your private modules into a lib
directory, but you'll need to make a change to how you import them.
If your private package is foobar
, and you've done pip install -t lib foobar
, then in your project, instead of:
import foobar
you do:
import lib.foobar
(You'll also need to add an empty __init__.py
file to your lib
directory, to make it a module.)
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
accepted
The Python 3.7 Standard runtime is an "idiomatic" Python runtime, which means it doesn't automatically add the special lib
directory to the search path for modules.
You should continue "vendoring" your private modules into a lib
directory, but you'll need to make a change to how you import them.
If your private package is foobar
, and you've done pip install -t lib foobar
, then in your project, instead of:
import foobar
you do:
import lib.foobar
(You'll also need to add an empty __init__.py
file to your lib
directory, to make it a module.)
add a comment |
up vote
3
down vote
accepted
The Python 3.7 Standard runtime is an "idiomatic" Python runtime, which means it doesn't automatically add the special lib
directory to the search path for modules.
You should continue "vendoring" your private modules into a lib
directory, but you'll need to make a change to how you import them.
If your private package is foobar
, and you've done pip install -t lib foobar
, then in your project, instead of:
import foobar
you do:
import lib.foobar
(You'll also need to add an empty __init__.py
file to your lib
directory, to make it a module.)
add a comment |
up vote
3
down vote
accepted
up vote
3
down vote
accepted
The Python 3.7 Standard runtime is an "idiomatic" Python runtime, which means it doesn't automatically add the special lib
directory to the search path for modules.
You should continue "vendoring" your private modules into a lib
directory, but you'll need to make a change to how you import them.
If your private package is foobar
, and you've done pip install -t lib foobar
, then in your project, instead of:
import foobar
you do:
import lib.foobar
(You'll also need to add an empty __init__.py
file to your lib
directory, to make it a module.)
The Python 3.7 Standard runtime is an "idiomatic" Python runtime, which means it doesn't automatically add the special lib
directory to the search path for modules.
You should continue "vendoring" your private modules into a lib
directory, but you'll need to make a change to how you import them.
If your private package is foobar
, and you've done pip install -t lib foobar
, then in your project, instead of:
import foobar
you do:
import lib.foobar
(You'll also need to add an empty __init__.py
file to your lib
directory, to make it a module.)
edited Nov 20 at 13:32
answered Nov 19 at 17:27
Dustin
2,3941124
2,3941124
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53377560%2fhow-to-package-python3-modules-for-google-app-engine%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Try placing the package's directory right under the top level service directory rather than under
lib
, side-by-side with with theapp.yaml
file. From GAE's perspective this should appear just like another package of your app code. Not sure if just symlinking the directory from somewhere else would work like in the 1st generation (python 2.7) standard environment (see stackoverflow.com/a/34291789/4495081) to avoid copying the package– Dan Cornilescu
Nov 19 at 18:12