当前位置:   article > 正文

python输入python显示未定义_python NameError:全局名称'__file__'未定义 - python

py中writefile没有定义

当我在python 2.7中运行此代码时,出现此错误:

Traceback (most recent call last):

File "C:\Python26\Lib\site-packages\pyutilib.subprocess-3.5.4\setup.py", line 30, in

long_description = read('README.txt'),

File "C:\Python26\Lib\site-packages\pyutilib.subprocess-3.5.4\setup.py", line 19, in read

return open(os.path.join(os.path.dirname(__file__), *rnames)).read()

NameError: global name '__file__' is not defined

代码是:

import os

from setuptools import setup

def read(*rnames):

return open(os.path.join(os.path.dirname(__file__), *rnames)).read()

setup(name="pyutilib.subprocess",

version='3.5.4',

maintainer='William E. Hart',

maintainer_email='wehart@sandia.gov',

url = 'https://software.sandia.gov/svn/public/pyutilib/pyutilib.subprocess',

license = &#

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/代码探险家/article/detail/904040
推荐阅读
相关标签
  

闽ICP备14008679号