Python Forum
scipy looks like it installs, but does not
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
scipy looks like it installs, but does not
#1
Output:
lt1a/root/2 /root 22# time logcmd -s install-scipy pip install --upgrade --cache-dir /var/lib/pip-cache scipy Script started, file is ./20231231-231415-980183-install-scipy.log 23:14:15 [980188] EXECUTING: 'pip' 'install' '--upgrade' '--cache-dir' '/var/lib/pip-cache' 'scipy' Requirement already satisfied: scipy in /usr/local/lib/python3.8/dist-packages (1.10.1) Requirement already satisfied: numpy<1.27.0,>=1.19.5 in /usr/local/lib/python3.8/dist-packages (from scipy) (1.24.4) WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv [[ 0m1s real 1.388 - user 0.727 - sys 0.069 - 57.34% ]] 23:14:16 [980188] FINISHED - status = 0 Script done, file is ./20231231-231415-980183-install-scipy.log [[ 0m2s real 2.423 - user 0.738 - sys 0.070 - 33.36% ]] lt1a/root/2 /root 23# py3 Python 3.8.10 (default, Nov 22 2023, 10:22:35) [GCC 9.4.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import scipy Traceback (most recent call last): File "<stdin>", line 1, in <module> ModuleNotFoundError: No module named 'scipy' >>> lt1a/root/2 /root 24#
any ideas what is goofed?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#2
Which interpreter is executed by py3? Is it the same interpreter as the pip command?
« We can solve any problem by introducing an extra level of indirection »
Reply
#3
(Jan-01-2024, 07:02 AM)Gribouillis Wrote: Which interpreter is executed by py3? Is it the same interpreter as the pip command?
Output:
lt1a/forums/3 /home/forums 4> which py3 /usr/host/bin/py3 lt1a/forums/3 /home/forums 5> ls -il /usr/host/bin/py3 144853 lrwxrwxrwx 1 root root 22 Dec 7 18:45 /usr/host/bin/py3 -> ../../../bin/python3.8 lt1a/forums/3 /home/forums 6> ls -il ../../../bin/python3.8 2278 -rwxr-xr-x 1 root root 5465880 Nov 22 05:22 ../../../bin/python3.8 lt1a/forums/3 /home/forums 7> ls -il /usr/bin/python3.8 2278 -rwxr-xr-x 1 root root 5465880 Nov 22 05:22 /usr/bin/python3.8 lt1a/forums/3 /home/forums 8> ls -il /bin/python3.8 2278 -rwxr-xr-x 1 root root 5465880 Nov 22 05:22 /bin/python3.8 lt1a/forums/3 /home/forums 9> /bin/python3.8 Python 3.8.10 (default, Nov 22 2023, 10:22:35) [GCC 9.4.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> lt1a/forums/3 /home/forums 10> /usr/bin/python3.8 Python 3.8.10 (default, Nov 22 2023, 10:22:35) [GCC 9.4.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> lt1a/forums/3 /home/forums 11>
Ubuntu 20.4 replicates /bin and /usr/bin so either path to python3 works. i am doing this as root to ensure that everything is available system-wide for all users.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#4
(Jan-01-2024, 04:24 AM)Skaperen Wrote: Requirement already satisfied: scipy in /usr/local/lib/python3.8/dist-packages (1.10.1)
This line indicates the directory containing the scipy package. Check that this directory is in sys.path. Try
Output:
py3 -c "import sys; print(sys.path)"
« We can solve any problem by introducing an extra level of indirection »
Reply
#5
Output:
lt1a/forums/3 /home/forums 4> py3 -c "import sys; print(sys.path)" ['', '/home/forums', '/home/forums/py', '/home/forums/py/lib', '/home/forums/lib', '/usr/host/lib/py', '/usr/host/lib', '/usr/local/lib/py', '/usr/local/lib', '/lib/python38.zip', '/lib/python3.8', '/lib/python3.8/lib-dynload', '/lib/python3/dist-packages'] lt1a/forums/3 /home/forums 5>
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#6
We see that /usr/local/lib/python3.8/dist-packages is not in sys.path, which is why Python doesn't find scipy. I don't know why it is so but you are a specialist of strange configurations. Get the path to sitecustomize.py by running
Output:
py3 -c 'import sitecustomize; print(sitecustomize)'
In sitecustomize.py you can add the line
import sys
sys.path.append('/usr/local/lib/python3.8/dist-packages')
Now scipy should be importable.
« We can solve any problem by introducing an extra level of indirection »
Reply
#7
(Jan-14-2024, 08:23 AM)Gribouillis Wrote: In sitecustomize.py you can add the line
i do not find file sitecustomize.py in my /usr tree.
Output:
Python 3.8.10 (default, Nov 22 2023, 10:22:35) [GCC 9.4.0] on linux
i did find /usr/lib/python2.7/sitecustomize.pyc but i don't believe that gets involved.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Python to exe-Does it do Pip installs? Extra 1 1,093 May-12-2022, 09:27 PM
Last Post: snippsat
  listing file that pip installs upgrades Skaperen 1 1,908 Dec-10-2020, 10:37 AM
Last Post: snippsat
  Why isnt this working? pip installs not working with cmd prompt? ejected 2 3,208 Apr-02-2019, 08:48 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020