lincolnloop / python-qrcode

Python QR Code image generator
https://pypi.python.org/pypi/qrcode
Other
4.36k stars 666 forks source link

Error while running qrcode tutorial... #213

Closed DonutMan06 closed 3 years ago

DonutMan06 commented 3 years ago

Hello,

I used pip to install qrcode but I failed running the very first step of the tutorial... :( Please note that I use pip to install qrcode but I run it in a conda envrionnement (I've already done that with another package and got no error)

$ more essai.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import qrcode
img = qrcode.make('Some data here')

Here's the result I got:

Traceback (most recent call last):

  File "/home/donut/python/test/covid/essai.py", line 10, in <module>
    img = qrcode.make('Some data here')

  File "/home/donut/anaconda3/envs/covid/lib/python3.8/site-packages/qrcode/main.py", line 11, in make
    return qr.make_image()

  File "/home/donut/anaconda3/envs/covid/lib/python3.8/site-packages/qrcode/main.py", line 289, in make_image
    from qrcode.image.pil import PilImage

  File "/home/donut/anaconda3/envs/covid/lib/python3.8/site-packages/qrcode/image/pil.py", line 14, in <module>
    class PilImage(qrcode.image.base.BaseImage):

AttributeError: module 'qrcode.image' has no attribute 'base'

I don't understant why it's not running as expected... Here are some additional informations:

$ pip show qrcode
Name: qrcode
Version: 6.1
Summary: QR Code image generator
Home-page: https://github.com/lincolnloop/python-qrcode
Author: Lincoln Loop
Author-email: info@lincolnloop.com
License: BSD
Location: /home/donut/anaconda3/envs/covid/lib/python3.8/site-packages
Requires: six
Required-by: 

The location of the package is in my path..

import sys
sys.path
['/home/donut/anaconda3/envs/covid/lib/python38.zip',
 '/home/donut/anaconda3/envs/covid/lib/python3.8',
 '/home/donut/anaconda3/envs/covid/lib/python3.8/lib-dynload',
 '',
 '/home/donut/anaconda3/envs/covid/lib/python3.8/site-packages',
 '/home/donut/anaconda3/envs/covid/lib/python3.8/site-packages/IPython/extensions',
 '/home/donut/.ipython']

Thanks a lot for any advice :)

D.

DonutMan06 commented 3 years ago

Well... sorry to have bothered you. It solved by itself when I quitted and relaunching Spyder ! Probably some modules that were loaded in the wrong way... No other way to solve it than restart the whole thing !