mnooner256 / pyqrcode

Python 3 module to generate QR Codes
BSD 3-Clause "New" or "Revised" License
408 stars 74 forks source link

pyqrcode in RhinoPython - Grasshopper #41

Closed mnooner256 closed 8 years ago

mnooner256 commented 8 years ago

I received the following report via email. I am moving the conversation over to github for posterity...

Some days ago I tried to run pyqrcode from Rhino Python in my Rhino (64-bit) but i could not import the pyqrcode library. I tried to change the path but nothing changed. The message that i receive is:

Message: No module named pyqrcode

Traceback: line 1, in , "C:\Users\MEDINA\AppData\Local\Temp\TempScript.py"

How can I fix this issue?

Looking forward your response

mnooner256 commented 8 years ago

I have never used Rhino, so I can only guess at the problem. In fact, I have only vaguely heard of the program. Hence, I am going to try to help you via some blind debugging.

The error you gave is almost always caused by the system not being able to find the pyqrcode directory where it looks for modules. Try this simple 2 line program:

import sys
print sys.path

The above program will print a list of paths that Python uses to find modules. Look for one with "site-packages" as part of the directory structure. The pyqrcode module folder should be put there.

If changing the folder's location does not help, please reply this comment with the exact location of the pyqrcode directory on your system and a list of the files pyqrcode directory. This will let me check that whether you have an installation problem or Rhino is doing something funky.

EliseAv commented 8 years ago

Maybe they don't know they need to pip install it first?

mnooner256 commented 8 years ago

I looked over the Rhino Python primer. It does not really explain how to install third-party modules. My guess is a by-hand installation was done. I ran similar problems in the past when I first started using python (way back before pip existed).

I am 99% sure it is an installation problem. But how the Rhino editor might be messing with path, is not something I can just advise him on a-priori. It might very well be that he installed it correctly, but Rhino does something funky to sys.path. Hence, the sanity check.

mnooner256 commented 8 years ago

I have not heard back from the user. I am assuming the above gave her/him enough clues to figure out how to solve the problem.

I am closing the issue unless I hear from the user.