XMC and Python - Install additional modules
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
‎07-10-2018 08:17 AM
Hello,
what is the best way to install additional python modules on XMC?
As I see easy_install is present on the XMC but no PIP.
Do new installed modules survive an XMC update?
Best regards
Stephan
what is the best way to install additional python modules on XMC?
As I see easy_install is present on the XMC but no PIP.
Do new installed modules survive an XMC update?
Best regards
Stephan
Regards
Stephan
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
‎07-27-2018 01:54 AM
Hello tknv,
works fine.
thank you very much.
Best regards
Stephan
works fine.
thank you very much.
Best regards
Stephan
Regards
Stephan
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
‎07-17-2018 12:20 AM
Hi Stephan,
I think you can try:
#@METADATASTART
#@DetailDescriptionStart
################################################################
# System Script
#
# Script : Using pip.
# Revision : 1.0
# Last updated : 7/17/2018
# Purpose : To know using pip at XMC.
#
################################################################
#@DetailDescriptionEnd
#@ScriptDescription "Using pip"
#@SectionStart ( description = "pip install some")
#@SectionEnd
#@MetaDataEnd
import sys
sys.path.append('/usr/local/Extreme_Networks/NetSight/appdata/scripting')
import os
import pip
import inspect
from xmclib import emc_vars
from xmclib import logger
print("Running Python version is: %s" % sys.version)
print("Running Python PATH is: %s" % sys.executable)
print("Running module os is: %s" % inspect.getfile(os))
print("---Start pip install a")
pip.main(['install', 'a'])
print("Running module a is: %s" % inspect.getfile(a))
There would be two way, install package from XMC and from shell of running XMC.I believe from XMC is safer. But no guarantee, possible name space conflict etc.
Also from shell would break system ( running XMC environment) Python environment.
I think you can try:
#@METADATASTART
#@DetailDescriptionStart
################################################################
# System Script
#
# Script : Using pip.
# Revision : 1.0
# Last updated : 7/17/2018
# Purpose : To know using pip at XMC.
#
################################################################
#@DetailDescriptionEnd
#@ScriptDescription "Using pip"
#@SectionStart ( description = "pip install some")
#@SectionEnd
#@MetaDataEnd
import sys
sys.path.append('/usr/local/Extreme_Networks/NetSight/appdata/scripting')
import os
import pip
import inspect
from xmclib import emc_vars
from xmclib import logger
print("Running Python version is: %s" % sys.version)
print("Running Python PATH is: %s" % sys.executable)
print("Running module os is: %s" % inspect.getfile(os))
print("---Start pip install a")
pip.main(['install', 'a'])
print("Running module a is: %s" % inspect.getfile(a))
There would be two way, install package from XMC and from shell of running XMC.I believe from XMC is safer. But no guarantee, possible name space conflict etc.
Also from shell would break system ( running XMC environment) Python environment.
