Closed Cielquan closed 2 years ago
Is "C:\Users\riedelc\projects\zebra-printer\
in your $PYTHONPATH
? It seems that import barcode
is importing your module (e.g.: barcode.py
). So it just tries to import itself in a loop.
Embarrassing. 🤦
Yes of cause, the directory is in the PYTHONPATH, because I run the python command from within this directory and thus my custom barcode.py
clashes with the python-barcode's namespace.
Thanks very much for the hint and sorry.
I try to use this library, but strangely the import won't work and I am clueless. Other third-party libs from PyPI are working flawlessly.
OS: Win 10 Python Versions: 3.10.5 | 3.8.10 Shell: (Git-)Bash
Reproduction
Create venv, activate it, update pip, install python-barcode. Then follow examples below
Example 1
Create
barcode.py
file with content:Run file and see error:
Example 2
Create
barcode.py
file with content:Run file and see error:
Example 3
Create
barcode.py
file with content:Run file and see error:
Additional
Screenshot of file tree: As you can see the package is installed as it should be.