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

No module named 'ConfigParser' #25

Closed
Tset-Noitamotua opened this issue Oct 25, 2016 · 3 comments
Closed

No module named 'ConfigParser' #25

Tset-Noitamotua opened this issue Oct 25, 2016 · 3 comments

Comments

@Tset-Noitamotua
Copy link

I tried to run clientStfcStructure.py (with Python 3.5.2 - 64bit) which resulted in:

Traceback (most recent call last):
  File "clientStfcStructure.py", line 5, in <module>
    from ConfigParser import ConfigParser
ImportError: No module named 'ConfigParser'

Then I install "ConfigParser" with pip install ConfigParser which gave me configparser (3.5.0). Then I tried to run clientStfcStructure.py again getting the same error as above.

After renaming from ConfigParser to from configparser in line 5 of clientStfcStructure.py I get next error:

Traceback (most recent call last):
  File "clientStfcStructure.py", line 35, in <module>
    main()
  File "clientStfcStructure.py", line 31, in main
    result = conn.call('STFC_STRUCTURE', IMPORTSTRUCT=imp)
  File "pyrfc\_pyrfc.pyx", line 359, in pyrfc._pyrfc.Connection.call (pyrfc\_pyrfc.c:4065)
  File "pyrfc\_pyrfc.pyx", line 1531, in pyrfc._pyrfc.fillFunctionParameter (pyrfc\_pyrfc.c:17862)
  File "pyrfc\_pyrfc.pyx", line 1632, in pyrfc._pyrfc.fillVariable (pyrfc\_pyrfc.c:19179)
  File "pyrfc\_pyrfc.pyx", line 1568, in pyrfc._pyrfc.fillVariable (pyrfc\_pyrfc.c:18346)
  File "pyrfc\_pyrfc.pyx", line 1543, in pyrfc._pyrfc.fillStructureField (pyrfc\_pyrfc.c:17977)
  File "pyrfc\_pyrfc.pyx", line 1632, in pyrfc._pyrfc.fillVariable (pyrfc\_pyrfc.c:19179)
  File "pyrfc\_pyrfc.pyx", line 1579, in pyrfc._pyrfc.fillVariable (pyrfc\_pyrfc.c:18493)
  File "pyrfc\_pyrfc.pyx", line 1639, in pyrfc._pyrfc.fillBytes (pyrfc\_pyrfc.c:19306)
TypeError: ('expected bytes, str found', 'RFCHEX3', 'IMPORTSTRUCT')
@Tset-Noitamotua
Copy link
Author

The second error mentioned above is related to Python 3 uncompatibility of the code.

Running with Python 2.7.12 (64bit) the result is as expected:

[PYTHON_2764] λ python clientStfcStructure.py
{u'ECHOSTRUCT': {u'RFCCHAR1': u'a',
                 u'RFCCHAR2': u'ij',
                 u'RFCCHAR4': u'bcde',
                 u'RFCDATA1': u'kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk',
                 u'RFCDATA2': u'llllllllllllllllllllllllllllllllllllllllllllllllll',
                 ...

@I057542
Copy link

I057542 commented Dec 8, 2017

I encountered the same issue, and I changed the code:

from ConfigParser import ConfigParser
to
from configparser import ConfigParser

and it works on python 3.6

bsrdjan added a commit that referenced this issue Dec 8, 2017
@bsrdjan
Copy link
Member

bsrdjan commented Dec 8, 2017

Thanks @Tset-Noitamotua and @I057542, is fixed.

bsrdjan added a commit that referenced this issue Oct 4, 2019
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

No branches or pull requests

3 participants