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

Problem: Relative Path Importing #28

Closed
VeNoMouS opened this issue Aug 8, 2020 · 3 comments
Closed

Problem: Relative Path Importing #28

VeNoMouS opened this issue Aug 8, 2020 · 3 comments

Comments

@VeNoMouS
Copy link

VeNoMouS commented Aug 8, 2020

If you attempt to do the following in a httpimport'd file

from .file import classname

it results in the error

ImportError: cannot import name 'classname' from package.file
File "/usr/local/lib/python3.7/dist-packages/httpimport.py", line 254, in load_module
    exec(final_src, mod.__dict__)
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python3.7/dist-packages/httpimport.py", line 254, in load_module
    exec(final_src, mod.__dict__)
  File "<string>", line 26, in <module>
  File "/usr/local/lib/python3.7/dist-packages/httpimport.py", line 254, in load_module
    exec(final_src, mod.__dict__)
  File "<string>", line 1, in <module>

https://www.python.org/dev/peps/pep-0328/

Yet....

if you import again right after it fails... it imports correctly....

@VeNoMouS VeNoMouS changed the title Cannot import sub classes Relative Path Importing Aug 8, 2020
@VeNoMouS VeNoMouS changed the title Relative Path Importing Problem: Relative Path Importing Aug 8, 2020
@operatorequals
Copy link
Owner

Can you please provide some example to reproduce this?

@VeNoMouS
Copy link
Author

are you kidding me? 2 years to reply to a ticket?

@operatorequals
Copy link
Owner

Sometimes it takes 2 years :)

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

2 participants