构造函数是“调用”与构造函数是“执行”?(Constructor is “invoked” vs. Constructor is “executed”?)
构造函数调用和构造函数执行之间有什么区别? 我正在阅读james Gosling的java编程语言中的构造函数顺序依赖。作者指出,当你创建一个对象构造函数时,首先调用,然后使用feild成员最终执行costructor.Both听起来和我一样。
What is the difference betweeen constructor invocation and constructor execution? I am reading about constructor order dependecies from java programming langauage by james Gosling.The author states that when you create an object constructor is first invoked, then feild members are intialized finally costructor is executed.Both sounds the same to me.
原文:https://stackoverflow.com/questions/22394276
更新时间:2023-05-31 20:05
最满意答案
尝试手动更新设置工具。
wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py sudo python ez_setup.py --user
Try updating your setup tools manually.
wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py sudo python ez_setup.py --user
相关问答
更多-
这里的许多答案都是2015年过期的(尽管丹尼尔·罗斯曼最初接受的答案不是)。 这是现在的状态: 二进制包现在以轮子( .whl文件)的形式发布 - 不仅仅是在PyPI上,而是在第三方存储库中,如Christoph Gohlke的Windows扩展包 。 pip可以处理轮子; easy_install不行。 虚拟环境(内置3.4,或可以添加到2.6 + / 3.1 +与virtualenv )已经成为一个非常重要和突出的工具(并在官方文档中推荐); 它们包括开箱即用,但是甚至不能通过easy_install正 ...
-
如果你这样做,那么它将工作: cd /usr/local/lib/python2.7/site-packages && ls 找到目录中的pip-1.4.1-py2.7.egg-info和distribute-0.6.49-py2.7.egg 。 那么以下步骤解决了这个问题: 在/usr/local/bin/pip中将pip版本更改为1.4.1 在/usr/local/bin/easy_install中将分发版本更改为0.6.49 If you do this then it will work: cd ...
-
通常,您只安装了一个版本的python发行版。 由于2.5.1和2.5.4来自同一版本,因此复制库应该可以正常工作。 您需要注意的是,您现在在路径中有/ usr / bin / python和/ usr / local / bin / python,并且某些实用程序可能会混淆。 如果您需要同时安装两个微版本,我会完全保留2.5.4的路径,或者让它完全破坏另一个(尽管这样做会自行承担风险;)如果你选择前者,您还可以使用PYTHONPATH环境变量将2.5.4指向您的站点包。 Ubuntu采用不同的路线,这就是 ...
-
Easy_install问题(Easy_install issues)[2023-11-07]
这应该工作: curl https://bootstrap.pypa.io/ez_setup.py -s | python 除非重定向,否则cURL会将收到的正文输出到STDOUT,因此您不必传递-o - (根据文档,它实际上不应该做任何事情)。 您应该传递-s以抑制进度表和任何错误。 然后将它直接导入python 。 没有其他参数, python会将STDIN确定为要执行的脚本的源。 This should work: curl https://bootstrap.pypa.io/ez_setup.py ... -
错误使用pip安装任何模块,但easy_install正常工作(Error Installing any module using pip, but easy_install works)[2022-03-30]
我在这里找到了一个潜在的解 这里是相关的报价: “发生这种情况是因为Ubuntu 12.04(这是我的服务器的操作系统)有一个旧的pyOpenSSL库,它不接受属性'set_tlsext_host_name'对于修复,你需要添加依赖pyOpenSSL > = 0.13在Ubuntu上更新pyOpenSSL使用pip ,安装libffi-dev并通过apt删除python-openssl “。 $ sudo apt-get purge python-openssl $ sudo apt-get install ... -
easy_install是否与python2和python3不同?(easy_install is different for python2 and python3 or not?)[2022-12-28]
sudo apt-get install python-setuptools 安装Python的setuptools 2.对于Python 3,命令是 sudo apt-get install python3-setuptools 至于virtualenv - 您可以为一个Python安装它,但使用any: virtualenv --python python3.4 即使virtualenv适用于Python 2.7或3.6。 sudo apt-get install python-setuptool ... -
Christoph Gohlke 在这里提供了预构建的Windows安装程序,包括scipy。 最好的办法是使用其中一个,原因是从源代码安装scipy,numpy和matplotlib需要构建大多数Windows机器都没有编译器的C和Fortran扩展。 另外还有一些包含python和一些其他工具的预编译关系: Anaconda :SciPy堆栈的免费发行版。 支持Linux,Windows和Mac。 Enthought Canopy :免费和商业版本包括核心SciPy堆栈包。 支持Linux,Window ...
-
我完全修改了我的python安装! 现在它正在发挥作用。 我不知道发生了什么但是stackoverflow用户首先关心解决问题......这就是我所做的: 清除python3的每一条路径......请注意这个命令 ,它们会吹你的PYTHON3安装。 sudo apt-get remove python3 sudo apt-get remove python3.2* sudo apt-get remove python3.3* sudo apt-get remove python3.4* sudo apt-g ...
-
python - easy_install在分发升级后停止工作(python - easy_install stops working after distribute upgrade)[2023-12-15]
尝试手动更新设置工具。 wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py sudo python ez_setup.py --user Try updating your setup tools manually. wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py sudo python ez_setup.py --user -
easy_install的文档很简单。 请参阅升级包 。 升级软件包不需要做任何特殊操作:只需通过请求特定版本安装新版本,例如: easy_install "SomePackage==2.0" 所以这应该做到这一点: easy_install "Sphinx==1.6.5" 另请参阅使用easy_install 卸载软件包 。 如果要删除当前安装的软件包版本(或软件包的所有版本),则应首先运行: easy_install -m PackageName 这将确保Python不会继续搜索您计划删除的软件包 ...