MAX31855 Python Library issues

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
ALB1985
 
Posts: 10
Joined: Tue Apr 11, 2017 12:09 pm

MAX31855 Python Library issues

Post by ALB1985 »

Hello, I wanted to check and see if the MAX31855 python library would still work the current release of the Raspian OS?
When I Type, sudo python simpletest.py I get "can't open file simplest.py [erro 2] no such file or directory".

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: MAX31855 Python Library issues

Post by adafruit_support_mike »

That's odd.. are you sure you're entering the command in the directory where the script 'simpletest.py' lives?

User avatar
ALB1985
 
Posts: 10
Joined: Tue Apr 11, 2017 12:09 pm

Re: MAX31855 Python Library issues

Post by ALB1985 »

Hello, The Libaray is installed in the /home/pi/ folder so its /home/pi/Adafruit_Python_MAX31855. I can open the script in the folder in examples simpletest.py but an error message comes up on the bottom screen when I press the run at the top. If I try In the terminal window it says python: can't open file 'simplest.py': [Errno] No such file or directory.

Python 3.5.3 (/user/bin/python3)
>>> %Run simpletest.py

Traceback (most recent call last):
File "home/home/pi/Adafruit_Python_MAX31855/examples/simpletest.py" , line 29, in <module>
import Adafruit_GPIO>SPI as SPI
Import Error: No module named 'Adafruit_GPIO'
>>>

Thanks.

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: MAX31855 Python Library issues

Post by adafruit_support_mike »

That's a dependency issue. Did you install the GPIO library?

https://github.com/adafruit/Adafruit_Python_GPIO

User avatar
ALB1985
 
Posts: 10
Joined: Tue Apr 11, 2017 12:09 pm

Re: MAX31855 Python Library issues

Post by ALB1985 »

I installed RPi. GPIO. sudo pip install RPi.GPIO. like it says in the guide. I know for the BeagleBone Black it say in the guide to install sudo pip install Adafruit_BBIO.
Do I need to do sudo pip install Adafruit_GPIO?

Thanks.

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: MAX31855 Python Library issues

Post by adafruit_support_mike »

That tutorial is probably out of date. We've modified the library so it installs more consistently, and the installation process is described on the Github page.

Also make sure you're installing the library for the right Python interpreter. Python-2.7 and Python-3 are only mostly compatible, so they have different file trees for libraries. If you install the GPIO library in the Python-2.7 tree, the Python-3 interpreter won't see it, and vice versa.

The `python` command used on the command line is Python-2.7, but some IDEs (and I think the Python shell) use Python-3.

The library works in either environment, just make sure you have a match between the environment where you install it and the environment where you use it.

User avatar
ALB1985
 
Posts: 10
Joined: Tue Apr 11, 2017 12:09 pm

Re: MAX31855 Python Library issues

Post by ALB1985 »

Ok, It looks like the MAX31855 lib and the Adafruit GPIO Lib installed in the same HOME/PI folder, Does that sound right? I still can't get it to work. I tried it with both Raspbian Pixel and Raspbian Stretch.

Thanks.

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: MAX31855 Python Library issues

Post by adafruit_support_mike »

You can download the files from the Github repo into your home directory, but the installer script will put them into the Python module directories. Have you run the setup.py script as described on the main page of the repo?

User avatar
ALB1985
 
Posts: 10
Joined: Tue Apr 11, 2017 12:09 pm

Re: MAX31855 Python Library issues

Post by ALB1985 »

Yes, I was able to do that but it still has an error message when I try to run sudo python simpletest.py error 2 file not found or something like that.

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: MAX31855 Python Library issues

Post by adafruit_support_mike »

Are you trying to run the script from the command line, a Python shell, or an IDE like IDLE?

User avatar
ALB1985
 
Posts: 10
Joined: Tue Apr 11, 2017 12:09 pm

Re: MAX31855 Python Library issues

Post by ALB1985 »

Hello, I tried both the command line and the Python Shell and I get the same error message.

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: MAX31855 Python Library issues

Post by adafruit_support_mike »

Stick with the standard command line.. the Python shell and IDLE introduce problems that are harder than the ones they solve.

What's the exact command you're using to execute the script? `sudo python simpletest.py` should work if entered in the directory where the script lives.

User avatar
ALB1985
 
Posts: 10
Joined: Tue Apr 11, 2017 12:09 pm

Re: MAX31855 Python Library issues

Post by ALB1985 »

Hello, I'm back. I was wondering if this library is still valid? I took a break from it when i could not get it to work before. I tried the download off the Github page but still get errors. I typed in sudo python simpletest.py and it just comes back with an error no such file. when i run it in the python file it says no module named Adafruit_GPIO.

thanks.

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: MAX31855 Python Library issues

Post by adafruit_support_mike »

The libraries in our Github repo are known to work.

You're still probably running into problems with different versions of Python. If you want to use Python-3 to write your code, install the modules using Python-3.

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”