我刚开始使用Python,或者似乎无法建立我的工作目录,或者尝试打印某些内容时读取不正确。
我正在尝试打印“ Hello World”
Traceback (most recent call last):
File "C:\Users\noahs\AppData\Local\Programs\Python\Python37\lib\site-packages\IPython\core\interactiveshell.py", line 3296, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-2-41ca3e3a1438>", line 1, in <module>
runfile('D:/Desktop/Python/filename.py', wdir='D:/Desktop/Python')
File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.1.2\helpers\pydev\_pydev_bundle\pydev_umd.py", line 197, in runfile
pydev_imports.execfile(filename, global_vars, local_vars) # execute the script
File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.1.2\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 11, in execfile
stream = tokenize.open(file) # @UndefinedVariable
File "C:\Users\noahs\AppData\Local\Programs\Python\Python37\lib\tokenize.py", line 447, in open
buffer = _builtin_open(filename, 'rb')
PermissionError: [Errno 13] Permission denied: 'D:/Desktop/Python/filename.py'
我不确定这些多余的文件是什么,或者为什么我无法让Python打印此文件
答案 0 :(得分:0)
尝试以管理员模式运行Python控制台/ IDE。那应该解决。
这很可能是因为您为单个用户而不是计算机上的所有用户安装了Python。 :)