当我尝试安装时odoo-server,出现以下错误:
error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Run Code Online (Sandbox Code Playgroud)
谁能帮我解决这个问题?
我在安装时遇到问题lxml.我已尝试过本网站和其他网站的相关问题的解决方案,但无法解决问题.需要一些建议/解决方案.
我在执行后提供完整的日志pip install lxml,
Downloading/unpacking lxml
Downloading lxml-3.3.5.tar.gz (3.5MB): 3.5MB downloaded
Running setup.py (path:/tmp/pip_build_root/lxml/setup.py) egg_info for package lxml
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)
Building lxml version 3.3.5.
Building without Cython.
Using build configuration of libxslt 1.1.28
warning: no previously-included files found matching '*.py'
Installing collected packages: lxml
Running setup.py install for lxml
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)
Building lxml version 3.3.5.
Building without Cython.
Using build configuration of libxslt 1.1.28
building 'lxml.etree' …Run Code Online (Sandbox Code Playgroud) 我在尝试将"pip install lxml"运行到Ubuntu 12.10 x64中的virtualenv时遇到以下错误.我有Python 2.7.
我在这里看到了有关同一问题的其他相关问题,并尝试安装python-dev,libxml2-dev和libxslt1-dev.
请看一下从命令提示到错误发生的那一刻的追溯.
Downloading/unpacking lxml
Running setup.py egg_info for package lxml
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)
Building lxml version 3.1.2.
Building without Cython.
Using build configuration of libxslt 1.1.26
Building against libxml2/libxslt in the following directory: /usr/lib
warning: no files found matching '*.txt' under directory 'src/lxml/tests'
Installing collected packages: lxml
Running setup.py install for lxml
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)
Building lxml version 3.1.2.
Building without Cython.
Using build configuration of … 我正在尝试安装libxml2,以便我可以设置python绑定并最终使用lxml.
但是,我无法在地球上工作,我应该解压缩文件.我没能成功谷歌.
我是否需要Cygwin/MinGW才能使安装成功?
目前,我将libxml2.tar.gz和libxslt.tar.gz中的文件放在Python文件夹中各自的目录中.因此,包含在包含的变量中的文件位于Python26\include\libxml2\libxml ...等等.
但是,当我运行easy_install lxml时,我收到以下输出:
Searching for lxml
Reading http://pypi.python.org/simple/lxml/
Reading http://codespeak.net/lxml
Best match: lxml 2.2.4
Downloading http://codespeak.net/lxml/lxml-2.2.4.tgz
Processing lxml-2.2.4.tgz
Running lxml-2.2.4\setup.py -q bdist_egg --dist-dir c:\users\rocco\appdata\local
\temp\easy_install-1xwbhy\lxml-2.2.4\egg-dist-tmp-9zwhe4
Building lxml version 2.2.4.
NOTE: Trying to build without Cython, pre-generated 'src/lxml/lxml.etree.c' need
s to be available.
ERROR: 'xslt-config' is not recognized as an internal or external command,
operable program or batch file.
** make sure the development packages of libxml2 and libxslt are installed **
Using build configuration of libxslt …Run Code Online (Sandbox Code Playgroud) 我试图安装"学术"包,但我一直收到这个错误:
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c build/temp.linux-x86_64-2.7/_openssl.c -o build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7/_openssl.o
build/temp.linux-x86_64-2.7/_openssl.c:434:30: fatal error: openssl/opensslv.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Command "/usr/bin/python -u -c "import setuptools,tokenize;__file__='/tmp/pip-build-0OXGEx/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-EdgZGB-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-0OXGEx/cryptography/
Run Code Online (Sandbox Code Playgroud)
已经尝试过以下帖子中的解决方案,但它没有用:
当我sudo pip install pyquery,sudo pip install lxml和sudo pip install cython,我得到非常相似的输出与相同的错误说:
x86_64-linux-gnu-gcc: error: unrecognized command line option ‘-fstack-protector-strong’
这是完整的点子输出sudo pip install pyquery:
Requirement already satisfied (use --upgrade to upgrade): pyquery in /usr/local/lib/python2.7/dist-packages
Downloading/unpacking lxml>=2.1 (from pyquery)
Running setup.py egg_info for package lxml
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)
Building lxml version 3.4.1.
Building without Cython.
Using build configuration of libxslt 1.1.28
Requirement already satisfied (use --upgrade to upgrade): cssselect in /usr/local/lib/python2.7/dist-packages/cssselect-0.9.1-py2.7.egg (from …Run Code Online (Sandbox Code Playgroud) 我在虚拟环境中使用python 3.4:
(af)[root@domain backend]# pip --version
pip 7.1.0 from /home/af/af-stage/backend/.ves/af/lib/python3.4/site-packages (python 3.4)
Run Code Online (Sandbox Code Playgroud)
安装lxml失败"错误:命令'gcc'失败,退出状态为4":
(af)[root@domain backend]# pip install lxml
You are using pip version 7.1.0, however version 7.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting lxml
Using cached lxml-3.5.0.tar.gz
Building wheels for collected packages: lxml
Running setup.py bdist_wheel for lxml
Complete output from command /home/af/af-stage/backend/.ves/af/bin/python3.4 -c "import setuptools;__file__='/tmp/pip-build-tlogtyk2/lxml/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpod9hcw0ypip-wheel-:
Building lxml version 3.5.0.
Building without Cython.
Using build configuration …Run Code Online (Sandbox Code Playgroud) 我试图在virtualenv中安装lxml sudo pip install lxml,sudo pip install --upgrade lxml但在两种情况下都得到以下内容:
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,
relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes
-D_FORTIFY_SOURCE=2 -g -fstack-protector --param=ssp-buffer-size=4 -Wformat
-Werror=format-security build/temp.linux-x86_64-2.7/src/lxml/lxml.etree.o -lxslt
-lexslt -lxml2 -lz -lm -o build/lib.linux-x86_64-2.7/lxml/etree.so
/usr/bin/ld: cannot find -lz
collect2: error: ld returned 1 exit status
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools,
tokenize;__file__='/tmp/pip_build_root/lxml/setup.py';
exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'),
__file__, 'exec'))" install --record /tmp/pip-nmFOYf-record/install-record.txt
--single-version-externally-managed --compile failed …Run Code Online (Sandbox Code Playgroud) 我正在使用py测试诱惑适配器并尝试生成诱惑报告所需的输入数据.但我无法生成任何XML.当我使用py.test sample.py执行py文件时,它确实创建了pycache目录.然后我执行了"诱惑生成-v 1.3.9 C:\ allurereports"(这是我有sample.py的目录).它确实创建了一个诱人的HTML报告,但没有测试用例是0.没有详细信息.
sample.py(与示例中给出的相同)
import allure
@allure.feature('Feature1')
@allure.story('Story1')
def test_minor():
assert False
@allure.feature('Feature2')
@allure.story('Story2', 'Story3')
@allure.story('Story4')
class TestBar:
# will have 'Feature2 and Story2 and Story3 and Story4'
def test_bar(self):
pass
Run Code Online (Sandbox Code Playgroud)
这是使用的py.test命令:py.test sample.py --allure_features = feature1,feature2
任何人都可以帮助我如何从文件中生成一个诱惑报告.有哪些命令要执行.
我有一个大约 30MB 的 XML 文件,里面有大约 300000 个元素。
我使用以下代码来处理这个文件。
xmldoc=xml.dom.minidom.parse("badges.xml")
csv_out=open("badge.csv","w")
for badge in xmldoc.getElementsByTagName("row"):
some processing here
csv_out.write(line)
Run Code Online (Sandbox Code Playgroud)
该文件只有 30MB,但是当我在我的 MBP(10.7,8G RAM)上运行这个脚本时,它使用了将近 3GB 的内存。为什么这么简单的脚本和这么小的文件要占用这么多内存?
此致,
python ×10
lxml ×5
gcc ×3
pip ×3
allure ×1
centos ×1
centos7 ×1
csv ×1
cython ×1
django ×1
install ×1
libxml2 ×1
linux ×1
linux-mint ×1
odoo-server ×1
performance ×1
pyquery ×1
pytest ×1
python-2.7 ×1
python-3.x ×1
ubuntu-14.04 ×1
ubuntu-16.04 ×1
windows ×1
xml ×1