草庐IT

site-package

全部标签

python - Python 中 "__package__"属性的用途是什么?

我只想知道__package__到底是什么意思?在官方文档中没有找到任何解释,即使在SO上也是如此。如果你能提供一些例子,我会很高兴。 最佳答案 见PEP366和importsystemreferencedocumentation:Themajorproposedchangeistheintroductionofanewmodulelevelattribute,__package__.Whenitispresent,relativeimportswillbebasedonthisattributeratherthanthemodul

python - 错误 : could not create '/Library/Python/2.7/site-packages/xlrd' : Permission denied

我正在尝试在mac10.8.4上安装xlrd,以便能够通过python读取excel文件。我已按照http://www.simplistix.co.uk/presentations/python-excel.pdf上的说明进行操作我这样做了:解压文件夹到桌面在终端中,cd到解压后的文件夹$pythonsetup.pyinstall这是我得到的:runninginstallrunningbuildrunningbuild_pycreatingbuildcreatingbuild/libcreatingbuild/lib/xlrdcopyingxlrd/__init__.py->build

python - 通过 pip : this package requires Python 3. 3 或更高版本为 python 2.7 安装 py2exe

>>>python-c"importsys;printsys.version"2.7.6(default,Nov102013,19:24:18)[MSCv.150032bit(Intel)]>>>pip--versionpip1.5.5fromC:\Python27\lib\site-packages(python2.7)>>>pipinstallpy2exeRuntimeError:ThispackagerequiresPython3.3orlater虽然是官方的py2exedownloadpage说他们有我需要的东西:那么如何通过pip安装py2exe?

python - PyPi 问题 - 上传失败 (401) : You must be identified to edit package information

这个问题在这里已经有了答案:"setup.pyupload"isfailingwith"Uploadfailed(401):Youmustbeidentifiedtoeditpackageinformation"(7个回答)关闭9年前。我遇到了类似于this的pypi问题一,除了我正在运行windows并且提到的解决方案页面已关闭。有谁知道如何解决这个问题?我正在使用python2.5。pythonsetup.pysdistregisteruploadrunningregisterWeneedtoknowwhoyouare,sopleasechooseeither:1.useyoure

python - pip 安装 pygraphviz : No package 'libcgraph' found

我成功安装了graphviz和cgraphwith$sudopipinstallgraphviz....Successfullyinstalledgraphviz-0.5.1$sudopipinstallcgraph...Successfullyinstalledcgraph-0.1我在运行sudopipinstallpygraphviz时遇到问题Nopackage'libcgraph'found。下面是完整的堆栈跟踪。$sudopipinstallpygraphvizThedirectory'/Users/sparkandshine/Library/Caches/pip/http'o

python - 无法从 site-packages 目录加载通过 pip 安装的 Python 模块

我正在尝试安装和使用Evernote模块(https://github.com/evernote/evernote-sdk-python)。我运行了pipinstallevernote,它说安装成功了。我可以确认evernote模块存在于/usr/local/lib/python2.7/site-packages中。但是,当我尝试运行python-c"importevernote"时,出现以下错误:Traceback(mostrecentcalllast):File"",line1,inImportError:Nomodulenamedevernote这是我的.bash-profile

python - 错误 : could not create '/usr/local/lib/python2.7/dist-packages/virtualenv_support' : Permission denied

我正在使用ubuntu12.04,我正在尝试pipinstallvirtualenv但突然出现此错误。samuel@sampc:~$pipinstallvirtualenvDownloading/unpackingvirtualenvRunningsetup.pyegg_infoforpackagevirtualenvwarning:nopreviously-includedfilesmatching'*'foundunderdirectory'docs/_templates'warning:nopreviously-includedfilesmatching'*'foundunder

python - 为什么 pip freeze 会报告使用 --no-site-packages 创建的新 virtualenv 中的一些包?

当我创建一个新的virtualenv时,pipfreeze显示我安装了几个包,即使我没有在环境中安装任何东西。我期待pipfreeze在我第一次pipinstall进入环境之前返回空输出。wsgirefispartofthestandardlibrary不是吗,为什么它会出现呢?day@garage:~$mkdirtestingday@garage:~$cdtestingday@garage:~/testing$virtualenv--no-site-packages.Newpythonexecutablein./bin/pythonInstallingdistribute......

Python "from [dot]package import ..."语法

这个问题在这里已经有了答案:Whatdoesa.inanimportstatementinPythonmean?(3个回答)关闭4年前。社区审核了是否重新打开这个问题2个月前并关闭:原始关闭原因未解决浏览一个Django教程,我看到了以下语法:from.modelsimportRecipe,Ingredient,Instruction有人可以解释.models是如何工作的/它到底是做什么的吗?通常我有:frommyapp.modelsimport如果没有.models前面的myapp部分,它如何工作? 最佳答案 .是一个快捷方式,告

python - pip 抛出 TypeError : parse() got an unexpected keyword argument 'transport_encoding' when trying to install new packages

我正在使用最新版本的Anaconda3。我刚刚安装了它,我正在尝试下载一些软件包。我正在使用Anaconda提示。在尝试使用pip做任何事情(包括升级现有软件包)时,我得到以下回溯。Exception:Traceback(mostrecentcalllast):File"C:\Users\csprock\Anaconda3\lib\site-packages\pip\basecommand.py",line215,inmainstatus=self.run(options,args)File"C:\Users\csprock\Anaconda3\lib\site-packages\pi