问题:ImportError:没有名为六个模块

我正在尝试构建OpenERP项目,并完成了依赖项。现在出现此错误

Traceback (most recent call last):
  File "openerp-client.py", line 105, in <module>
  File "modules\__init__.pyo", line 23, in <module>
  File "modules\gui\__init__.pyo", line 22, in <module>
  File "modules\gui\main.pyo", line 33, in <module>
  File "rpc.pyo", line 29, in <module>
  File "common\__init__.pyo", line 22, in <module>
  File "common\common.pyo", line 26, in <module>
  File "tools\__init__.pyo", line 28, in <module>
  File "dateutil\relativedelta.pyo", line 12, in <module>
ImportError: No module named six

有人可以指导出什么问题以及如何解决吗???

I’m trying to build OpenERP project, done with dependencies. It’s giving this error now

Traceback (most recent call last):
  File "openerp-client.py", line 105, in <module>
  File "modules\__init__.pyo", line 23, in <module>
  File "modules\gui\__init__.pyo", line 22, in <module>
  File "modules\gui\main.pyo", line 33, in <module>
  File "rpc.pyo", line 29, in <module>
  File "common\__init__.pyo", line 22, in <module>
  File "common\common.pyo", line 26, in <module>
  File "tools\__init__.pyo", line 28, in <module>
  File "dateutil\relativedelta.pyo", line 12, in <module>
ImportError: No module named six

Could someone guide what’s wrong and how it can be fixed???


回答 0

您可能没有six安装Python模块。您可以在pypi上找到它。

要安装它:

$ easy_install six

(如果已安装,请pip install six改用)

You probably don’t have the six Python module installed. You can find it on pypi.

To install it:

$ easy_install six

(if you have installed, use pip install six instead)


回答 1

如果pip“说”了六个,但您仍然得到:

ImportError: No module named six.moves

尝试重新安装六个(为我工作):

pip uninstall six
pip install six

If pip “says” six is installed but you’re still getting:

ImportError: No module named six.moves

try re-installing six (worked for me):

pip uninstall six
pip install six

回答 2

在Ubuntu和Debian上

apt-get install python-six

绝招。

使用sudo apt-get install python-six,如果你得到一个错误说“权限被拒绝”。

On Ubuntu and Debian

apt-get install python-six

does the trick.

Use sudo apt-get install python-six if you get an error saying “permission denied”.


回答 3

对于Mac OS X:

pip install --ignore-installed six

For Mac OS X:

pip install --ignore-installed six

回答 4

我做了以下工作来解决上述问题。我尝试运行内置的exe时遇到了上述问题,即使我使用pyinstaller成功构建了exe。我是在Windows 10上完成的。

  1. 转到https://pypi.org/project/six/#files
  2. 下载“ six-1.14.0.tar.gz(33.9 kB)”
  3. 解压缩它,将“ six.py”复制并粘贴到您的源目录中。
  4. 将“六个”模块导入您的源代码(导入六个)
  5. 运行源脚本。

I did the following to solve the mentioned problem. I got the mentioned problem when I was trying to run the built exe, even I successfully built the exe using pyinstaller. I did this on Windows 10.

  1. go to https://pypi.org/project/six/#files
  2. download “six-1.14.0.tar.gz (33.9 kB)”
  3. unzip it, copy and paste “six.py” into your source directory.
  4. import “six” module into your source code (import six)
  5. run source script.

回答 5

pip install --ignore-installed six

资料来源:1233个竖起大拇指在此评论

pip install --ignore-installed six

Source: 1233 thumbs up on this comment


回答 6

在Ubuntu Bionic(18.04)上,已经为python2和python3安装了六个,但是启动Wammu时出现错误。@ 3ygun解决方案为我解决了

ImportError: No module named six

启动Wammu时

如果发生在python3程序中,则附带六个

pip3 install six

如果没有pip3:

apt install python3-pip

在Ubuntu下使用sudo

on Ubuntu Bionic (18.04), six is already install for python2 and python3 but I have the error launching Wammu. @3ygun solution worked for me to solve

ImportError: No module named six

when launching Wammu

If it’s occurred for python3 program, six come with

pip3 install six

and if you don’t have pip3:

apt install python3-pip

with sudo under Ubuntu!


声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。