Monday, 15 February 2010

python - Installing a package into a virtual environment on Windows 7 -



python - Installing a package into a virtual environment on Windows 7 -

i used programming on mac or linux box installing packages virtual environment relatively straightforward. unfortunately, not seem case windows. have been trying install lxml virtual environment on 64 bit windows 7 machine.

first used pip (my preferred tool):

(lxml_tutorial) ps c:\users\spearsc\documents\python_projects\lxml_tutorial> pip install lxml downloading/unpacking lxml running setup.py (path:c:\users\spearsc\appdata\local\temp\pip_build_spearsc\lxml\setup.py) egg_info bundle lxml building lxml version 3.3.5. building without cython. error: 'xslt-config' not recognized internal or external command, operable programme or batch file. ** create sure development packages of libxml2 , libxslt installed ** using build configuration of libxslt c:\python27\lib\distutils\dist.py:267: userwarning: unknown distribution option: 'bugtrack_url' warnings.warn(msg) warning: no previously-included files found matching '*.py' installing collected packages: lxml running setup.py install lxml building lxml version 3.3.5. building without cython. error: 'xslt-config' not recognized internal or external command, operable programme or batch file. ** create sure development packages of libxml2 , libxslt installed ** using build configuration of libxslt building 'lxml.etree' extension gcc -mno-cygwin -mdll -o -wall -ic:\users\spearsc\appdata\local\temp\pip_build_spearsc\lxml\src\lxml\includes -ic:\p ython27\include -ic:\python27\pc -c src\lxml\lxml.etree.c -o build\temp.win-amd64-2.7\release\src\lxml\lxml.etree.o -w c:\python27\lib\distutils\dist.py:267: userwarning: unknown distribution option: 'bugtrack_url' warnings.warn(msg) error: command 'gcc' failed: no such file or directory finish output command c:\python27\python.exe -c "import setuptools, tokenize;__file__='c:\\users\\spearsc\\ap pdata\\local\\temp\\pip_build_spearsc\\lxml\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().rep lace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\spearsc\appdata\local\temp\pip-c22v0y-record\install-r ecord.txt --single-version-externally-managed --compile: building lxml version 3.3.5. building without cython. error: 'xslt-config' not recognized internal or external command, operable programme or batch file. ** create sure development packages of libxml2 , libxslt installed ** using build configuration of libxslt running install running build running build_py creating build creating build\lib.win-amd64-2.7 creating build\lib.win-amd64-2.7\lxml copying src\lxml\builder.py -> build\lib.win-amd64-2.7\lxml copying src\lxml\cssselect.py -> build\lib.win-amd64-2.7\lxml copying src\lxml\doctestcompare.py -> build\lib.win-amd64-2.7\lxml copying src\lxml\elementinclude.py -> build\lib.win-amd64-2.7\lxml copying src\lxml\pyclasslookup.py -> build\lib.win-amd64-2.7\lxml copying src\lxml\sax.py -> build\lib.win-amd64-2.7\lxml copying src\lxml\usedoctest.py -> build\lib.win-amd64-2.7\lxml copying src\lxml\_elementpath.py -> build\lib.win-amd64-2.7\lxml copying src\lxml\__init__.py -> build\lib.win-amd64-2.7\lxml creating build\lib.win-amd64-2.7\lxml\includes copying src\lxml\includes\__init__.py -> build\lib.win-amd64-2.7\lxml\includes creating build\lib.win-amd64-2.7\lxml\html copying src\lxml\html\builder.py -> build\lib.win-amd64-2.7\lxml\html copying src\lxml\html\clean.py -> build\lib.win-amd64-2.7\lxml\html copying src\lxml\html\defs.py -> build\lib.win-amd64-2.7\lxml\html copying src\lxml\html\diff.py -> build\lib.win-amd64-2.7\lxml\html copying src\lxml\html\elementsoup.py -> build\lib.win-amd64-2.7\lxml\html copying src\lxml\html\formfill.py -> build\lib.win-amd64-2.7\lxml\html copying src\lxml\html\html5parser.py -> build\lib.win-amd64-2.7\lxml\html copying src\lxml\html\soupparser.py -> build\lib.win-amd64-2.7\lxml\html copying src\lxml\html\usedoctest.py -> build\lib.win-amd64-2.7\lxml\html copying src\lxml\html\_diffcommand.py -> build\lib.win-amd64-2.7\lxml\html copying src\lxml\html\_html5builder.py -> build\lib.win-amd64-2.7\lxml\html copying src\lxml\html\_setmixin.py -> build\lib.win-amd64-2.7\lxml\html copying src\lxml\html\__init__.py -> build\lib.win-amd64-2.7\lxml\html creating build\lib.win-amd64-2.7\lxml\isoschematron copying src\lxml\isoschematron\__init__.py -> build\lib.win-amd64-2.7\lxml\isoschematron copying src\lxml\lxml.etree.h -> build\lib.win-amd64-2.7\lxml copying src\lxml\lxml.etree_api.h -> build\lib.win-amd64-2.7\lxml copying src\lxml\includes\c14n.pxd -> build\lib.win-amd64-2.7\lxml\includes copying src\lxml\includes\config.pxd -> build\lib.win-amd64-2.7\lxml\includes copying src\lxml\includes\dtdvalid.pxd -> build\lib.win-amd64-2.7\lxml\includes copying src\lxml\includes\etreepublic.pxd -> build\lib.win-amd64-2.7\lxml\includes copying src\lxml\includes\htmlparser.pxd -> build\lib.win-amd64-2.7\lxml\includes copying src\lxml\includes\relaxng.pxd -> build\lib.win-amd64-2.7\lxml\includes copying src\lxml\includes\schematron.pxd -> build\lib.win-amd64-2.7\lxml\includes copying src\lxml\includes\tree.pxd -> build\lib.win-amd64-2.7\lxml\includes copying src\lxml\includes\uri.pxd -> build\lib.win-amd64-2.7\lxml\includes copying src\lxml\includes\xinclude.pxd -> build\lib.win-amd64-2.7\lxml\includes copying src\lxml\includes\xmlerror.pxd -> build\lib.win-amd64-2.7\lxml\includes copying src\lxml\includes\xmlparser.pxd -> build\lib.win-amd64-2.7\lxml\includes copying src\lxml\includes\xmlschema.pxd -> build\lib.win-amd64-2.7\lxml\includes copying src\lxml\includes\xpath.pxd -> build\lib.win-amd64-2.7\lxml\includes copying src\lxml\includes\xslt.pxd -> build\lib.win-amd64-2.7\lxml\includes copying src\lxml\includes\etree_defs.h -> build\lib.win-amd64-2.7\lxml\includes copying src\lxml\includes\lxml-version.h -> build\lib.win-amd64-2.7\lxml\includes creating build\lib.win-amd64-2.7\lxml\isoschematron\resources creating build\lib.win-amd64-2.7\lxml\isoschematron\resources\rng copying src\lxml\isoschematron\resources\rng\iso-schematron.rng -> build\lib.win-amd64-2.7\lxml\isoschematron\resources\ rng creating build\lib.win-amd64-2.7\lxml\isoschematron\resources\xsl copying src\lxml\isoschematron\resources\xsl\rng2schtrn.xsl -> build\lib.win-amd64-2.7\lxml\isoschematron\resources\xsl copying src\lxml\isoschematron\resources\xsl\xsd2schtrn.xsl -> build\lib.win-amd64-2.7\lxml\isoschematron\resources\xsl creating build\lib.win-amd64-2.7\lxml\isoschematron\resources\xsl\iso-schematron-xslt1 copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_abstract_expand.xsl -> build\lib.win-amd64-2.7\lxm l\isoschematron\resources\xsl\iso-schematron-xslt1 copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_dsdl_include.xsl -> build\lib.win-amd64-2.7\lxml\i soschematron\resources\xsl\iso-schematron-xslt1 copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schematron_message.xsl -> build\lib.win-amd64-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.win -amd64-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.win-amd64-2.7\lxml \isoschematron\resources\xsl\iso-schematron-xslt1 copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\readme.txt -> build\lib.win-amd64-2.7\lxml\isoschematr on\resources\xsl\iso-schematron-xslt1 running build_ext building 'lxml.etree' extension creating build\temp.win-amd64-2.7 creating build\temp.win-amd64-2.7\release creating build\temp.win-amd64-2.7\release\src creating build\temp.win-amd64-2.7\release\src\lxml gcc -mno-cygwin -mdll -o -wall -ic:\users\spearsc\appdata\local\temp\pip_build_spearsc\lxml\src\lxml\includes -ic:\pytho n27\include -ic:\python27\pc -c src\lxml\lxml.etree.c -o build\temp.win-amd64-2.7\release\src\lxml\lxml.etree.o -w c:\python27\lib\distutils\dist.py:267: userwarning: unknown distribution option: 'bugtrack_url' warnings.warn(msg) error: command 'gcc' failed: no such file or directory ---------------------------------------- cleaning up... command c:\python27\python.exe -c "import setuptools, tokenize;__file__='c:\\users\\spearsc\\appdata\\local\\temp\\pip_b uild_spearsc\\lxml\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __fil e__, 'exec'))" install --record c:\users\spearsc\appdata\local\temp\pip-c22v0y-record\install-record.txt --single-versio n-externally-managed --compile failed error code 1 in c:\users\spearsc\appdata\local\temp\pip_build_spearsc\lxml storing debug log failure in c:\users\spearsc\pip\pip.log

i have seen error before. think caused c compiler not beingness set. knew past experience fixing issue tremendous pain, decided seek method.

i went http://www.lfd.uci.edu/~gohlke/pythonlibs/ , downloaded exe file lxml. activated virtual environment , ran executable in it. library installed globally, not wanted, uninstalled lxml.

for 3rd attempt, activated virtual environment , used easy_install install lxml. 1 time again, bundle installed globally! uninstalled lxml pip.

i disappointed. going have install packages globally , forget using virtual environments? of solutions have seen on web seem outdated.

hm, when utilize virtual environment's easy_install, installs in virtual env, not globally.

but aside, way go create wheel .exe, , pip install that. (wheel/.whl new standard replacing .egg format. see pep 427 or readthedocs, among others.)

do following:

pip install wheel download .exe wininst2wheel.exe <downloaded .exe file> pip install <created .whl file>

python windows virtualenv

No comments:

Post a Comment