-
Notifications
You must be signed in to change notification settings - Fork 237
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
ImportError: No module named 'pyopencl.IPython' #41
Comments
Fixed (I believe) in 2bb0d72 by renaming to Thx, |
This is a Windows specific issue in try:
from distutils.command.build_py import build_py_2to3 as build_py
except ImportError:
# 2.x
from distutils.command.build_py import build_py
else:
# Monkey patch FixImport.probably_a_local_import
# to work around http://bugs.python.org/issue18477
from os.path import dirname, join, exists, sep, split, isdir
from os import listdir
def probably_a_local_import(self, imp_name):
if imp_name.startswith("."):
return False
imp_name = imp_name.split(".", 1)[0]
base_path = dirname(self.filename)
base_path = join(base_path, imp_name)
if not exists(join(dirname(base_path), "__init__.py")):
return False
path, filename = split(base_path)
if isdir(base_path) and filename in listdir(path):
return True
for ext in [".py", sep, ".pyc", ".so", ".sl", ".pyd"]:
if (filename + ext) in listdir(path):
return True
return False
from lib2to3.fixes.fix_import import FixImport
FixImport.probably_a_local_import = probably_a_local_import |
I see that the renaming to |
2bb0d72 does not work for me because the |
Too bad. Deleted in d3f3184. If this works (please let me know), I'll release 2014.1.1 soon so that as few people as possible start relying on |
The IPython extension has been called |
On Python 3.x for Windows
%load_ext pyopencl.ipython
fails withImportError: No module named 'pyopencl.IPython'
. Apparently the2to3
tool convertsfrom IPython.core.magic import ...
tofrom .IPython.core.magic import...
:The text was updated successfully, but these errors were encountered: