- Tried to install YDK on Windows and it couldn't do it because of lxml. YDK (including just released 0.54) depends on exact lxml version 3.4.4 from 2015. Got newer version by default, need to use virtualenv but pip could not build lxml from source, as it requires libxml2 and libxslt which could not install easily (Not saying that it cannot be done but it certainly required above-average knowledge). On Windows, lxml is usually installed as a binary, however version 3.4.4 is quite old and there is no binary for this version and Python 3.5 that could find (only up to 3.2 is available). Could install different version of Python etc. but wondering is this really necessary i.e. is YDK really so dependent of lxml 3.4.4. If not, it would be a life-saver to have lxml dependency that would not be constrained to single (yet old) version.
We have got ydk installed on windows by following these instructutions. Can you try this.
These instructions are the just the basic requirements.
See what happens when tried to install YDK:
-------------<lOGS REMOVED>--------------
cl : Command line warning D9025 : overriding '/W3' with '/w'
lxml.etree.c
C:\Users\dvulovic\AppData\Local\Temp\pip-build-yquark_5\lxml\src\lxml\includes\etree_defs.h(14): fatal error C1083: Cannot open include file: 'libxml/xmlversion.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2
----------------------------------------
Command "C:\Users\dvulovic\virtualenv\YDK\Scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\dvulovic\\AppData\\Local\\Temp\\pip-build-yquark_5\\lxml\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\dvulovic\AppData\Local\Temp\pip-r67p4r74-record\install-record.txt --single-version-externally-managed --compile --install-headers C:\Users\dvulovic\virtualenv\YDK\include\site\python3.5\lxml" failed with error code 1 in C:\Users\dvulovic\AppData\Local\Temp\pip-build-yquark_5\lxml\
An alternative you could maybe consider is using YDK's Vagrant sandbox, which will give you a ubuntu VM with YDK pre-installed.
- This is an interesting proposition for e.g. someone doing hands-on lab, but I want to use IDE on my PC. And to install IDE on Vagravt VM running on my PC is a no-go, sorry.
- But to get back on the main question, is this really really necessary:
- lxml==3.4.4
- or it can become
- lxml>=3.4.4
We typically use “==“ in pip requirements because the version listed represents what we have actually tested with prior to release. It’s entirely possible that “lxml>=3.4.4” may be fine, but we haven’t verified it.
- Tried upgrading to lxml 3.7.3 and so far, do not see any issues with ydk (I am running ydk 0.5.4).
Following the instructions at:
http://ydk.cisco.com/py/docs/getting_started.html#windows
LXML 3.4.4 breaks YDK installation on Windows with latest Python 3 (3.6.1). Installation works just fine on Windows with latest Python 2 (2.7.13).
C:\Python27\Scripts>pip list DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning. pip (9.0.1) setuptools (28.8.0) -------------<lOGS REMOVED>--------------
Will add an issue on GitHub to have the LXML requirement updated. In the meantime, you can either install with Python 2 or update the dependency in https://github.com/CiscoDevNet/ydk-py/blob/master/core/setup.py and install from source as explained at: http://ydk.cisco.com/py/docs/getting_started.html#installing-from-source
Comments
0 comments
Please sign in to leave a comment.