问题描述
我正在关注这些说明在Mac上安装odoo.它要求我为用户安装所有python模块,如下所示:
I'm following these instructions to install odoo on mac. It required that I install all the python modules for the user like so:
$ sudo pip install -—user -r requirements.txt
关于(* 注释 >部分)
但是,当我运行odoo时,会出现此错误:
However when I run odoo, I get this error:
$ ./odoo-bin
Traceback (most recent call last):
File "./odoo-bin", line 5, in <module>
__import__('pkg_resources').declare_namespace('odoo.addons')
File "/Library/Python/2.7/site-packages/setuptools-36.5.0-py2.7.egg/pkg_resources/__init__.py", line 2241, in declare_namespace
File "/Library/Python/2.7/site-packages/setuptools-36.5.0-py2.7.egg/pkg_resources/__init__.py", line 2257, in declare_namespace
File "/Library/Python/2.7/site-packages/setuptools-36.5.0-py2.7.egg/pkg_resources/__init__.py", line 2192, in _handle_ns
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pkgutil.py", line 246, in load_module
mod = imp.load_module(fullname, self.file, self.filename, self.etc)
File "/opt/odoo/odoo-10.0/odoo/__init__.py", line 64, in <module>
import report
File "/opt/odoo/odoo-10.0/odoo/report/__init__.py", line 5, in <module>
from . import custom
File "/opt/odoo/odoo-10.0/odoo/report/custom.py", line 20, in <module>
from . import render
File "/opt/odoo/odoo-10.0/odoo/report/render/__init__.py", line 4, in <module>
from .simple import simple
File "/opt/odoo/odoo-10.0/odoo/report/render/simple.py", line 8, in <module>
import reportlab.lib
ImportError: No module named reportlab.lib
我注意到在report.txt中可以找到此报告实验室:
I noticed that this reportlab is available in requirements.txt:
reportlab==3.3.0
但是,如果我运行此命令
however, if I run this command
pip freeze | grep reportlab
我什么也没得到,但是当我运行此命令时
I get nothing, but also when I run this command
sudo pip install --user reportlab
我得到以下信息:
$ sudo pip install --user reportlab
$ sudo pip install --user reportlab
The directory '/Users/odoo/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/odoo/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied: reportlab in /Users/odoo/Library/Python/2.7/lib/python/site-packages
Requirement already satisfied: pillow>=2.4.0 in /Users/odoo/Library/Python/2.7/lib/python/site-packages (from reportlab)
Requirement already satisfied: pip>=1.4.1 in /Users/odoo/Library/Python/2.7/lib/python/site-packages (from reportlab)
Requirement already satisfied: setuptools>=2.2 in /Library/Python/2.7/site-packages/setuptools-36.5.0-py2.7.egg (from reportlab)
Requirement already satisfied: olefile in /Users/odoo/Library/Python/2.7/lib/python/site-packages (from pillow>=2.4.0->reportlab)
我已经尝试按照建议的此处进行强制重新安装,但是这样做没有太大作用.
I have tried force reinstalling as suggested here but that didn't do much.
想法?
推荐答案
受 dsgdfg 的评论 ..我只是按照此处的安装说明进行操作.
inspired by dsgdfg's comment.. I simply followed installation instructions here.. and it worked just fine
以上不是解决方案,我不得不回过头来安装并手动安装require.txt 中提到的每个库!我刚刚创建了一个虚拟环境,并且没有遇到任何麻烦!
the above isn't much a solution, b/c i had to go back and install every library mentioned in requirements.txt manually!! i just created a virtual env and it ran without a hitch from first attempt!
这篇关于尽管pip install说已经安装了pip,为什么冻结不显示模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!