What I’m trying to do:
Getting the stripe tutorial app running locally.
What I’ve tried and what’s not working: git clone ssh://<email>@anvil.works:2222/<key>.git stripe docker run -v $PWD/stripe:/apps/MainApp -p 3030:3030 anvilworks/anvil-app-server
Yes, I’ve read it. thank you again for having posted it, it helped me with the Dockerfile and docker-compose.
Does the python stripe module is enough in requirements?
If yes, it means, I must be able to run docker-compose without the user error.
I don’t know. I’ve not tried it. But my guess would be that just installing the usual stripe package is sufficient. (You can see it listed as one of the packages available on the hosted service at Anvil Docs | List of Packages)
Can you confirm that you’ve also included lines in your Dockerfile to install from requirements.txt? Those aren’t included in the stock image but they are shown in the example I linked to above.
There’s no stripe-checkout in your error, either. That’s complaining that it can’t import stripe.checkout which is definitely part of the stripe package.
Another guess - that looks like an old tutorial. Is it perhaps using the Python 2 environment? If so, I’ve no idea how that might work locally. It’s definitely not where you’re installing stripe.
COPY ./requirements.txt ./
RUN pip install stripe
RUN pip install anvil-app-server
# -r requirements.txt
RUN anvil-app-server || true
still the same issue
Initially I’ve done the tutorial from scratch in Python 3.
SSHing in the container, stripe is present:
pip list
WARNING: The directory '/home/user/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag.
Package Version
------------------ ---------
anvil-app-server 1.6.5
anvil-uplink 0.3.40
certifi 2021.10.8
charset-normalizer 2.0.12
cli-helpers 2.2.1
click 8.1.2
configobj 5.0.6
future 0.18.2
idna 3.3
pendulum 2.1.2
pgcli 3.4.1
pgspecial 1.13.1
pip 22.0.4
progressbar2 4.0.0
prompt-toolkit 3.0.29
psutil 5.9.0
psycopg2 2.9.3
pychrome 0.2.3
Pygments 2.12.0
python-dateutil 2.8.2
python-utils 3.1.0
pytzdata 2020.1
requests 2.27.1
setproctitle 1.2.3
setuptools 58.1.0
six 1.16.0
sqlparse 0.4.2
stripe 2.74.0
tabulate 0.8.9
urllib3 1.26.9
wcwidth 0.2.5
websocket-client 1.3.2
wheel 0.37.1
ws4py 0.5.1
What Stripe tutorial are you cloning here? Stripe Checkout is a card capture library – it’s the form the user types their card into – so the stripe.checkout module is available only on the client-side. Are you perhaps trying to import it on the server?
(PS: you might want to change your forum username to something more helpful You should be able to do it from the menus on the top right.)
Sorry, I don’t get it. I git cloned my stripe project I made from scratch following the tutorial.
Here is my version (my previous link was not the tutorial) : Anvil | Login
When I grep locally it’s on the client:
./client_code/Form1/__init__.py:import stripe.checkout
./client_code/Form1/__init__.py: c = stripe.checkout.charge(amount=999,
It simply stops at the import, there’s no local stripe.checkout local module, only in the project on Anvil.Works so I guess in the hosted Anvil runtime:
Here’s what I get from a git clone (the CRUDnews tutorial i made):
No runtime/ or tables.yml anywhere
I guess my database issue and the stripe issue are linked to this missing runtime/
When you git clone ssh://<email>@anvil.works:2222/<key>.git do you get a runtime/ folder locally?
.
EDIT:
I wonder if this line shouldn’t be services-core for the root, according to the structure of the server.
Or if it’s only a client module, maybe the adding stripe in node_modules?