Skip to content

ipython notebook & script difference - loading DLLs #98

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

Closed
den-run-ai opened this issue Sep 8, 2015 · 3 comments
Closed

ipython notebook & script difference - loading DLLs #98

den-run-ai opened this issue Sep 8, 2015 · 3 comments

Comments

@den-run-ai
Copy link
Contributor

Did anyone notice the difference in loading .NET dlls between notebook and normal python scripts.

This works in notebook:

import clr
clr.AddReference(r"C:\path2dll\dotnetdll")

But in regular python scripts, the sys.path has to be appended with the path to DLL:

import clr
import sys
sys.path.append(r"C:\path2dll")
clr.AddReference("dotnetdll")
@den-run-ai
Copy link
Contributor Author

We compared sys.path, .NET version, clr.ListAssemblies and everything seems to be same. What is so special about the notebook?

@den-run-ai
Copy link
Contributor Author

@den-run-ai
Copy link
Contributor Author

the problem is resolved, pull request pending.

in interactive mode python interpreter appends empty string "" to sys.path. As a side effect of this the buggy AssemblyManager was loading assemblies from full path only in interpreter mode.

#102

fdanny added a commit to fdanny/pythonnet that referenced this issue Oct 12, 2015
tonyroberts added a commit that referenced this issue Oct 12, 2015
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