ult*_*ine 10 python swig anaconda python-importlib jupyter-notebook
我在Anaconda环境中安装了BreakoutDetection模块.当我尝试import breakout_detection
在jupyter笔记本中导入模块时,我得到以下错误
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-18-96c0fdb15b96> in <module>()
----> 1 import breakout_detection
C:\Users\sgadiyar\AppData\Local\Continuum\Anaconda2\lib\site-packages\breakout_detection.py in <module>()
15 except ImportError:
16 return importlib.import_module('_breakout_detection')
---> 17 _breakout_detection = swig_import_helper()
18 del swig_import_helper
19 elif _swig_python_version_info >= (2, 6, 0):
C:\Users\sgadiyar\AppData\Local\Continuum\Anaconda2\lib\site-packages\breakout_detection.py in swig_import_helper()
14 return importlib.import_module(mname)
15 except ImportError:
---> 16 return importlib.import_module('_breakout_detection')
17 _breakout_detection = swig_import_helper()
18 del swig_import_helper
C:\Users\sgadiyar\AppData\Local\Continuum\Anaconda2\lib\importlib\__init__.pyc in import_module(name, package)
35 level += 1
36 name = _resolve_name(name[level:], package, level)
---> 37 __import__(name)
38 return sys.modules[name]
ImportError: DLL load failed: The specified procedure could not be found.
Run Code Online (Sandbox Code Playgroud)
我可以在python shell中导入相同的模块
我查看了系统路径(print sys.path
)以及python shell和jupyter笔记本.它们都是一样的.print sys.executable
两者的可执行路径()也是相同的.
有人可以帮我解决这个问题我应采取的步骤吗?谢谢!
pic*_*klu 35
我遇到了从PowerShell运行jupyter笔记本时遇到的同样问题.尽管这个问题是在一年前提出的,但我在这里回答这个问题是为了帮助那些最近遇到同样错误的人.在我的情况下,首先,我激活了根环境,activate base
然后我跑了jupyter notebook
,它工作得很好.激活基础后,您会注意到提示将改变为"(基本)X:\ Users\xxxxx\current-directory-name>".
请注意,该命令activate base
不适用于Powershell.您必须切换到命令提示符运行,cmd
或者您可以在命令提示符而不是PowerShell上尝试整个操作.
如果PowerShell环境可以使用所需的路径
(path:\to\Anaconda3\;path:\to\Anaconda3\Scripts;path:\to\Anaconda3\Library\mingw-w64\bin;path:\to\Anaconda3\Library\usr\bin;path:\to\Anaconda3\Library\bin
),则无需
激活"基础"环境.
Dhe*_*raj 15
在Windows中,首先在命令提示符下激活root(base)
activate root
Run Code Online (Sandbox Code Playgroud)
然后
jupyter notebook
Run Code Online (Sandbox Code Playgroud)
小智 6
我最近将 Anaconda 重新安装到一个新目录(从 D: 到 C:)。之后,打开并运行 PowerShell(在 Windows 10 中)导致它抛出相同的错误。
通过遵循@picklu 的回答,我可以从 CMD 临时运行它(通过运行“激活基础”然后运行“jupyter notebook”)。即使是“激活根”也能代替激活基。同样从 conda 提示符、anaconda 导航器和 Jupyter Notebook 的默认快捷方式运行它。但是,使用这些方法时,我无法从打开 PowerShell 窗口的文件夹开始(使用 Ctrl+Shift+mouseRightCLick)。
但是,通过遵循@picklu 答案的第二部分,我能够成功地将系统变量 PATH 从旧的 D: 驱动器更改为当前的 C: 。
我添加了以下内容:
其中 c:\users\USERNAME\anaconda3 是 anaconda 安装位置。
小智 5
如果您已经将 anaconda 添加到 PATH 变量,那么您必须执行以下操作
activate base
jupyter kernelspec list
python -m ipykernel install --user
它对我有用
归档时间: |
|
查看次数: |
18068 次 |
最近记录: |