Error while using suds: suds.TypeNotFound: Type not found
I want to consume the web services described in the following:
https://login.keyinvoice.com/API3_ws.php?wsdl
I am using python 3.5.x and suds version 0.6. What I tried 1
from suds.client import Client
url = 'https://login.keyinvoice.com/API3_ws.php?wsdl'
client = Client(url)
Error:
suds.TypeNotFound: Type not found: '(Array, http://www.w3.org/2001/XMLSchema, )'
What I tried 2
from suds.client import Client
from suds.xsd.doctor import Import, ImportDoctor
imp = Import('http://www.w3.org/2001/XMLSchema',
location='http://www.w3.org/2001/XMLSchema.xsd')
imp.filter.add('http://login.keyinvoice.com/soap/KI_API3')
client = Client(url, doctor=ImportDoctor(imp))
Error:
suds.TypeNotFound: Type not found: '(Array, http://www.w3.org/2001/XMLSchema, )'
Already visited these URL:
SOAP suds and the dreaded schema Type Not Found error
Type not found wsdl python suds client - suds.TypeNotFound
python suds
--
https://mail.python.org/mailman/listinfo/python-list
Re: Error while using suds: suds.TypeNotFound: Type not found
On Sunday, January 20, 2019 at 9:12:10 PM UTC+5:30, [email protected] wrote: > I want to consume the web services described in the following: > > https://login.keyinvoice.com/API3_ws.php?wsdl > > I am using python 3.5.x and suds version 0.6. What I tried 1 > > from suds.client import Client > url = 'https://login.keyinvoice.com/API3_ws.php?wsdl' > client = Client(url) > > Error: > > suds.TypeNotFound: Type not found: '(Array, http://www.w3.org/2001/XMLSchema, > )' > > What I tried 2 > > from suds.client import Client > from suds.xsd.doctor import Import, ImportDoctor > imp = Import('http://www.w3.org/2001/XMLSchema', > location='http://www.w3.org/2001/XMLSchema.xsd') > imp.filter.add('http://login.keyinvoice.com/soap/KI_API3') > client = Client(url, doctor=ImportDoctor(imp)) > > Error: > > suds.TypeNotFound: Type not found: '(Array, http://www.w3.org/2001/XMLSchema, > )' > > Already visited these URL: > > https://stackoverflow.com/questions/4719854/soap-suds-and-the-dreaded-schema-type-not-found-error > > https://stackoverflow.com/questions/25721035/type-not-found-wsdl-python-suds-client-suds-typenotfound -- https://mail.python.org/mailman/listinfo/python-list
Re: python package management confusion
On Saturday, 19 January 2019 11:17:19 UTC, dcs3spp wrote: > On Saturday, 19 January 2019 07:33:50 UTC, dieter wrote: > > dcs3spp via Python-list writes: > > > On Friday, 18 January 2019 07:39:00 UTC, dieter wrote: > > > ... > > > My situation is similar to the following > > > > > > Assume the following two privately developed projects that I have > > > written, each with their own setup.py: > > > 1. parent exists in folder $HOME/project/ > > > 2. child exists in folder $HOME/a_different_project/ > > > *child could be also be used by other projects in the future > > > > > > parent has a dependency requirement on child and so child is listed as an > > > install dependency in parent setup.py > > > > > > if I try python setup.py develop from parent project it fails to find > > > child dependency on build. > > > > Do you tell me to have a cyclic dependency structure? > > > > If not, first install "child" in your virtualenv (by whatever > > means, maybe "python setup.py develop"), then "parent". > > Thanks for your suggestion.No, no cyclic dependency structure. Child does not > depend on parent. Child could be used by separate projects in the future. > Child will not be cyclic, it will not import projects that import it. > > Installing child first is what I tried yesterday, > https://github.com/dcs3spp/setuptools_dependency_example/blob/master/README.md > , when trying to understand the suggested approach of using python setup.py > develop to pull dependencies. > > The advantage of the devpi approach, adopted earlier, is that this additional > complexity is hidden from developers. They do not need to be concerned about > the order that they install dependencies, e.g. install child first and then > install parent. Developers just run python setup.py develop and it > automatically fetches the child dependency. > > However, the devpi approach requires a private repository to be setup and I > am not sure whether it is possible to give access to it for usage in CI cloud > technologies, such as gitlab.com. If I stuck with devpi then I would > presumably have to follow the route of a bare metal environment for CI server > (e.g. Jenkins). Hence, my thoughts on paying subscription to a private pypi > cloud repository….. > > > My question is, can setuptools be configured to pull in child from a separate > git repository when running python setup.py develop from parent folder? I > have since found and tried this approach at > https://stackoverflow.com/a/53706140/8325270 > It appears that later versions of setuptools can install via a PEP508 url. I > currently trying to investigate this approach….. After trying PEP508 url approach my conclusions are as follows. A PEP508 url for a git repository can be used in *install_requires* of *setup.py*. An example is listed below. ``` requires = [ 'parent', 'kinto-http@git+https://github.com/Kinto/kinto-http.py', ] ... install_requires=requires ``` The package can then be installed with pip, using ```pip install -e . or pip install .``` However, installation with setuptools is then broken, i.e. ```python setup.py develop``` and ```python setup.py install``` fails. setuptools looks for packages in pypi indexes. To install using setuptools a devpi index would have to be installed and configured or packages would have to installed from a paid for pypi repository in the cloud. Alternatively, developers could manually install each private package dependency individually, prior to running ```python setup.py develop``` for the source package. Unless, there are other alternative(s) such as zc.buildout with mr developer plugin etc. If I want to have a Python private project, referencing other private project(s), available under source control and CI via gitlab.com, it seems that I can use the pip approach with PEP508 or use a requirements.txt file containing the git projects referenced as PEP508 urls, i.e. ```pip install -r requirements.txt```. Confusion, stems from the fact that pip and setuptools dependencies are then not synchronised, i.e. setuptools will break if PEP508 urls are listed for install_requires. Presumably the approach is to use either pip or setuptools but not both? -- https://mail.python.org/mailman/listinfo/python-list
Re: How to access a folder in a zip file?
On 19/01/2019 07.36, mignoncharly wrote: > Hello! > > I'm a newbie in python and I was trying to access a folder inside a zip file > and I also have issues with relative and absolute path. Thks in advance. > > In projects there a lot of urls (i'll read them later one by one and store > them in a list/array so that I could work with it easily) > > here is the path: home/name/tutorial/prof/ks.zip/projects Are you sure? Could it possibly be: /home/name/tutorial/prof/ks.zip/projects instead? -- Michael F. Stemper What happens if you play John Cage's "4'33" at a slower tempo? -- https://mail.python.org/mailman/listinfo/python-list
Re: Error while using suds: suds.TypeNotFound: Type not found
On 2019-01-20 15:41, [email protected] wrote: I want to consume the web services described in the following: https://login.keyinvoice.com/API3_ws.php?wsdl I am using python 3.5.x and suds version 0.6. What I tried 1 from suds.client import Client url = 'https://login.keyinvoice.com/API3_ws.php?wsdl' client = Client(url) Error: suds.TypeNotFound: Type not found: '(Array, http://www.w3.org/2001/XMLSchema, )' What I tried 2 from suds.client import Client from suds.xsd.doctor import Import, ImportDoctor imp = Import('http://www.w3.org/2001/XMLSchema', location='http://www.w3.org/2001/XMLSchema.xsd') imp.filter.add('http://login.keyinvoice.com/soap/KI_API3') client = Client(url, doctor=ImportDoctor(imp)) Error: suds.TypeNotFound: Type not found: '(Array, http://www.w3.org/2001/XMLSchema, )' Already visited these URL: SOAP suds and the dreaded schema Type Not Found error Type not found wsdl python suds client - suds.TypeNotFound python suds Have you tried: https://www.w3.org/2001/XMLSchema instead? ("https" instead of "http") -- https://mail.python.org/mailman/listinfo/python-list
Re: python package management confusion
On Sun, 20 Jan 2019 at 16:22, dcs3spp via Python-list wrote: > > On Saturday, 19 January 2019 11:17:19 UTC, dcs3spp wrote: > > > > My question is, can setuptools be configured to pull in child from a > > separate git repository when running python setup.py develop from parent > > folder? I have since found and tried this approach at > > https://stackoverflow.com/a/53706140/8325270 > > It appears that later versions of setuptools can install via a PEP508 url. > > I currently trying to investigate this approach….. > > After trying PEP508 url approach my conclusions are as follows. > > A PEP508 url for a git repository can be used in *install_requires* of > *setup.py*. An example is listed below. > ``` > requires = [ > 'parent', > 'kinto-http@git+https://github.com/Kinto/kinto-http.py', > ] > ... > install_requires=requires > ``` > The package can then be installed with pip, using ```pip install -e . or pip > install .``` > > However, installation with setuptools is then broken, i.e. ```python setup.py > develop``` and ```python setup.py install``` fails. setuptools looks for > packages in pypi indexes. To install using setuptools a devpi index would > have to be installed and configured or packages would have to installed from > a paid for pypi repository in the cloud. Alternatively, developers could > manually install each private package dependency individually, prior to > running ```python setup.py develop``` for the source package. Unless, there > are other alternative(s) such as zc.buildout with mr developer plugin etc. > > If I want to have a Python private project, referencing other private > project(s), available under source control and CI via gitlab.com, it seems > that I can use the pip approach with PEP508 or use a requirements.txt file > containing the git projects referenced as PEP508 urls, i.e. ```pip install -r > requirements.txt```. > > Confusion, stems from the fact that pip and setuptools dependencies are then > not synchronised, i.e. setuptools will break if PEP508 urls are listed for > install_requires. Presumably the approach is to use either pip or setuptools > but not both? I'm not sure what you mean by pip and setuptools not being synchronised. Pip depends on setuptools and cannot be used without it. Both setuptools and pip are maintained under the PyPA. They are intended to work together. in fact if your setup.py uses distutils instead of setuptools then pip will "inject" setuptools into it to ensure that meets pip's needs. You will need to be more specific about which commands you are using and what it is that becomes unsynchronised. -- Oscar -- https://mail.python.org/mailman/listinfo/python-list
Re: python package management confusion
On Sunday, 20 January 2019 20:38:30 UTC, Oscar Benjamin wrote: > On Sun, 20 Jan 2019 at 16:22, dcs3spp via Python-list > wrote: > > > > On Saturday, 19 January 2019 11:17:19 UTC, dcs3spp wrote: > > > > > > My question is, can setuptools be configured to pull in child from a > > > separate git repository when running python setup.py develop from parent > > > folder? I have since found and tried this approach at > > > https://stackoverflow.com/a/53706140/8325270 > > > It appears that later versions of setuptools can install via a PEP508 > > > url. I currently trying to investigate this approach….. > > > > After trying PEP508 url approach my conclusions are as follows. > > > > A PEP508 url for a git repository can be used in *install_requires* of > > *setup.py*. An example is listed below. > > ``` > > requires = [ > > 'parent', > > 'kinto-http@git+https://github.com/Kinto/kinto-http.py', > > ] > > ... > > install_requires=requires > > ``` > > The package can then be installed with pip, using ```pip install -e . or > > pip install .``` > > > > However, installation with setuptools is then broken, i.e. ```python > > setup.py develop``` and ```python setup.py install``` fails. setuptools > > looks for packages in pypi indexes. To install using setuptools a devpi > > index would have to be installed and configured or packages would have to > > installed from a paid for pypi repository in the cloud. Alternatively, > > developers could manually install each private package dependency > > individually, prior to running ```python setup.py develop``` for the source > > package. Unless, there are other alternative(s) such as zc.buildout with mr > > developer plugin etc. > > > > If I want to have a Python private project, referencing other private > > project(s), available under source control and CI via gitlab.com, it seems > > that I can use the pip approach with PEP508 or use a requirements.txt file > > containing the git projects referenced as PEP508 urls, i.e. ```pip install > > -r requirements.txt```. > > > > Confusion, stems from the fact that pip and setuptools dependencies are > > then not synchronised, i.e. setuptools will break if PEP508 urls are listed > > for install_requires. Presumably the approach is to use either pip or > > setuptools but not both? > > I'm not sure what you mean by pip and setuptools not being > synchronised. Pip depends on setuptools and cannot be used without it. > Both setuptools and pip are maintained under the PyPA. They are > intended to work together. in fact if your setup.py uses distutils > instead of setuptools then pip will "inject" setuptools into it to > ensure that meets pip's needs. > > You will need to be more specific about which commands you are using > and what it is that becomes unsynchronised. > > -- > Oscar Hi, Have since done further testing and figured out how I can install from a setup.py file using both pip and python setup.py develop. Confusion was caused by trying to install using both pip and setuptools with PEP508 urls in install_requires, see note at end of post From what I understand setuptools offers *dependency_links* as a list of dependency urls. In the example below, the *pyramid_core* package is a private dependency that I have written. I am currently using pip 18.1. pip has an option *--process-dependencies* that issues a deprecation warning. The following *setup.py* example works with both setuptools (python setup develop etc.) and pip (pip install -e . and pip install .). The example *setup.py* below can be installed using both setuptools and pip as follows: ``` python setup.py develop python setup.py install pip install -e . --process-dependency-links pip install . ``` **setup.py that is compatible with both setuptools and pip 18.1** = ``` import os from setuptools import setup, find_packages here = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(here, 'README.md')) as f: README = f.read() with open(os.path.join(here, 'CHANGES.md')) as f: CHANGES = f.read() dependencies = [ 'git+ssh://[email protected]/dcs3spp/plantoeducate_core.git#egg=pyramid_core-0', ] requires = [ 'parent', 'pyramid_core', ] setup_requires = [ ] tests_require = [ 'pytest', 'pytest-cov', ] setup(name='parent', version='0.1', description='parent', long_description=README + '\n\n' + CHANGES, classifiers=[ "Programming Language :: Python", ], author='dcs3spp', author_email='[email protected]', url='', keywords='setuptools', packages=find_packages('src'), package_dir={'': 'src'}, include_package_data=True, zip_safe=False, extras_require={ 'testing': tests_require, }, install_requires=requires, dependency_links=dependencies, setup_requires=setup_requires, tests_require=tests
Re: python package management confusion
On Sun, 20 Jan 2019 at 21:12, dcs3spp via Python-list wrote: > > Pip 18.1 supports reading pep508 direct urls from install_requires. In future > release there are plans to deprecate the --process-dependency-links pip > install option: > - https://github.com/pypa/pip/issues/4187 > - https://github.com/pypa/pip/pull/4175 > > Will setuptools provide ability to use direct pep508 urls in install_requires > in the future also? Someone might answer here but if not I suggest asking this on distutils-sig: https://www.python.org/community/sigs/current/distutils-sig/ Also: https://github.com/pypa/setuptools/issues -- Oscar -- https://mail.python.org/mailman/listinfo/python-list
Re: python package management confusion
On Sunday, 20 January 2019 21:27:53 UTC, Oscar Benjamin wrote: > On Sun, 20 Jan 2019 at 21:12, dcs3spp via Python-list > wrote: > > > > Pip 18.1 supports reading pep508 direct urls from install_requires. In > > future release there are plans to deprecate the --process-dependency-links > > pip install option: > > - https://github.com/pypa/pip/issues/4187 > > - https://github.com/pypa/pip/pull/4175 > > > > Will setuptools provide ability to use direct pep508 urls in > > install_requires in the future also? > > Someone might answer here but if not I suggest asking this on distutils-sig: > https://www.python.org/community/sigs/current/distutils-sig/ > > Also: > https://github.com/pypa/setuptools/issues > > -- > Oscar Cheers, thanks for the resource links, will give them a go. Appreciated :) -- https://mail.python.org/mailman/listinfo/python-list
Re: basic question on how "import" works
On 19Jan2019 11:42, joseph pareti wrote:
[*u23885@c009 3_NeuralNetworks]$ cat foo.py*
from __future__ import print_function
# Import MNIST data
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("/tmp/data/", one_hot=True)
[u23885@c009 3_NeuralNetworks]$
when the above code is executed, equivalent of
*$ python foo.py*
the output is as follows:
...
Successfully downloaded train-images-idx3-ubyte.gz 9912422 bytes.
Extracting /tmp/data/train-images-idx3-ubyte.gz
Successfully downloaded train-labels-idx1-ubyte.gz 28881 bytes.
Extracting /tmp/data/train-labels-idx1-ubyte.gz
Successfully downloaded t10k-images-idx3-ubyte.gz 1648877 bytes.
Extracting /tmp/data/t10k-images-idx3-ubyte.gz
Successfully downloaded t10k-labels-idx1-ubyte.gz 4542 bytes.
Extracting /tmp/data/t10k-labels-idx1-ubyte.gz
...
My questions are:
1. where are the write / print statements that display *Successfully
downloaded, extracting ...*
I would expect these to be in the tensorflow package. Find out where
that is installed, then grep the source for "Successfully".
It is not uncommon for programmes to set their logging threshlds to emit
"INFO" level logs if the output is a terminal, and possibly only
"WARNING" or higher otherwise, so as to provide progress reporting to a
person but less noise in a batch environment. So you may just be seeing
info messages reporting progress. And it is likely that tere will be
some mechanism to tune how noisy that it.
2. I don't see any such files in /tmp/data on my system, why?
These are probably temporary scratch files. The module will be fetching
data files into the "/tmp/data" directory (which you have specified) and
unpacking and importing their data. Once that is done the file is
presumably discarded.
If you cd into that directory in another terminal and run "ls" commands
regularly _during_ the import phase, you should see the filesappear and
disappear as they are fetched, processed and discarded.
Cheers,
Cameron Simpson
--
https://mail.python.org/mailman/listinfo/python-list
Re: How to access a folder in a zip file?
mignoncharly via Python-list writes: > I'm a newbie in python and I was trying to access a folder inside a zip file > and I also have issues with relative and absolute path. Thks in advance. > > In projects there a lot of urls (i'll read them later one by one and store > them in a list/array so that I could work with it easily) > > here is the path: home/name/tutorial/prof/ks.zip/projects > > should I use > > file_name = "ks.zip" "file_name" should get the file path to your "zip" archive. This path likely ends in "ks.zip" but likely has a prefix -- either to form an "absolute" path (one starting with "/") or a relative path starting from the "current working directory". > ... > # opening the zip file in READ mode > with ZipFile(file_name, 'r') as zip: In the "with" block, "zip" is a "ZipFile Object". Read its documentation in the "zipfile" module documentation. Especially look at "namelist" (this give you the member names of the archive) and "open" or "read". The members of a folder in the "zip" archive will be charaterized by a name prefix, ending in the folder name followed by "/". There may (or may not) be a prefix before the folder name. -- https://mail.python.org/mailman/listinfo/python-list
Re: Error while using suds: suds.TypeNotFound: Type not found
[email protected] writes: > ... > I want to consume the web services described in the following: > > https://login.keyinvoice.com/API3_ws.php?wsdl > > I am using python 3.5.x and suds version 0.6. What I tried 1 > > from suds.client import Client > url = 'https://login.keyinvoice.com/API3_ws.php?wsdl' > client = Client(url) > > Error: > > suds.TypeNotFound: Type not found: '(Array, http://www.w3.org/2001/XMLSchema, > )' "TypeNotFound" typically indicates a WSDL error, more precisely an error in the XML schema part of the WSDL (defining the used types). It means that a type is referenced which "suds" cannot find. In the above case, "suds" has not found the type "Array" in the XML schema specified by "http://www.w3.org/2001/XMLSchema";. "https://www.w3.org/TR/xmlschema-2/#datatype-components"; is the specification for "http://www.w3.org/2001/XMLSchema"; and indeed, it does not mention a type "Array". Thus, "suds" seems to be correct in not finding the type. -- https://mail.python.org/mailman/listinfo/python-list
