首页 \ 问答 \ 每当我尝试安装lxml时都会出错?(gets an error whenever I try to install lxml?)

每当我尝试安装lxml时都会出错?(gets an error whenever I try to install lxml?)

每当我尝试在我的终端中pip install lxml时,我会收到以下消息,并显示错误消息

ollecting lxml
sing cached lxml-3.4.4.tar.gz
nstalling collected packages: lxml
unning setup.py install for lxml
Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/pg/bl7db8d57glfhyvf3l5mwb1h0000gn/T/pip-build-ZX2pvH/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/pg/bl7db8d57glfhyvf3l5mwb1h0000gn/T/pip-LwWVjA-record/install-record.txt --single-version-externally-managed --compile:
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)
Building lxml version 3.4.4.
Building without Cython.
Using build configuration of libxslt 1.1.28
running install
running build
running build_py
creating build
creating build/lib.macosx-10.11-intel-2.7
creating build/lib.macosx-10.11-intel-2.7/lxml
copying src/lxml/__init__.py -> build/lib.macosx-10.11-intel-2.7/lxml
copying src/lxml/_elementpath.py -> build/lib.macosx-10.11-intel-2.7/lxml
copying src/lxml/builder.py -> build/lib.macosx-10.11-intel-2.7/lxml
copying src/lxml/cssselect.py -> build/lib.macosx-10.11-intel-2.7/lxml
copying src/lxml/doctestcompare.py -> build/lib.macosx-10.11-intel-2.7/lxml
copying src/lxml/ElementInclude.py -> build/lib.macosx-10.11-intel-2.7/lxml
copying src/lxml/pyclasslookup.py -> build/lib.macosx-10.11-intel-2.7/lxml
copying src/lxml/sax.py -> build/lib.macosx-10.11-intel-2.7/lxml
copying src/lxml/usedoctest.py -> build/lib.macosx-10.11-intel-2.7/lxml
creating build/lib.macosx-10.11-intel-2.7/lxml/includes
copying src/lxml/includes/__init__.py -> build/lib.macosx-10.11-intel-2.7/lxml/includes
creating build/lib.macosx-10.11-intel-2.7/lxml/html
copying src/lxml/html/__init__.py -> build/lib.macosx-10.11-intel-2.7/lxml/html
copying src/lxml/html/_diffcommand.py -> build/lib.macosx-10.11-intel-2.7/lxml/html
copying src/lxml/html/_html5builder.py -> build/lib.macosx-10.11-intel-2.7/lxml/html
copying src/lxml/html/_setmixin.py -> build/lib.macosx-10.11-intel-2.7/lxml/html
copying src/lxml/html/builder.py -> build/lib.macosx-10.11-intel-2.7/lxml/html
copying src/lxml/html/clean.py -> build/lib.macosx-10.11-intel-2.7/lxml/html
copying src/lxml/html/defs.py -> build/lib.macosx-10.11-intel-2.7/lxml/html
copying src/lxml/html/diff.py -> build/lib.macosx-10.11-intel-2.7/lxml/html
copying src/lxml/html/ElementSoup.py -> build/lib.macosx-10.11-intel-2.7/lxml/html
copying src/lxml/html/formfill.py -> build/lib.macosx-10.11-intel-2.7/lxml/html
copying src/lxml/html/html5parser.py -> build/lib.macosx-10.11-intel-2.7/lxml/html
copying src/lxml/html/soupparser.py -> build/lib.macosx-10.11-intel-2.7/lxml/html
copying src/lxml/html/usedoctest.py -> build/lib.macosx-10.11-intel-2.7/lxml/html
creating build/lib.macosx-10.11-intel-2.7/lxml/isoschematron
copying src/lxml/isoschematron/__init__.py -> build/lib.macosx-10.11-intel-2.7/lxml/isoschematron
copying src/lxml/lxml.etree.h -> build/lib.macosx-10.11-intel-2.7/lxml
copying src/lxml/lxml.etree_api.h -> build/lib.macosx-10.11-intel-2.7/lxml
copying src/lxml/includes/c14n.pxd -> build/lib.macosx-10.11-intel-2.7/lxml/includes
copying src/lxml/includes/config.pxd -> build/lib.macosx-10.11-intel-2.7/lxml/includes
copying src/lxml/includes/dtdvalid.pxd -> build/lib.macosx-10.11-intel-2.7/lxml/includes
copying src/lxml/includes/etreepublic.pxd -> build/lib.macosx-10.11-intel-2.7/lxml/includes
copying src/lxml/includes/htmlparser.pxd -> build/lib.macosx-10.11-intel-2.7/lxml/includes
copying src/lxml/includes/relaxng.pxd -> build/lib.macosx-10.11-intel-2.7/lxml/includes
copying src/lxml/includes/schematron.pxd -> build/lib.macosx-10.11-intel-2.7/lxml/includes
copying src/lxml/includes/tree.pxd -> build/lib.macosx-10.11-intel-2.7/lxml/includes
copying src/lxml/includes/uri.pxd -> build/lib.macosx-10.11-intel-2.7/lxml/includes
copying src/lxml/includes/xinclude.pxd -> build/lib.macosx-10.11-intel-2.7/lxml/includes
copying src/lxml/includes/xmlerror.pxd -> build/lib.macosx-10.11-intel-2.7/lxml/includes
copying src/lxml/includes/xmlparser.pxd -> build/lib.macosx-10.11-intel-2.7/lxml/includes
copying src/lxml/includes/xmlschema.pxd -> build/lib.macosx-10.11-intel-2.7/lxml/includes
copying src/lxml/includes/xpath.pxd -> build/lib.macosx-10.11-intel-2.7/lxml/includes
copying src/lxml/includes/xslt.pxd -> build/lib.macosx-10.11-intel-2.7/lxml/includes
copying src/lxml/includes/etree_defs.h -> build/lib.macosx-10.11-intel-2.7/lxml/includes
copying src/lxml/includes/lxml-version.h -> build/lib.macosx-10.11-intel-2.7/lxml/includes
creating build/lib.macosx-10.11-intel-2.7/lxml/isoschematron/resources
creating build/lib.macosx-10.11-intel-2.7/lxml/isoschematron/resources/rng
copying src/lxml/isoschematron/resources/rng/iso-schematron.rng -> build/lib.macosx-10.11-intel-2.7/lxml/isoschematron/resources/rng
creating build/lib.macosx-10.11-intel-2.7/lxml/isoschematron/resources/xsl
copying src/lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl -> build/lib.macosx-10.11-intel-2.7/lxml/isoschematron/resources/xsl
copying src/lxml/isoschematron/resources/xsl/XSD2Schtrn.xsl -> build/lib.macosx-10.11-intel-2.7/lxml/isoschematron/resources/xsl
creating build/lib.macosx-10.11-intel-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_abstract_expand.xsl -> build/lib.macosx-10.11-intel-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_dsdl_include.xsl -> build/lib.macosx-10.11-intel-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_message.xsl -> build/lib.macosx-10.11-intel-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_skeleton_for_xslt1.xsl -> build/lib.macosx-10.11-intel-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_svrl_for_xslt1.xsl -> build/lib.macosx-10.11-intel-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt -> build/lib.macosx-10.11-intel-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
running build_ext
building 'lxml.etree' extension
creating build/temp.macosx-10.11-intel-2.7
creating build/temp.macosx-10.11-intel-2.7/src
creating build/temp.macosx-10.11-intel-2.7/src/lxml
cc -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I/usr/include/libxml2 -I/private/var/folders/pg/bl7db8d57glfhyvf3l5mwb1h0000gn/T/pip-build-ZX2pvH/lxml/src/lxml/includes -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.macosx-10.11-intel-2.7/src/lxml/lxml.etree.o -w -flat_namespace
cc -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -Wl,-F. build/temp.macosx-10.11-intel-2.7/src/lxml/lxml.etree.o -lxslt -lexslt -lxml2 -lz -lm -o build/lib.macosx-10.11-intel-2.7/lxml/etree.so
building 'lxml.objectify' extension
cc -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I/usr/include/libxml2 -I/private/var/folders/pg/bl7db8d57glfhyvf3l5mwb1h0000gn/T/pip-build-ZX2pvH/lxml/src/lxml/includes -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/lxml/lxml.objectify.c -o build/temp.macosx-10.11-intel-2.7/src/lxml/lxml.objectify.o -w -flat_namespace
cc -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -Wl,-F. build/temp.macosx-10.11-intel-2.7/src/lxml/lxml.objectify.o -lxslt -lexslt -lxml2 -lz -lm -o build/lib.macosx-10.11-intel-2.7/lxml/objectify.so
running install_lib
creating /Library/Python/2.7/site-packages/lxml
error: could not create '/Library/Python/2.7/site-packages/lxml': Permission denied

有一个错误说

Command "/usr/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/pg/bl7db8d57glfhyvf3l5mwb1h0000gn/T/pip-build-ZX2pvH/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/pg/bl7db8d57glfhyvf3l5mwb1h0000gn/T/pip-LwWVjA-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/pg/bl7db8d57glfhyvf3l5mwb1h0000gn/T/pip-build-ZX2pvH/lxml

仍然无法弄清楚正确安装此程序的方法...有关如何解决此问题的任何想法?


Every time I try to pip install lxml in my terminal, I get this following messages with an error that says

ollecting lxml
sing cached lxml-3.4.4.tar.gz
nstalling collected packages: lxml
unning setup.py install for lxml
Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/pg/bl7db8d57glfhyvf3l5mwb1h0000gn/T/pip-build-ZX2pvH/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/pg/bl7db8d57glfhyvf3l5mwb1h0000gn/T/pip-LwWVjA-record/install-record.txt --single-version-externally-managed --compile:
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)
Building lxml version 3.4.4.
Building without Cython.
Using build configuration of libxslt 1.1.28
running install
running build
running build_py
creating build
creating build/lib.macosx-10.11-intel-2.7
creating build/lib.macosx-10.11-intel-2.7/lxml
copying src/lxml/__init__.py -> build/lib.macosx-10.11-intel-2.7/lxml
copying src/lxml/_elementpath.py -> build/lib.macosx-10.11-intel-2.7/lxml
copying src/lxml/builder.py -> build/lib.macosx-10.11-intel-2.7/lxml
copying src/lxml/cssselect.py -> build/lib.macosx-10.11-intel-2.7/lxml
copying src/lxml/doctestcompare.py -> build/lib.macosx-10.11-intel-2.7/lxml
copying src/lxml/ElementInclude.py -> build/lib.macosx-10.11-intel-2.7/lxml
copying src/lxml/pyclasslookup.py -> build/lib.macosx-10.11-intel-2.7/lxml
copying src/lxml/sax.py -> build/lib.macosx-10.11-intel-2.7/lxml
copying src/lxml/usedoctest.py -> build/lib.macosx-10.11-intel-2.7/lxml
creating build/lib.macosx-10.11-intel-2.7/lxml/includes
copying src/lxml/includes/__init__.py -> build/lib.macosx-10.11-intel-2.7/lxml/includes
creating build/lib.macosx-10.11-intel-2.7/lxml/html
copying src/lxml/html/__init__.py -> build/lib.macosx-10.11-intel-2.7/lxml/html
copying src/lxml/html/_diffcommand.py -> build/lib.macosx-10.11-intel-2.7/lxml/html
copying src/lxml/html/_html5builder.py -> build/lib.macosx-10.11-intel-2.7/lxml/html
copying src/lxml/html/_setmixin.py -> build/lib.macosx-10.11-intel-2.7/lxml/html
copying src/lxml/html/builder.py -> build/lib.macosx-10.11-intel-2.7/lxml/html
copying src/lxml/html/clean.py -> build/lib.macosx-10.11-intel-2.7/lxml/html
copying src/lxml/html/defs.py -> build/lib.macosx-10.11-intel-2.7/lxml/html
copying src/lxml/html/diff.py -> build/lib.macosx-10.11-intel-2.7/lxml/html
copying src/lxml/html/ElementSoup.py -> build/lib.macosx-10.11-intel-2.7/lxml/html
copying src/lxml/html/formfill.py -> build/lib.macosx-10.11-intel-2.7/lxml/html
copying src/lxml/html/html5parser.py -> build/lib.macosx-10.11-intel-2.7/lxml/html
copying src/lxml/html/soupparser.py -> build/lib.macosx-10.11-intel-2.7/lxml/html
copying src/lxml/html/usedoctest.py -> build/lib.macosx-10.11-intel-2.7/lxml/html
creating build/lib.macosx-10.11-intel-2.7/lxml/isoschematron
copying src/lxml/isoschematron/__init__.py -> build/lib.macosx-10.11-intel-2.7/lxml/isoschematron
copying src/lxml/lxml.etree.h -> build/lib.macosx-10.11-intel-2.7/lxml
copying src/lxml/lxml.etree_api.h -> build/lib.macosx-10.11-intel-2.7/lxml
copying src/lxml/includes/c14n.pxd -> build/lib.macosx-10.11-intel-2.7/lxml/includes
copying src/lxml/includes/config.pxd -> build/lib.macosx-10.11-intel-2.7/lxml/includes
copying src/lxml/includes/dtdvalid.pxd -> build/lib.macosx-10.11-intel-2.7/lxml/includes
copying src/lxml/includes/etreepublic.pxd -> build/lib.macosx-10.11-intel-2.7/lxml/includes
copying src/lxml/includes/htmlparser.pxd -> build/lib.macosx-10.11-intel-2.7/lxml/includes
copying src/lxml/includes/relaxng.pxd -> build/lib.macosx-10.11-intel-2.7/lxml/includes
copying src/lxml/includes/schematron.pxd -> build/lib.macosx-10.11-intel-2.7/lxml/includes
copying src/lxml/includes/tree.pxd -> build/lib.macosx-10.11-intel-2.7/lxml/includes
copying src/lxml/includes/uri.pxd -> build/lib.macosx-10.11-intel-2.7/lxml/includes
copying src/lxml/includes/xinclude.pxd -> build/lib.macosx-10.11-intel-2.7/lxml/includes
copying src/lxml/includes/xmlerror.pxd -> build/lib.macosx-10.11-intel-2.7/lxml/includes
copying src/lxml/includes/xmlparser.pxd -> build/lib.macosx-10.11-intel-2.7/lxml/includes
copying src/lxml/includes/xmlschema.pxd -> build/lib.macosx-10.11-intel-2.7/lxml/includes
copying src/lxml/includes/xpath.pxd -> build/lib.macosx-10.11-intel-2.7/lxml/includes
copying src/lxml/includes/xslt.pxd -> build/lib.macosx-10.11-intel-2.7/lxml/includes
copying src/lxml/includes/etree_defs.h -> build/lib.macosx-10.11-intel-2.7/lxml/includes
copying src/lxml/includes/lxml-version.h -> build/lib.macosx-10.11-intel-2.7/lxml/includes
creating build/lib.macosx-10.11-intel-2.7/lxml/isoschematron/resources
creating build/lib.macosx-10.11-intel-2.7/lxml/isoschematron/resources/rng
copying src/lxml/isoschematron/resources/rng/iso-schematron.rng -> build/lib.macosx-10.11-intel-2.7/lxml/isoschematron/resources/rng
creating build/lib.macosx-10.11-intel-2.7/lxml/isoschematron/resources/xsl
copying src/lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl -> build/lib.macosx-10.11-intel-2.7/lxml/isoschematron/resources/xsl
copying src/lxml/isoschematron/resources/xsl/XSD2Schtrn.xsl -> build/lib.macosx-10.11-intel-2.7/lxml/isoschematron/resources/xsl
creating build/lib.macosx-10.11-intel-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_abstract_expand.xsl -> build/lib.macosx-10.11-intel-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_dsdl_include.xsl -> build/lib.macosx-10.11-intel-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_message.xsl -> build/lib.macosx-10.11-intel-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_skeleton_for_xslt1.xsl -> build/lib.macosx-10.11-intel-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_svrl_for_xslt1.xsl -> build/lib.macosx-10.11-intel-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt -> build/lib.macosx-10.11-intel-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
running build_ext
building 'lxml.etree' extension
creating build/temp.macosx-10.11-intel-2.7
creating build/temp.macosx-10.11-intel-2.7/src
creating build/temp.macosx-10.11-intel-2.7/src/lxml
cc -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I/usr/include/libxml2 -I/private/var/folders/pg/bl7db8d57glfhyvf3l5mwb1h0000gn/T/pip-build-ZX2pvH/lxml/src/lxml/includes -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.macosx-10.11-intel-2.7/src/lxml/lxml.etree.o -w -flat_namespace
cc -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -Wl,-F. build/temp.macosx-10.11-intel-2.7/src/lxml/lxml.etree.o -lxslt -lexslt -lxml2 -lz -lm -o build/lib.macosx-10.11-intel-2.7/lxml/etree.so
building 'lxml.objectify' extension
cc -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I/usr/include/libxml2 -I/private/var/folders/pg/bl7db8d57glfhyvf3l5mwb1h0000gn/T/pip-build-ZX2pvH/lxml/src/lxml/includes -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/lxml/lxml.objectify.c -o build/temp.macosx-10.11-intel-2.7/src/lxml/lxml.objectify.o -w -flat_namespace
cc -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -Wl,-F. build/temp.macosx-10.11-intel-2.7/src/lxml/lxml.objectify.o -lxslt -lexslt -lxml2 -lz -lm -o build/lib.macosx-10.11-intel-2.7/lxml/objectify.so
running install_lib
creating /Library/Python/2.7/site-packages/lxml
error: could not create '/Library/Python/2.7/site-packages/lxml': Permission denied

with an error that says

Command "/usr/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/pg/bl7db8d57glfhyvf3l5mwb1h0000gn/T/pip-build-ZX2pvH/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/pg/bl7db8d57glfhyvf3l5mwb1h0000gn/T/pip-LwWVjA-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/pg/bl7db8d57glfhyvf3l5mwb1h0000gn/T/pip-build-ZX2pvH/lxml

And still couldn't figure out the way to install this program properly...any ideas on how to fix this problem?


原文:https://stackoverflow.com/questions/33459019
更新时间:2023-04-08 10:04

最满意答案

试着引用它: -d "$JSON_DATA" - anubhava


Try quoting it: -d "$JSON_DATA" – anubhava

相关问答

更多
  • 您不需要将包含自定义标头的引号传递到卷曲。 此外,您应该引用data参数中间的变量。 首先,编写一个生成脚本的post数据的函数。 这可以节省您对shell引用的各种头痛,并且使您更容易阅读维护脚本,而不是像您尝试在curl的调用行中提供post数据: generate_post_data() { cat <
  • 我相信它是: curl -F "uptype=file" -F "file=@$1" 'http://my_site_ex/up.php' -F使用multipart / form-data,如果您为CURLOPT_POSTFIELDS传递数组,PHP接口libcurl将使用这些数据。 每个-F是一个单独的字段。 libcurl读取您用@指定的文件。 I believe it's: curl -F "uptype=file" -F "file=@$1" 'http://my_site_ex/up.php' ...
  • 在朋友们的帮助下,我想出了怎么做。 我最终在CGI脚本中完成了所有操作并在Bash组件之上进行了操作。 虽然这不是我在原来的问题中所要求的,但它为我完成了工作,这正是问题所在。 以下是我现在用于在服务器上成功写入文件的C代码: #include #include #include void print_empty_html_page(); int main() { char * req_method_str = getenv("RE ...
  • 这样工作吗? curl -dL "login=123456&password=123&returnUrl=/Katalog/SekceCsv/846?katalog=501" http://xy.com/user/Login 编辑: 看完你的评论后,我想你正在尝试一些奇怪的事情。 如果您有一个登录页面和另一个要获取的页面,则应该有2个curl命令。 您可以使用cookie来跟踪成功登录。 就像是 : curl -X POST -L -b /tmp/c -c /tmp/c -d "login=123456& ...
  • 您需要双引号包含双引号的字符串。 这是一种方式: CRUMB=$(curl -s "http://jenkins:${USER_TOKEN}@localhost:8080/crumbIssuer/api/xml?xpath=concat(//crumbRequestField, "'":"'",//crumb)") You need to double quote a string that contains double quotes. This is one way: CRUMB=$(curl -s ...
  • 既然你需要从Slack获取数据,那么最好的方法就是使用AJAX发布数据。 下面的JS代码是基于achavez的要点修改的:使用javascript发布到Slack并使用jQuery.ajax 。