草庐IT

user_setup

全部标签

python setup.py sdist 错误 : Operation not permitted

我正在尝试创建一个python源包,但是在为文件创建硬链接(hardlink)时它失败了。$pythonsetup.pysdistrunningsdistrunningcheckreadingmanifesttemplate'MANIFEST.in'writingmanifestfile'MANIFEST'makinghardlinksinfoo-0.1...hardlinkingREADME.txt->foo-0.1error:Operationnotpermitted我尝试使用sudo运行该命令,但它会产生相同的错误。这也会产生同样的错误:lnfoobar我正在使用vbox运行ub

python - Pipenv vs setup.py

我正在尝试迁移到pipenv。我传统上使用setup.py和pip并做了pipinstall-e.将模块安装为一个包,这样我就可以实现东西比如frommyproject.xyz.abcimportmyClass从项目中的任何地方。如何使用pipenv实现类似的效果,并摆脱setup.py?注意:我使用的是python2.7。 最佳答案 更新:pipenv9.0.0是released,这应该允许您按预期使用pipenvinstall-e.。原答案:pipenvinstall-e有问题,一直是fixedinmaster(pullrequ

python - Django:WSGIRequest'对象在某些页面上没有属性 'user'?

如果用户登录或未登录,我想设置一个cookie。我的中间件:classUserStatus(object):defprocess_response(self,request,response):user_status=1ifrequest.user.is_authenticated()else0max_age=(20)*52*7*24*60*60#20years(Afterexpiry,cookiegetsdeleted)response.set_cookie(user_status_cookie,user_status,max_age)returnresponse在settings.

python - setup.py 用于依赖于 cython 和 f2py 的包

我想为一个python包创建一个setup.py脚本,其中包含几个依赖于cython和f2py的子模块。我曾尝试使用setuptools和numpy.distutils,但到目前为止都失败了:使用设置工具我能够使用setuptools编译我的cython扩展(并为包的其余部分创建安装)。但是,我一直无法弄清楚如何使用setuptools来生成f2py扩展。经过大量搜索,我只找到了相当古老的messageslikethisone声明必须使用numpy.distutils编译f2py模块。使用numpy.distutils我能够使用numpy.distutils编译我的f2py扩展(并为包

python - request.user 在 Django 中指的是什么?

我对Django中的request.user指的是什么感到困惑?它是引用auth_user表中的username字段还是引用User模型实例?我有这个疑问是因为我无法使用{{request.user.username}}或{{user.username}}访问模板中的电子邮件字段>.所以我在View文件中做了以下操作:userr=User.objects.get(username=request.user)并将userr传递给模板并以{{userr.email}}的形式访问电子邮件字段。虽然它可以工作,但我想弄清楚它。 最佳答案 r

python - 如何在没有 setup.py 的情况下安装 Python 模块?

我是Python新手,正在尝试安装此模块:http://www.catonmat.net/blog/python-library-for-google-search/目录下没有setup.py,但是有这些文件:BeautifulSoup.pybrowser.pyc__init__.pycsponsoredlinks.pyBeautifulSoup.pycgooglesets.pysearch.pytranslate.pybrowser.py__init__.pysearch.pyc谁能告诉我如何设置或使用这个模块? 最佳答案 在您的

python - 错误 : Setup script exited with error: command 'gcc' failed with exit status 1

当我尝试在Fedora14中的Python2.6下安装MySQL-python-1.2.3时出现以下错误。Fedora14默认带有Python2.7,而我正在从事一个在Python2.6中运行的项目,所以我无法将Python从2.6更新到2.7。_mysql.c:35:23:fatalerror:my_config.h:Nosuchfileordirectorycompilationterminated.error:command'gcc'failedwithexitstatus1完整的错误信息如下[root@localhostMySQL-python-1.2.2]#pythonset

python - 如何在 Python setup.py 脚本中将标志传递给 gcc?

我正在用C语言编写一个Python扩展,它需要CoreFoundation框架(除其他外)。这编译得很好:gcc-ofoofoo.c-frameworkCoreFoundation-frameworkPython(“-framework”是Apple专用的gcc扩展,但没关系,因为我一直在使用他们的特定框架)我如何告诉setup.py将此标志传递给gcc?我试过这个,但它似乎不起作用(它可以编译,但是当我尝试运行它时会提示undefinedsymbol):fromdistutils.coreimportsetup,Extensionsetup(name='foo',version='1

python - __init__() 得到了一个意外的关键字参数 'user'

我在创建用户时使用Django创建用户和对象。但是有一个错误__init__()得到了一个意外的关键字参数“用户”在view.py中调用register()函数时。功能是:defregister(request):'''signupview'''ifrequest.method=="POST":form=RegisterForm(request.POST)ifform.is_valid():username=form.cleaned_data["username"]email=form.cleaned_data["email"]password=form.cleaned_data["p

python - 如何在 setup.py 脚本中为 Python 扩展模块指定头文件?

如何在setup.py脚本中为Python扩展模块指定头文件?按如下方式将它们与源文件一起列出是行不通的。但我不知道在哪里列出它们。fromdistutils.coreimportsetup,Extensionfromglobimportglobsetup(name="Foo",version="0.1.0",ext_modules=[Extension('Foo',glob('Foo/*.cpp')+glob('Foo/*.h'))]) 最佳答案 在setup.py之外添加MANIFEST.in文件,内容如下:graftrelat