启动SublimeREPL -python时,发生“没有这样的文件或目录"错误 [英] “ No such file or directory” error happens when start SublimeREPL -python

查看:432
本文介绍了启动SublimeREPL -python时,发生“没有这样的文件或目录"错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每次我在sublimeREPL软件包中启动python时,它都会给我错误,已经有一个讨论此错误的分支,而官方文档提供了以下解决方案

Everytime I start the python within sublimeREPL package, it gives me the error,there has already been a branch of discussion of this error,and the offical document gives the following solution

    "If the binary is not in your system path and you can’t or won’t change that, tweak SublimeREPL configuration:"
{
...
"default_extend_env": {"PATH": "{PATH}:/home/myusername/bin"}
...
 } 

我已经更改了python解释器的安装路径,例如

I have changed the path to where the python interpreter is installed,say

    {

"default_extend_env": {"PATH": "{PATH}:\\Python34"}

    }

但是似乎不正确,所以我应该输入哪个路径名,python解释器路径还是sublimeREPL的路径?我该如何找到路径?谢谢

But it seems not correct, so which path name should I enter, the python interpreter path or sublimeREPL's path? And how can I find the path?Thank you

推荐答案

您需要编辑SublimeREPL配置文件之一以指向C:\Python34\python.exe.不过,首先,您应该将C:\Python34添加到系统的PATH变量中-如果您不知道如何将其添加到Google上.如果这不起作用(在重新启动Sublime Text之后),请执行以下操作:

You'll need to edit one of the SublimeREPL config files to point to C:\Python34\python.exe. First of all, though, you should add C:\Python34 to your system's PATH variable - google it if you don't know how. If that doesn't work (after restarting Sublime Text), do the following:

通过选择 Preferences -> Browse Packages... 打开Packages文件夹.在Windows资源管理器中打开Packages后,请依次打开SublimeREPL文件夹,config文件夹,Python文件夹,然后在Sublime中打开Main.sublime-menu(使用JSON语法突出显示).现在,在您看到"cmd"选项的任何位置,在以下方括号内,将"python"替换为"c:/python34/python.exe"(请记住,使用正斜杠/作为路径定界符).所以,这个:

Open your Packages folder by selecting Preferences -> Browse Packages.... Once Packages opens in Windows Explorer, open the SublimeREPL folder, then the config folder, then the Python folder, then open Main.sublime-menu in Sublime (use JSON syntax highlighting). Now, anywhere you see a "cmd" option, inside the following brackets replace "python" with "c:/python34/python.exe" (remember to use forward slashes / as the path delimiters). So, this:

"cmd": ["python", "-u", "$file_basename"],

应更改为:

"cmd": ["c:/python34/python.exe", "-u", "$file_basename"],

在带有"caption": "Python - IPython"的部分中,仅更改"cmd"字典中以"windows"开头的行(第71行).因此,总而言之,您应该更改第22、39、53和71行.完成后保存文件,重新启动Sublime,SublimeREPL现在应该可以在Python 3.4上使用

In the section with "caption": "Python - IPython", only alter the line in the "cmd" dict starting with "windows" (line 71). So, all in all, you should be altering lines 22, 39, 53, and 71. Save the file when you're done, restart Sublime, and SublimeREPL should now be working with Python 3.4

这篇关于启动SublimeREPL -python时,发生“没有这样的文件或目录"错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆