-
Notifications
You must be signed in to change notification settings - Fork 42
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 'somePython' when using remote_repo #25
Comments
Well, the Gitlab is a bit of a pain, and it has some known bugs. It works for some repos but not for all and it has to be re-examined and relaunched. Yet, the code snippet you are posting does not work and there are reasons for that:
from httpimport import github_repo
import httpimport
with github_repo('BillMills', 'python-package-example', module='myPackage'):
import myPackage.somePython but this fails also with the following error: Traceback (most recent call last):
File "test2.py", line 7, in <module>
import myPackage.somePython
File "/Users/johntorakis/.virtualenvs/httpimport/lib/python3.7/site-packages/httpimport.py", line 254, in load_module
exec(final_src, mod.__dict__)
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'somePython' the My bet is that if you replace this line with Why your code failsthe URL you are using makes If you replace the code with: with remote_repo(['somePython'], 'https://raw.githubusercontent.com/BillMills/python-package-example/master/myPackage/'):
import somePython it will work. For me it was: >>> from httpimport import remote_repo
>>> import httpimport
>>> with remote_repo(['somePython'], 'https://raw.githubusercontent.com/BillMills/python-package-example/master/myPackage/'):
... import somePython
...
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
File "/Users/johntorakis/.virtualenvs/httpimport/lib/python3.7/site-packages/httpimport.py", line 254, in load_module
exec(final_src, mod.__dict__)
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'numpy' as |
Closing due to inactivity! |
I have run that code but i still have error in importing this is my repo link and this is my code
And i am getting this error:
Can you tell me what's the problem |
You are having a Python error, not related with with httpimport.github_repo('AKHACKER-program4hack', 'searcher', branch='master'):
import searcher.forsearch
s = searcher.forsearch.Searcher()
s.printuser() This works for me! |
I can't seem to get remote_repo to work. I've tried accessing modules in my private Gitlab instance and an example module in Github. I keep getting "No module named x" error. I assume it has something to do with my code but I've tried a few different iterations with no luck. It would be nice to see a working example in the readme that pulls from a publicly available python package. The load() method also can't seem to find the module.
Here's a snippet.
The text was updated successfully, but these errors were encountered: