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

ImportError: No module named 'mapping' #6

Closed
sorrat opened this issue Nov 3, 2016 · 9 comments
Closed

ImportError: No module named 'mapping' #6

sorrat opened this issue Nov 3, 2016 · 9 comments

Comments

@sorrat
Copy link

sorrat commented Nov 3, 2016

python 3.5.2
cyrtranslit-0.3

Traceback:

>>> import cyrtranslit
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "[...]/lib/python3.5/site-packages/cyrtranslit/__init__.py", line 2, in <module>
    from mapping import TRANSLIT_DICT
ImportError: No module named 'mapping'
@rspeer
Copy link

rspeer commented Dec 16, 2016

I have the same problem. Looks like it's meant to import the local module .mapping.

@georgeslabreche
Copy link
Collaborator

georgeslabreche commented Dec 17, 2016

Yes, it's meant to import TRANSLIT_DICT from mapping.py.

How did you install it? I just opened Terminal and did the following:

python -m pip install cyrtranslit 
python
>>> import cyrtranslit
>>> cyrtranslit.supported()
['me', 'sr', 'mk', 'ru']

However, I am using Python 2.7.10 whereas @sorrat is using 3.5.2. Which version are you using @rspeer?

@sorrat
Copy link
Author

sorrat commented Dec 17, 2016

The library does not support python3:

  • no relative imports
  • iteritems

@rspeer
Copy link

rspeer commented Jan 7, 2017

Also using 3.5.2, and yes, the problems are what sorrat described.

I assumed that Python 3 would be fine because there are versions of Python 3 listed in the setup.py.

@georgeslabreche
Copy link
Collaborator

georgeslabreche commented Feb 12, 2017

@sorrat @rspeer here's an abstract of the issue:
http://legacy.python.org/dev/peps/pep-0469/#abstract

To fix this, we need to update mapping.py and replace every instance of d.iteritems() with iter(d.items()):

Furthermore, list comprehension is not supported in Python 2.6 so I will remove that version from the supported Python version list in setup.py.

Here's the pull request for the fix currently on the python3-iteritems-fix branch.

If someone can confirm that it now works with their Python 3 environment then I will happily merge the pull request to master and release this new version to PyPI.

@georgeslabreche
Copy link
Collaborator

Still need to resolve issue #8 raised by @savagej.

georgeslabreche pushed a commit that referenced this issue Feb 18, 2017
Issue #6: updated dictionary iteration logic to ensure compatibility …
@georgeslabreche
Copy link
Collaborator

@sorrat @rspeer, the master branch is now the candidate release for version 0.4 to PyPI. Let me know if it looks good on your end.

@sorrat
Copy link
Author

sorrat commented Feb 18, 2017

@georgeslabreche no issues found.

@georgeslabreche
Copy link
Collaborator

@sorrat @rspeer: CyrTranslit v0.4 has been uploaded to PyPI: https://pypi.python.org/pypi/cyrtranslit
Thank you all for your help.

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