Tag: python 2.7

在Ubuntu 15.10上安装Google Protobuf

下载,构建和安装Google Protobuf后,我无法在Python中导入它 import google.protobuf 找不到模块。 打字 protoc –version 返回3。 关于如何解决此问题的任何建议? 我不想使用“pip install protobuf”,因为它安装2.6版本,我需要3。

错误:找不到输入文件:`man / Makefile.in’

我试图安装hdf4然后安装python-hdf4 。 我是Linux和Python的新手。 我需要阅读hdf文件。 我虽然需要安装pyhdf因为http://www.science-emergence.com/Articles/How-to-read-a-MODIS-HDF-file-using-python-/已经使用pyhdf模块读取pyhdf文件。 起初我尝试使用命令pip install pyhdf进行pip install pyhdf并得到错误: 找不到满足pyhdf要求的版本(来自版本):找不到pyhdf的匹配分布。 然后我下载了pyhdf-0.9.0并尝试安装它。 当我在安装hdf-4.2.12时尝试编译时,出现了错误: pyhdf/hdfext_wrap.c:3543:17: fatal error: hdf.h: No such file or directory 使用问题安装pyhdf错误搜索错误:hdf.h:没有这样的文件或目录我做的文件说: 我从http://support.hdfgroup.org/products/hdf4/下载了pyhdf。 然后我按照链接,下载了hdf-4.2.12 ,转到这个目录并尝试配置它。 只有这样我才得到以下错误: checking for a BSD-compatible install… /usr/bin/install -c checking whether build environment is sane… yes /home/mala/hdf-4.2.12/bin/missing: Unknown `–is-lightweight’ option Try `/home/mala/hdf-4.2.12/bin/missing –help’ for more information configure: WARNING: ‘missing’ script […]

ImportError:没有名为easydict的模块

我正在尝试基于这个GitHub页面运行py-faster-rcnn的演示。 我已经完成了之前的所有步骤。 但是当我尝试使用python ./tools/demo.py –gpu 0 –net vgg16运行演示时python ./tools/demo.py –gpu 0 –net vgg16我收到此错误: Traceback (most recent call last): File “./tools/demo.py”, line 17, in from fast_rcnn.config import cfg File “/home/hadi/Software/py-faster-rcnn/tools/../lib/fast_rcnn/config.py”, line 23, in from easydict import EasyDict as edict ImportError: No module named easydict 我用这两个命令安装了easydict: sudo pip install easydict pip install easydict 这与python路径有关吗? 我已经安装了python 2.7和3.5。 从那时起,我得到了所有这些与python相关的错误。 […]

如何更改python的默认空闲?

好的,我的系统上有python 3.5。 每当我打开.py文件时,Idle3启动,因此按F5将立即运行我的代码。 但是我现在需要python 2.7进行分配。 在终端我安装’空闲’所以,我可以轻松地打开空闲和空闲3。 我的问题是,我无法将我的.py文件的默认应用程序更改为空闲。 它只看到idle3,所以我无法打开我的文件,默认情况下空闲(2.7)。 那有什么简单的解决方法吗?

如何确定路由器的IP地址

我想通过编写python代码来确定我的路由器地址的ip。 我找到了这个建议: $ sudo easy_install netifaces Python 2.6.5 (r265:79063, Oct 1 2012, 22:04:36) … $ ipython … In [8]: import netifaces In [9]: gws=netifaces.gateways() In [10]: gws Out[10]: {2: [(‘192.168.0.254’, ‘eth0’, True)], ‘default’: {2: (‘192.168.0.254’, ‘eth0’)}} In [11]: gws[‘default’][netifaces.AF_INET][0] Out[11]: ‘192.168.0.254’ 和我在终端的结果: In [1]: import netifaces In [2]: gws=netifaces.gateways() ————————————————————————— AttributeError Traceback (most recent call […]

在Ubuntu上打破Python3 pip3安装

我在我的Ubuntu16.04上成功安装了python3和pip3,但pip3安装已损坏。 我该如何解决这个问题? pip3 install的错误信息如下: # pip3 install xlwt Traceback (most recent call last): File “/usr/bin/pip3”, line 9, in from pip import main File “/usr/lib/python3/dist-packages/pip/__init__.py”, line 21, in from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning ModuleNotFoundError: No module named ‘pip._vendor.requests’ 输出sudo -H pip3 install –upgrade pip sudo -H pip3 install –upgrade pip Traceback (most recent call last): File “/usr/bin/pip3”, […]

无法在Ubuntu 18.04上安装VMware Horizo​​n Client

sudo sh ./VMware-Horizon-Client-4.8.0-8518891.x64.bundle Extracting VMware Installer…done. /tmp/vmis.bxQxOU/install/vmware-installer/vmware-installer: line 76: python: command not found 编辑 :我按照这些步骤但仍然得到原始错误消息; sudo apt update sudo apt install python2.7 cd ~/Downloads sudo sh ./VMware-Horizon-Client-4.8.0-8518891.x64.bundle 相同的结果: 提取VMware Installer …完成。 /tmp/vmis.bxQxOU/install/vmware-installer/vmware-installer:line 76:python:command not found 尝试过4.7.0版本; 一样。

如何降级Python或使用多个版本?

我想使用Mozilla Jetpack和Google App Engine ,它们分别仅支持Python 2.6和2.5。 所以我想我必须安装2.5。 Ubuntu附带2.6。 我认为Ubuntu 11配备2.7? 我如何为不同的用法降级或安装单独的Python? 我想我读过,在Ubuntu使用它时卸载/降级Python不是一个好主意吗? 如果是这样,我该如何解决这个问题?

Python的Speechd?

我刚刚升级到Ubuntu 12.10,我正在使用一些Python代码。 在早期版本中,我曾经能够做到: import speechd 现在我知道模块不存在。 当我尝试安装python-speechd时,它还告诉我以下内容: Package python-speechd is not available, but is referred to by another package. This may mean that the package is missing, has been obsolete, or is only available from another source E: Package ‘python-speechd’ has no installation candidate. 我该怎么办? 如果可以的话,我想继续使用语音调度员。 https://live.gnome.org/Orca/SpeechDispatcher说我应该尝试安装python-speechd,这不起作用。 提前谢谢 – 我到处搜索,但找不到任何东西。 编辑:我做了一点挖掘,这似乎是Python 2.7的一个问题,因为python3-speechd已安装,但不是python-speechd。 以下作品: python3 -c […]

Jupyter笔记本电脑安装

是否可以通过apt-get install安装Jupyter Notebook? 例如,我们可以使用apt-get install python-numpy 。