开发者

Python module not found

How do I import pyBarcode from the Python interpreter? According to the pyBarcode documentation the first step is to import barcode. When I try that it says there is no such module.

~# python
Python 2.6.6开发者_高级运维 (r266:84292, Dec 26 2010, 22:31:48)
[GCC 4.4.5] on linux2

>>> import barcode
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named barcode


Before using (importing) pyBarcode, you must install it, for instance with

pip install pyBarcode


Make sure that the directory that contains the module is in your PYTHONPATH environment variable.

Alternatively, you can use

import sys
sys.path.append(r"C:\path to pyBarcode")
import barcode
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜