I am using shopify api in python first time using sameple code availbe on shopify documentation and getting following error:
File “D:UsersAmmarAppDataLocalContinuumanaconda3libhttpclient.py”, line 890, in _get_hostport
raise InvalidURL(“nonnumeric port: ‘%s'” % host[i+1:])
InvalidURL: nonnumeric port: ‘[email protected]’
Python3. Shopify-API
import shopify
shop_url = "https://apikey:[email protected]/admin"
shopify.ShopifyResource.set_site(shop_url)
2
Answers
This is an existing issue in Shopify Python Package. You need to upgrade to API Version – 5.0.1. You can find more information about the issue raised here – Link.
Run
pip install ShopifyAPI==5.0.1
to upgrade your local package.Shopify 5.0.1 Package – Link
Update (Work Around):
It’s nowhere to be found by simply looking at the docs but I found the response on their own tests here
They instance their session something like this:
I’ll definitely be looking more at their tests instead of their docs, it seems pretty bad documented