question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ImportError: cannot import name rnn_compat

See original GitHub issue

When I import apex after the installation (finished with success) I get this error:

Python 2.7.15rc1 (default, Nov 12 2018, 14:31:15) 
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import apex
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "apex/__init__.py", line 2, in <module>
    from . import amp
  File "apex/amp/__init__.py", line 1, in <module>
    from .amp import init, half_function, float_function, promote_function,\
  File "apex/amp/amp.py", line 1, in <module>
    from . import compat, rnn_compat, utils, wrap
  File "apex/amp/rnn_compat.py", line 1, in <module>
    from . import utils, wrap
  File "apex/amp/wrap.py", line 4, in <module>
    from . import rnn_compat
ImportError: cannot import name rnn_compat

torch version 1.0.0.dev20190322 Python 2.7.15rc1 cuda 10

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
MahmoudElkhateebcommented, Sep 15, 2019

The solution for me is import rnn_compat
(instead of from . import rnn_compat)

0reactions
mcarillicommented, May 24, 2019

Please reopen if the problem continues with python 3+.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix ImportError: Cannot Import Name in Python - Rollbar
The Python ImportError: cannot import name error occurs when an imported class is not accessible or is in a circular dependency.
Read more >
ImportError: cannot import name rnn_compat #781 - GitHub
Questions and Help when i run 'python webcam.py --min-image-size 300 MODEL.DEVICE cpu ', it shows: Traceback (most recent call last): File ...
Read more >
What can I do about "ImportError: Cannot import name X" or ...
You have circular dependent imports. physics.py is imported from entity before class Ent is defined and physics tries to import entity that is...
Read more >
How to Fix : “ImportError: Cannot import name X” in Python?
You can solve the “ ImportError : Cannot import name X” Error by resolving the circular dependencies. You can do that either by...
Read more >
Why Python Package Manager gives error as "ImportError
How to resolve the following error message when running any pip3 commands ... ImportError: cannot import name 'InvalidSchemeCombination' ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found