Closed jean-christophe-manciot closed 7 years ago
Jean-Christophe,
What version of Python are you using?
Cheers,
Einar
$ python --version
Python 2.7.12+
$ python3 --version
Python 3.5.2+
Jean-Christophe,
Could you try the following change to see if using python 2.7.* resolves your issue?
cd yang-explorer
rm -rf v/
Then apply the following one line change to setup.sh.
index c3ca567..b50fd54 100755
--- a/setup.sh
+++ b/setup.sh
@@ -74,7 +74,7 @@ if [[ $NOVENV != 1 ]]; then
if [ -f "v/bin/activate" ]; then
source v/bin/activate
else
- virtualenv v
+ virtualenv --python=/usr/bin/python2.7 v
source v/bin/activate
fi
fi
Then start explorer again as follows.
bash setup.sh
./start.py
Please let me know if this helps.
Tx
Sudhir
@rustogi
Yes, the change does fix this issue.
However, it is a bit strange because the command python
calls python2.7:
$ ll /usr/bin/python
lrwxrwxrwx 1 root root 9 Jun 4 2016 /usr/bin/python -> python2.7*
@jean-christophe-manciot Yes the change was to use python2.7 install inside the virtual environment that is running yang explorer since yang explorer is currently tested to work with python 2.7.
If you are working on something else on your host machine, just use a different terminal or virtualenv and you should be able to use your preferred python version for other things.
Are you ok if I can work on committing this change?
OK
Great. Tx for verifying. I will work on getting the fix committed.
The resolution of this issue was done using issue #65
Here are some changes required for Python3 to work... There are probably some more tweaks needed for code to be up to Python3 standards, but this fixes the "sets" module import issue when doing a fresh install with python 3... and the errors that pop up and prevent login button from working with Python3.
SETS MODULE IMPORT ISSUE Delete the line "from sets import Set" on line 21 of ..../yang-explorer/server/explorer/utils/yang.py (By default Sets is now included in python3 so the include for the sets module is not required)
PUNCTUATION REQUIRED IN PYTHON 3 Fix issues with "print" parentheses on the following lines...
File "..../yang-explorer/server/explorer/utils/ncparse.py", line 61 print self Should be print(self)
File "..../yang-explorer/server/explorer/utils/annotations.py", line 39 print 'From cache..' Should be print('From cache..')
A lot of errors/exceptions in the log after trying to - unsuccessfully - login as guest/guest: