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

[Bug]: Runtime error on importing ivy #10622

Closed
4 tasks
nikifaets opened this issue Feb 17, 2023 · 1 comment
Closed
4 tasks

[Bug]: Runtime error on importing ivy #10622

nikifaets opened this issue Feb 17, 2023 · 1 comment
Assignees
Labels
Bug Report Report bugs detected in Ivy.

Comments

@nikifaets
Copy link
Contributor

nikifaets commented Feb 17, 2023

Bug Explanation

Ivy cannot be imported due to runtime error coming from ast_helpers.py. I believe it has been introduced in this PR: #10327

Steps to Reproduce Bug

Code to reproduce:

>>> import ivy
Error in sys.excepthook:
Traceback (most recent call last):
  File "/home/nikifaets/code/ivy/ivy/exceptions.py", line 41, in _custom_exception_handle
    trace_mode = ivy.get_exception_trace_mode()
AttributeError: module 'ivy' has no attribute 'get_exception_trace_mode'

Original exception was:
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/nikifaets/code/ivy/ivy/__init__.py", line 708, in <module>
    from ivy.utils.backend import (
  File "/home/nikifaets/code/ivy/ivy/utils/__init__.py", line 2, in <module>
    from . import backend
  File "/home/nikifaets/code/ivy/ivy/utils/backend/__init__.py", line 2, in <module>
    from . import handler
  File "/home/nikifaets/code/ivy/ivy/utils/backend/handler.py", line 12, in <module>
    from ivy.utils.backend import ast_helpers
  File "/home/nikifaets/code/ivy/ivy/utils/backend/ast_helpers.py", line 32, in <module>
    local_modules = _retrive_local_modules()
  File "/home/nikifaets/code/ivy/ivy/utils/backend/ast_helpers.py", line 21, in _retrive_local_modules
    for entry in os.scandir(wd):
FileNotFoundError: [Errno 2] No such file or directory: ''

When running the Python interpreter from a virtual env, outside dev docker container:

  • I observe this is only happens when starting a Python interpreter from the project root folder, ivy/.
  • It imports fine when I run the interpreter from an arbitrary other directory, e.g. /home, ivy/ivy, ivy/ivy/utils.

When I run the Python interpreter inside the Ivy dev container:

  • The error is hit no matter in which directory I open the Python interpreter

Environment

Linux, Dev Container, conda environment

Ivy Version

1.1.9

Backend

  • NumPy
  • TensorFlow
  • PyTorch
  • JAX

Device

No response

@nikifaets nikifaets added the Bug Report Report bugs detected in Ivy. label Feb 17, 2023
@CatB1t CatB1t self-assigned this Feb 18, 2023
@CatB1t
Copy link
Contributor

CatB1t commented Feb 19, 2023

Hello @nikifaets, thank you for taking the time to report the issue! fixed in 19eabcb

@CatB1t CatB1t closed this as completed Feb 19, 2023
rishabgit added a commit to rishabgit/ivy that referenced this issue Feb 19, 2023
vedpatwardhan pushed a commit to vedpatwardhan/ivy that referenced this issue Feb 23, 2023
vedpatwardhan pushed a commit to vedpatwardhan/ivy that referenced this issue Feb 23, 2023
vedpatwardhan pushed a commit to vedpatwardhan/ivy that referenced this issue Feb 26, 2023
vedpatwardhan pushed a commit to vedpatwardhan/ivy that referenced this issue Feb 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Report Report bugs detected in Ivy.
Projects
None yet
Development

No branches or pull requests

3 participants