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".
MAX31855 Python Library issues
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_mike
- Posts: 67446
- Joined: Thu Feb 11, 2010 2:51 pm
Re: MAX31855 Python Library issues
That's odd.. are you sure you're entering the command in the directory where the script 'simpletest.py' lives?
- ALB1985
- Posts: 10
- Joined: Tue Apr 11, 2017 12:09 pm
Re: MAX31855 Python Library issues
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.
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.
- adafruit_support_mike
- Posts: 67446
- Joined: Thu Feb 11, 2010 2:51 pm
Re: MAX31855 Python Library issues
That's a dependency issue. Did you install the GPIO library?
https://github.com/adafruit/Adafruit_Python_GPIO
https://github.com/adafruit/Adafruit_Python_GPIO
- ALB1985
- Posts: 10
- Joined: Tue Apr 11, 2017 12:09 pm
Re: MAX31855 Python Library issues
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.
Do I need to do sudo pip install Adafruit_GPIO?
Thanks.
- adafruit_support_mike
- Posts: 67446
- Joined: Thu Feb 11, 2010 2:51 pm
Re: MAX31855 Python Library issues
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.
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.
- ALB1985
- Posts: 10
- Joined: Tue Apr 11, 2017 12:09 pm
Re: MAX31855 Python Library issues
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.
Thanks.
- adafruit_support_mike
- Posts: 67446
- Joined: Thu Feb 11, 2010 2:51 pm
Re: MAX31855 Python Library issues
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?
- ALB1985
- Posts: 10
- Joined: Tue Apr 11, 2017 12:09 pm
Re: MAX31855 Python Library issues
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.
- adafruit_support_mike
- Posts: 67446
- Joined: Thu Feb 11, 2010 2:51 pm
Re: MAX31855 Python Library issues
Are you trying to run the script from the command line, a Python shell, or an IDE like IDLE?
- ALB1985
- Posts: 10
- Joined: Tue Apr 11, 2017 12:09 pm
Re: MAX31855 Python Library issues
Hello, I tried both the command line and the Python Shell and I get the same error message.
- adafruit_support_mike
- Posts: 67446
- Joined: Thu Feb 11, 2010 2:51 pm
Re: MAX31855 Python Library issues
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.
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.
- ALB1985
- Posts: 10
- Joined: Tue Apr 11, 2017 12:09 pm
Re: MAX31855 Python Library issues
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.
thanks.
- adafruit_support_mike
- Posts: 67446
- Joined: Thu Feb 11, 2010 2:51 pm
Re: MAX31855 Python Library issues
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.
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.
Please be positive and constructive with your questions and comments.