I know I'm not supposed to post 'me-too' replies, but I can add more detail to the problem definition. So, I will.
I ran into so much trouble trying to install matplotlib that I started over, formatting the SSD and re-installing the latest Raspbian Stretch (full). I then did the following.
Code: Select all
sudo apt-get remove /usr/lib/python3.5
sudo apt-get install libffi-dev libssl-dev -y
wget https://www.python.org/ftp/python/3.6.3/Python-3.6.3.tar.xz
tar xJf Python-3.6.3.tar.xz
cd Python-3.6.3
./configure
Make (1hr 35m)
sudo make install (15m)
$python3
>how, what = "holy", "Grail"
>print(f'The {how} {what}!')
The holy Grail!
>exit()
$python3 --version
Python 3.6.3
All looks good so far. I grabbed the following line from the output of 'sudo make install'.
Code: Select all
Setting up python3-numpy (1:1.12.1-3) …
OK, so let's try it.
Code: Select all
~ $ find / -name numpy
/usr/share/numpy
/usr/include/numpy
/usr/include/python2.7/numpy
/usr/include/python3.5m/numpy
/usr/lib/python2.7/dist-packages/numpy
/usr/lib/python2.7/dist-packages/numpy/core/include/numpy
/usr/lib/python3/dist-packages/numpy
/usr/lib/python3/dist-packages/numpy/core/include/numpy
I see python3.5m survived the 'remove', so I go and manually delete that folder.
Code: Select all
$ cat temp
#!/usr/lib/python3
#
import os
print "os imported"
#import matplotlib as mpl
#print "matplotlib imported"
#mpl.use("Agg")
import numpy as np
print "numpy imported"
import matplotlib.pyplot as plt
print "pylot imported"
plt.rcParams['text.usetex']=True
data=np.random.rand(50,50)
plt.imshow(data, interpolation='nearest')
plt.xlabel('X Label')
plt.savefig('agg.eps')
os.system('epspdf agg.eps agg.pdf')
x=[5,2,9,4,7]
y=[10,5,8,4,2]
print "data ready to plot"
plt.plot(x,y)
plt.show()
user@piname:~/esi $ sudo nano temp
user@piname:~/esi $ python3 temp
os imported
Traceback (most recent call last):
File "temp", line 8, in <module>
import numpy as np
ModuleNotFoundError: No module named 'numpy'
user@piname:~/esi $ sudo nano ~/.bashrc
user@piname:~/esi $ sudo nano ~/.bash_aliases
user@piname:~/esi $ python3 temp
os imported
Traceback (most recent call last):
File "temp", line 8, in <module>
import numpy as np
ModuleNotFoundError: No module named 'numpy'
Same thing with matplotlib. It also give a "no module named 'matplotlib' error.
So, I tried to force the program to find numpy by editing the .bashrc...rather actually a new file .bash_aliases.
Code: Select all
alias numpy = /usr/lib/python3/dist-resources/numpy
Then, I entered the following command
Same result. It did not find 'numpy'. So, I rebooted and got the
Screen of Death. It is the one you can never return from!!
