Skip to Content
Menu
This question has been flagged
1 Reply
5410 Views
i want to install module "printer_zpl2"  but it shows the error "NameError: name 'zpl2' is not defined" . When i open the code i saw this 
try:
    import zpl2
except ImportError:
    _logger.debug('Cannot `import zpl2`.')

My question is how to get or download or install "zpl2" ?? i have executed the command "pip install zpl2" but nothing change . Any help please??
Avatar
Discard
Best Answer

Hi Dhouha, The package name is pyzpl2. 

try : sudo pip install pyzpl2

I have tried it and installed pyzpl2-0.1 in my machine.

UPDATE

You can check the list of python packages installed in  your machine by doing : pip freeze
your package would be installed to the site-packages directory of your python installation.
You can check your site-packages directory(s) like this : 

$ ipython
>>> import site
>>> site.getsitepackages()

you get a list like this : ['<path>', ...]

go to the path and check your package.

I hope this helps.

Avatar
Discard
Author

thanks for your answer , i have verified my site-packages directory it containes a directory named "pyzpl2-0.1-py2.7.egg-info" but when tried to reinstall the module "printer_zpl2" it shows always the same error "NameError: name 'zpl2' is not defined"

Author

Do you install this module and it works in your machine ??

Please check https://pypi.org/search/?q=Zpl

And tell me if you still have a problem.

Thank you.

i think simple_zpl2 is what you are looking for ( please read the doc, you will find a function print_zpl that sends formatted text to a network label printer. It is already included)

Author

the probleme is the directory zpl2 exist in my computer with "zpl2.py" and "__init__.py" but it seems that during the installation it doesn't see it

Related Posts Replies Views Activity
2
Nov 24
275
1
Oct 24
335
4
Oct 24
327
2
Oct 24
364
2
Dec 24
679