Git Product home page Git Product logo

Comments (13)

eadmaster avatar eadmaster commented on June 18, 2024 7

for me this was due to a name clash with this module.
Solution:

pip uninstall barcode
pip install python-barcode

from python-barcode.

WhyNotHugo avatar WhyNotHugo commented on June 18, 2024 1

I've no idea why that works for you or how your setup is laid out, but happy it works for you. I suspect you either have two pythons, or two different environment configurations somewhere.

Glad you figured it out.

from python-barcode.

sahad-cp avatar sahad-cp commented on June 18, 2024 1

this are not working. please help me

from python-barcode.

WhyNotHugo avatar WhyNotHugo commented on June 18, 2024

No idea what to say here. I haven't used any of the tools you mention, but it would seem they're using a different python.

I expect that you'll get this error for any library you install, right?

from python-barcode.

WhyNotHugo avatar WhyNotHugo commented on June 18, 2024

Can you do the following:

  • On you editor, run this code and what does it output? import sys; sys.path
  • On the same console you ran pip install, what does this output? python -c "import sys; print(sys.path)" And this? pip --version?

This should help figure out if they're using different pythons.

from python-barcode.

mrshin0212 avatar mrshin0212 commented on June 18, 2024

I got same problem.

ModuleNotFoundError: No module named 'barcode.writer'; 'barcode' is not a package

But it's working fine only on this folder: C:\Program Files\Python38\Lib\site-packages\tests
Can you help me fix this problem.


Folder: C:\Program Files\Python38\Lib\site-packages\barcode

pip 20.2b1 from c:\program files\python38\lib\site-packages\pip-20.2b1-py3.8.egg\pip (python 3.8)

>>> print(sys.path)
['D:\\GG\\1.Hung\\My Code\\Pro1', 'C:\\Program Files\\Python38\\python38.zip', 'C:\\Program Files\\Python38\\DLLs', 'C:\\Program Files\\Python38\\lib', 'C:\\Program Files\\Python38', 'C:\\Users\\Mr Shin Heo\\AppData\\Roaming\\Python\\Python38\\site-packages', 'C:\\Program Files\\Python38\\lib\\site-packages', 'C:\\Program Files\\Python38\\lib\\site-packages\\pip-20.2b1-py3.8.egg', 'C:\\Program Files\\Python38\\lib\\site-packages\\win32', 'C:\\Program Files\\Python38\\lib\\site-packages\\win32\\lib', 'C:\\Program Files\\Python38\\lib\\site-packages\\Pythonwin']

$ python -c "import sys; print(sys.path)"
['', 'C:\\Program Files\\Python38\\python38.zip', 'C:\\Program Files\\Python38\\DLLs', 'C:\\Program Files\\Python38\\lib', 'C:\\Program Files\\Python38', 'C:\\Users\\Mr Shin Heo\\AppData\\Roaming\\Python\\Python38\\site-packages', 'C:\\Program Files\\Python38\\lib\\site-packages', 'C:\\Program Files\\Python38\\lib\\site-packages\\pip-20.2b1-py3.8.egg', 'C:\\Program Files\\Python38\\lib\\site-packages\\win32', 'C:\\Program Files\\Python38\\lib\\site-packages\\win32\\lib', 'C:\\Program Files\\Python38\\lib\\site-packages\\Pythonwin']

[Edit: formatting was unreadable. @WhyNotHugo]

from python-barcode.

WhyNotHugo avatar WhyNotHugo commented on June 18, 2024

I've no idea how Python works on windows, but it seems that when you ran print(sys.path), the list of directories where python searches for packages had an extra entry (the first one) compared to when you did python -c "import sys; print(sys.path)".

This indicates that the environment for both runs is different.

How did you run python when you ran print(sys.path)? Via an IDE? Is this where importing barcode does work?

from python-barcode.

mrshin0212 avatar mrshin0212 commented on June 18, 2024

I found a solution: copy Tests folder from here : C:\Program Files\Python38\Lib\site-packages\tests
And create new file .py on this folder: Barcode is working fine.
Screenshot_11

from python-barcode.

bryanseah234 avatar bryanseah234 commented on June 18, 2024

for me this was due to a name clash with this module. Solution:

pip uninstall barcode
pip install python-barcode

This worked miracles for me, thanks!

from python-barcode.

enter360 avatar enter360 commented on June 18, 2024

for me this was due to a name clash with this module. Solution:

pip uninstall barcode
pip install python-barcode

Intellij automatically installed the shorter named library for me. This fix worked for me as well.

from python-barcode.

WhyNotHugo avatar WhyNotHugo commented on June 18, 2024

Odd. The barcode package had been abandoned for years, hence this fork. Looks like there's a new package published under that name now.

from python-barcode.

shahrozhassan avatar shahrozhassan commented on June 18, 2024

this is absolutely working and hopefully it will resolve your issue
pip uninstall barcode
pip install python-barcode

from python-barcode.

WhyNotHugo avatar WhyNotHugo commented on June 18, 2024

@sahad-cp Nobody can help if you don't describe your problem. Please open a new issue and explain what's not working and what you've tried.

from python-barcode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.