nxshell, python, xlwt и прочие python-модули [SOLVED]
-
Привет всем!
Начал вникать в nxshell, да, собственно и в сам python, но столкнулся с проблемой. Возникла необходимость использовать подули xlwt и xlrd для генерации отчетов в формате Excel, но nxshell не видит эти модули. Пытаюсь ипортировать эти модули, на что nxshell отвечает:Traceback (most recent call last):
File "/home/nrg/workspace/nodes/zone_oper.py", line 4, in <module>
import xlrd,xlwt
ImportError: No module named xlrdСами модули установлены и в голом питоне прекрасно импортируются:
$ python
Python 2.7.3 (default, Mar 13 2014, 11:03:55)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import xlwt,xlrd
>>>Может ли вообще nxshell использовать сторонние модули? Может я что-то делаю не так?
Гугл особо не обнадёжил, по nxshell вообще информации крайне не много. Заранее извиняюсь если вопрос тривиальный, я не программист, не судите строго.
nxshell-2.0-M2
-
Добрый день.
Это разные реализации Python. Модули поставлены в системный CPython, а nxshell основан на Jython.
Jython написан на джаве, и поддерживает только pure-python модули (без компилированных библиотек).Внешние модули можно загрузить, добавив путь к ним в sys.path:
AirAlk:~() $ java -jar ~/.m2/repository/org/python/jython-standalone/2.7-b4/jython-standalone-2.7-b4.jar Jython 2.7b4 (default:3672e624962a, Feb 13 2015, 04:59:14) [Java HotSpot(TM) 64-Bit Server VM (Oracle Corporation)] on java1.8.0_25 Type "help", "copyright", "credits" or "license" for more information. >>> import xlrd,xlwt Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named xlrd >>> import sys >>> sys.path.append('/Library/Python/2.7/site-packages') >>> import xlrd,xlwt >>> xlrd.__file__ '/Library/Python/2.7/site-packages/xlrd/__init__.py' >>> xlwt.__file__ '/Library/Python/2.7/site-packages/xlwt/__init__.py' >>> -
-
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login