【发布时间】:2019-12-27 14:56:27
【问题描述】:
每次我尝试将我的 python 代码执行到 Python 交互窗口时,我都会收到以下错误...
Executing code failed : Error: Activating Python 3.7.3 64-bit ('base': conda) to run Jupyter failed with Error:
Command failed: "H:/My Documents/Continuum/anaconda3/Scripts/activate" && conda activate base &&
echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python
c:/Users/paul.victor/.vscode/extensions/ms-python.python-2019.11.50794/pythonFiles/printEnvVariables.py python:
can't open file 'H:\My': [Errno 2] No such file or directory .
我有一种感觉,我应该尝试将安装在 C 驱动器中的 vscode/python 扩展重新映射到保存我的 anaconda 的位置,即 H 驱动器,但我不确定如何在vs 代码设置。任何帮助将不胜感激。
跟进原创
user8408080 是正确的,删除空间确实有帮助。我还将 anaconda 环境的路径修改为我的公司驱动命名法,
而不是 H:它使用了类似 \\company\user...
现在我修复了它引发的另一个错误,即即使路径正确,系统也找不到指定的路径。
Executing code failed : Error: Activating Python 3.7.3 64-bit ('base': conda) to run
Jupyter failed with Error: Command failed:\\apachecorp.com\files\SanAntonio\Home\Paul.Victor\Documents\Continuum\anaconda3\Scripts\activate base &&
echo 'e8b39361-0157-4923-80e1-22d70d46dee6' &&
python c:/Users/paul.victor/.vscode/extensions/ms-python.python-2019.11.50794/pythonFiles/printEnvVariables.py The system cannot find the path specified. .
【问题讨论】:
-
看来您需要转义目录名称中的空格。名称中的空格总是把事情搞砸
-
如果系统说它找不到路径,那么它很可能至少在某些方面是正确的。首先要确定该文件存在于正确的计算机上,路径为
c:/Users/paul.victor/.vscode/extensions/ms-python.python-2019.11.50794/pythonFiles/printEnvVariables.py。其次,检查权限可能是个好主意 -
确实存在。这里奇怪的是它工作了几个月然后突然停止工作。我不确定它最近是否有更新或什么。